Go Down

Topic: Twitter and duplicate post fix? (Read 712 times) previous topic - next topic


I have two way communication working on my Arduino with ethernet shield. Right now with each button press it tweets that a button has been press x many times, turn on LED? If a tweet a Yes the LED turns on and a No turns it off. If a Yes does not work then two duplicate posts in a row will not work.  A time stamp or random number after each Yes or No is possible but ugly. Is there another way?
I found the bit of code below that I am NOT currently using because i'm not sure what it does or if it is a possible fix for my problem. No idea what the "status == 200)" does.

if (twitter.post(buffer)) {
    int status = twitter.wait();
    if (status == 200) {
    } else {
      Serial.print("failed : code ");
  } else {
    Serial.println("connection failed.");


No idea what the "status == 200)" does.

Every HTTP transaction returns a status code. 200 is success in HTTP terms. This code is testing that the last post was successful. If so, it sends one message to the serial port. If not, it sends another.

It does nothing to ensure that the post WILL BE successful.

Right now with each button press it tweets that a button has been press x many times, turn on LED?

Why would anyone else in the world care?


Each twitter post is set up to text my cell phone so I use it now as a remote monitor with the ability to turn on and off I/O pins with my cell. No one cares to read these twitter posts but me. It could be connected to a motion sensor with the ability to turn on an alarm, monitor the temperature of something with the ability to remotely shut it down if it gets too hot. Many possibilities...


Many possibilities...

Sure there are. But 99.999% of them are of interest to you, and only you. That is not what Twitter is for. If you expect to abuse a free service, you need to play by their rules.

Otherwise, spend the $10 a month for your own web site that you can post freely to.


To be fair, it's probably as interesting as anything else on Twitter.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131