# Twitter lib problems

**URL:** <https://forum.arduino.cc/t/twitter-lib-problems/6348>\
**Category:** Frequently-Asked Questions\
**Created:** [September 17, 2010, 6:54pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348 "2010-09-17T18:54:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 17, 2010, 6:54pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/1 "2010-09-17T18:54:52Z")

</div>

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:

```cpp
#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.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 17, 2010, 7:57pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/2 "2010-09-17T19:57:40Z")

</div>

403 is authentication required. Maybe the hash of your password is wrong?

---

<div class="post-metadata">

**Author:** ![cowjam](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@cowjam](https://forum.arduino.cc/u/cowjam)\
**Post date:** [September 17, 2010, 9:25pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/3 "2010-09-17T21:25:32Z")

</div>

Have you:

- Checked that your arduino can get on the internet? Run the ethernet sample sketch that grabs data from a website to test it.
- Gone to [http://arduino-tweet.appspot.com/](http://arduino-tweet.appspot.com/) and got yourself a token, and used that in your code (I'm presuming you have, you seem to have obscured it in your post)
- Checked that the messages aren't being posted on twitter

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 17, 2010, 9:38pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/4 "2010-09-17T21:38:33Z")

</div>

I had already checked all this. Found out that 403 means forbidden at twitter, too. But why is it forbidden?

---

<div class="post-metadata">

**Author:** ![zooto68](https://avatars.discourse-cdn.com/v4/letter/z/5f9b8f/32.png) [@zooto68](https://forum.arduino.cc/u/zooto68)\
**Post date:** [October 6, 2010, 3:03pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/5 "2010-10-06T15:03:30Z")

</div>

This library does not work under 0021

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 2, 2010, 11:55pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/6 "2010-12-02T23:55:47Z")

</div>

Hi,

I'm having this same problem, was it ever solved?

Thanks,

Ian

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 8, 2010, 6:03pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/7 "2010-12-08T18:03:48Z")

</div>

oh, i have same prob too. i don't know what should i do.  
please any idea for that?

* * *

[Nice Ties](http://www.newnecktie.com)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 6:37pm UTC](https://forum.arduino.cc/t/twitter-lib-problems/6348/8 "2021-05-06T18:37:37Z")

</div>


