strange ethernet shield behavior

I recently got a few ethernet shields, the ones with microSD slots in them (

It is working well as a web server but when I use it as a web client it is very spotty and acts very strange. the WebClient.pde example works usually and prints a bunch of google html code into the serial monitor. If I upload the sketch a few times to the arduino, though, it stops working until i restart my computer. However, I’m trying to make something that reads twitter feeds and at first it was connecting and everything was working fine and then it would take a long time to connect and then after a few more uploads of code to the Arduino it immediately disconnects me from twitter (I changed nothing in the ethernet code). I tried the sketch in both 0021 and 0018. Sometimes the code won’t even compile and it gives strange errors about not being able to delete stuff or find other files…

below is the relevant code in my twitter sketch. thanks so much for any help!

#include <TextFinder.h>
#include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,177 };
//byte server[] = { 168,143,162,68 }; // twitter
byte server[] = {128,242,240,20}; // Twitter
char tweet[140];
// Initialize the Ethernet client library
// with the IP address and port of the server 
// that you want to connect to (port 80 is default for HTTP):
Client client(server, 80);
LiquidCrystal lcd(7, 6, 5, 8, 3, 2);
TextFinder  finder( client );  
void setup() {
  // start the Ethernet connection:
   lcd.begin(16, 2);
  Ethernet.begin(mac, ip);
  // start the serial library:
  // give the Ethernet shield a second to initialize:
lcd.println("Lavender Haikus");
  // if you get a connection, report back via serial:
  if (client.connect()) {
    // Make a HTTP request:
    client.println("GET /statuses/user_timeline/213070566.rss HTTP/1.0");
  else {
    // kf you didn't get a connection to the server:
    Serial.println("connection failed");
    lcd.println("you messed up!");

void loop()
  // if there are incoming bytes available 
  // from the server, read them and print them:
  if (client.available()) {
    //char c =;
   if((finder.find("<item>")&&(finder.getString("lavendercorp: ","</title>",tweet,140)!=0)))

You may to add client.stop(); in your code.

hi thanks for your help! sorry..i didn't past all my code. at the end of the sketch i do have:

  //if the server's disconnected, stop the client:
  if (!client.connected()) {

   // do nothing forevermore: