Hi, I am trying to post on my twitter acoount and I am not being able to make it. The code i am using is below. Could anyone can help me out in this as soon as possible, its for my senior project this week. thanks in advance.
#include <SPI.h> // needed in Arduino 0019 or later
#include <Ethernet.h>
#include <Twitter.h>
// Ethernet Shield Settings
//byte mac[] = { 0xXX, 0xXX, 0xXX, 0xXX, 0xXX, 0xXX };
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// If you don't specify the IP address, DHCP is used(only in Arduino 1.0 or later).
byte ip[] = {10,0,0,16};
//IPAddress myDns(75, 75,75,75);
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("4288347436-LniC1muBjCJYsCXDuVUfovQbtxSAsNYPYcNHA6v");
// Message to post
char msg[] = "Hello, World! I'm Arduino!";
void setup()
{
//delay(1000);
//Ethernet.begin(mac, ip, myDns);
// or you can use DHCP for autoomatic IP address configuration.
Ethernet.begin(mac);
Serial.begin(9600);
Serial.println("connecting ...");
if (twitter.post(msg)) {
// Specify &Serial to output received response to Serial.
// If no output is required, you can just omit the argument, e.g.
// int status = twitter.wait();
int status = twitter.wait(&Serial);
if (status == 200) {
Serial.println("OK.");
} else {
Serial.print("failed : code ");
Serial.println(status);
}
} else {
Serial.println("connection failed.");
}
}
void loop()
{
}