Using Arduino ethernet shield to read data from webpage - eventually twitter

Hi, I hope someone can help me here as I feel like I’ve been banging my head against the wall all day. I’m not sure if this is in the right section either so if it’s not, let me know and I’ll move it.

I’m working on a final year physics project using the Arduino & raspberry pi as digital intelligent control systems - I’ve spent the past week working on internet communication.

I’ve been having trouble trying to work with twitter API 1.1 to read tweets but this morning I followed this tutorial to let PHP take care of the Oauth side of things. I’ve never used PHP before and had to sign up to a free web hosting service that has PHP and curl enabled. Don’t ask me what curl is/does though…

I’ve ended up with this page showing the previous 10 tweets from the twitter account created for this project. That’s as far as I have been able to get.

I tried to use the TextFinder library in a manner similar to the solutions here but I was unable to read anything from my PHP page.

Now, I’m just trying to read the data in using a modified “web client” sketch from the ethernet library.

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xE4 };
byte ip[] =      { 192, 168,   0,   14 };
byte gateway[] = { 192, 168,   0,   1 };
byte subnet[] =  { 255, 255, 255,   0 };
char host[] = "";
EthernetClient client;
void setup()
  Ethernet.begin(mac, ip, gateway, subnet);
  Serial.println("Connecting to server...");
  if (client.connect(host, 80)) {
    client.println("GET /user_timeline.php HTTP/1.1");
    client.print("Host: ");
    client.println("User-Agent: arduino-ethernet");
void loop()
  // if there are incoming bytes available 
  // from the server, read them and print them:
  if (client.available()) {
    char c =;

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

    // do nothing forevermore:

All that appears in the serial monitor is:

Connecting to server…


When using the example from the library as is (with google) it works fine but it’s giving me problems when using my own page. Is there something completely obvious that I’m missing here? Any help/suggestions would be really appreciated.

I should add that I’m a complete novice with Arduino & PHP so if you come back with a suggestion don’t be alarmed if my response is “wha?”. I’ll get there eventually.