Hi,
I'm trying to get my Arduino+official Ethernetshield tweeting. I ended up (after a whole afternoon) with the twitter lib from the playground on arduino-0018 as 19 doesn't seem to work at all. I always get the Serial-message "failed : code 403". Here is my code:
#include <Ethernet.h>
#include <EthernetDHCP.h>
#include <EthernetDNS.h>
#include <Twitter.h>
byte mac[] = { 0xFE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// Your Token to Tweet (get it from http://arduino-tweet.appspot.com/)
Twitter twitter("5xxxxxxxxxxxxxxxxxxxxxe");
// Message to post
char msg[] = "starting...";
void setup()
{
delay(1000);
EthernetDHCP.begin(mac);
Serial.begin(9600);
Serial.println("connecting ...");
if (twitter.post(msg)) {
int status = twitter.wait();
if (status == 200) {
Serial.println("OK.");
} else {
Serial.print("failed : code ");
Serial.println(status);
}
} else {
Serial.println("connection failed.");
}
}
void loop()
{
twitter.post("regular tweet test");
Serial.println("tweet to check regularity posted!");
delay(10000);
EthernetDHCP.maintain();
}
When I power up the board, it tweets "starting..." and only once "regular tweet test", but it prints Serial regularly the "tweet to check regularity posted!" message.
Hope you can help me. I originally wanted to tweet the temperature outdoors regularly. Twitter is therefor nice as I get the data with the time and date easily like that.