Federico José Rivas Moreno / Mbed 2 deprecated EA_Twitter

Dependencies:   mbed lwip

Files at this revision

API Documentation at this revision

Comitter:
frivas
Date:
Wed Nov 10 11:53:28 2010 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
precomp.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 5eb38a4d0632 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Nov 10 11:53:28 2010 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+
+EthernetNetIf eth; 
+
+int main() {
+
+  printf("Init\n");
+
+  printf("\r\nSetting up...\r\n");
+  EthernetErr ethErr = eth.setup();
+  if(ethErr)
+  {
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  printf("\r\nSetup OK\r\n");
+
+  HTTPClient twitter;
+  
+  HTTPMap msg;
+  msg["status"] = "I am tweeting from my mbed!"; //A good example of Key/Value pair use with Web APIs
+
+  twitter.basicAuth("myuser", "mypass"); //We use basic authentication, replace with you account's parameters
+  
+  //No need to retieve data sent back by the server
+  HTTPResult r = twitter.post("http://api.supertweet.net/1/statuses/update.xml", msg, NULL); 
+  if( r == HTTP_OK )
+  {
+    printf("Tweet sent with success!\n");
+  }
+  else
+  {
+    printf("Problem during tweeting, return code %d\n", r);
+  }
+  
+  return 0;
+
+}
diff -r 000000000000 -r 5eb38a4d0632 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 10 11:53:28 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0
diff -r 000000000000 -r 5eb38a4d0632 precomp.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/precomp.lib	Wed Nov 10 11:53:28 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_unsupported/code/lwip/
\ No newline at end of file