Ethernet Simple Tweet Post (Failed connection)

Hello people of the Forums, see I am having a problem with my arduino sketch.
I am trying to run this sketch from the Twitter library.

#if defined(ARDUINO) && ARDUINO > 18   // Arduino 0019 or later
#include <SPI.h>
#endif
#include <Ethernet.h>
//#include <EthernetDNS.h>  Only needed in Arduino 0022 or earlier
#include <Twitter.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 10, 0, 0, 177 };
Twitter twitter("<<< your token here >>>");
char msg[] = "Hello, World! I'm Arduino!";

void setup()
{
  delay(1000);
  Ethernet.begin(mac, ip);
  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()
{
}

I could get the ethernet shield to run some sketchs but I couldn't get the twitter one to work. Im running on mac with arduino UNO R3, and ethernet shield. Can't get it to post a tweet. It compiles well but then on serial it says

"connection failed"

. Help would be accepted, thanks.

Just a wild guess: It cannot find your gateway or DNS. Either use DHCP or configure all parameters.

Im a bit new to the ethernet shield, how can I do this?

If you have a pretty standard setup, you can just use DHCP by replacing the following line:

Ethernet.begin(mac, ip);

by

Ethernet.begin(mac);

Ensure you use a current IDE, version prior to 1.0.3 (AFAIR) contained bugs in the Ethernet code.

I get error 0 on the serial. :(. Not able to post a tweet yet.

I get error 0 on the serial.

There is no word "error" in your code, how can you get that output?

And print out the network configuration you get from the DHCP. Use the following methods of the Ethernet class for that:

  IPAddress localIP();
  IPAddress subnetMask();
  IPAddress gatewayIP();
  IPAddress dnsServerIP();

I got error 0 in Serial Monitor and How can I get these? I checked the arduino library but I only know my local I.P. Could you guide me on how to get these:

IPAddress subnetMask();
IPAddress gatewayIP();
IPAddress dnsServerIP();

Thanks for all the help.

I got error 0 in Serial Monitor

Post some code to PROVE it.

Ethernet.begin(mac);
IPAddress subnet = Ethernet.subnetMask();
IPAddress gateway = Ethernet.gatewayIP();
IPAddress dns = Ethernet.dnsServerIP();

Serial.print("subnet: ");
Serial.println(subnet);
Serial.print("gateway: ");
Serial.println(gateway);
Serial.print("dns: ");
Serial.println(dns);

What do you get if you replace your Ethernet.begin() by the code above?

Thanks, I will post today what I get and I'll post my error.