Donatien Garnier / Mbed 2 deprecated NetTwitterExample

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
donatien
Date:
Tue May 25 09:37:46 2010 +0000
Parent:
0:bebc049c43f8
Commit message:

Changed in this revision

TwitterExample.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TwitterExample.cpp	Tue May 25 09:37:46 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://twitter.com/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;
+
+}
--- a/main.cpp	Tue May 25 09:33:50 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#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://twitter.com/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;
-
-}