How to post on my twitter account using a w5200 ethernet shield and arduino uno

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()
{
}

Without the code tags (which you should use to make your code more readable), you are probably using the wrong library for the w5200. This one works. Download and import it into your IDE.

Then change the include.

#include <EthernetV2_0.h>

I apologize for not include them. I am worried since I have to summit this project this week. I included the new library and it gives errors.

#include <SPI.h> // needed in Arduino 0019 or later
//#include <Ethernet.h>
#include <Twitter.h>
#include <EthernetV2_0.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()
{
}

The errors you did not post probably are due to the new ethernet library not being compatible with the twitter library.

Yes its probably due to that, but i cand find a new twitter library instead. the error is below

No such file or directory
 #include <Ethernet.h>

This is what I meant by the Twitter library not being compatible. But even if you can overcome that, you will have a hard time overcoming this. Twitter requires SSL, and neither library supports SSL. I tried to connect to Twitter on port 80 and this is the response. Note the location. https://twitter.com.

Starting ethernet...
ok
192.168.2.249
Ready
connecting...connected
HTTP/1.1 301 Moved Permanently
connection: close
content-length: 0
date: Sun, 29 Nov 2015 19:20:50 GMT
location: https://twitter.com/
server: tsa_a
set-cookie: guest_id=v1%3A144882485071912464; Domain=.twitter.com; Path=/; Expires=Tue, 28-Nov-2017 19:20:50 UTC
x-connection-hash: 2e2bb40c25860cd9c7f96165d73c056a
x-response-time: 3

Unless you bounce the messages through another server as a relay, you can't do it.

So its easier if i can get other Ethernet shield to test this project? what would you recommend me? I dont know how to do it.

No. None of the shields for an Arduino are SSL compatible. Unless the Twitter library uses a port 80 server to convert http to https, then relay to the Twitter server, you won't be able to do it.

there is a old post in here that they were able to get it worked.

It depends on what Twitter library you use. At least one uses a proxy server to convert the http connection to a https connection.
http://arduino-tweet.appspot.com/

I already tested that example and nothing, I am working on it now. Dont know what else i can do

I am trying to do that, I think Im not doing it right. could you help me?

The error messages should help you locate the include files you must change. Unless you post those messages, I can't help you.