Get Twitter Timeline from Supertweet

Dependencies:   EthernetNetIf HTTPClientStreamingExample NetServices mbed

Fork of HTTPClientStreamingExample by Donatien Garnier

Files at this revision

API Documentation at this revision

Comitter:
nameless129
Date:
Mon Aug 19 12:11:40 2013 +0000
Parent:
3:b69bca736df0
Commit message:
Get Twitter Timeline from Supertweet

Changed in this revision

HTTPClient.lib Show diff for this revision Revisions of this file
HTTPClientStreamingExample.cpp Show annotated file Show diff for this revision Revisions of this file
HTTPClientStreamingExample.lib Show annotated file Show diff for this revision Revisions of this file
NetServices.lib Show annotated file Show diff for this revision Revisions of this file
diff -r b69bca736df0 -r 8a9a71b740a7 HTTPClient.lib
--- a/HTTPClient.lib	Fri Jul 09 14:45:12 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/donatien/code/HTTPClient/#d97a4fc01c86
diff -r b69bca736df0 -r 8a9a71b740a7 HTTPClientStreamingExample.cpp
--- a/HTTPClientStreamingExample.cpp	Fri Jul 09 14:45:12 2010 +0000
+++ b/HTTPClientStreamingExample.cpp	Mon Aug 19 12:11:40 2013 +0000
@@ -2,6 +2,7 @@
 #include "EthernetNetIf.h"
 #include "HTTPClient.h"
 
+Serial pc(USBTX, USBRX); // tx, rx
 EthernetNetIf eth; 
 HTTPClient http;
 
@@ -14,26 +15,26 @@
 }
 
 int main() {
+  pc.baud(921600);
 
-  printf("Start\n");
+  printf("Start\r\n");
 
-  printf("Setting up...\n");
+  printf("Setting up...\r\n");
   EthernetErr ethErr = eth.setup();
   if(ethErr)
   {
     printf("Error %d in setup.\n", ethErr);
     return -1;
   }
-  printf("Setup OK\n");
-  
+  printf("Setup OK\r\n");
+  http.basicAuth("username", "supertweet_password");
   HTTPStream stream;
   
   char BigBuf[512 + 1] = {0};
   stream.readNext((byte*)BigBuf, 512); //Point to buffer for the first read
-  //HTTPResult r = http.get("http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml", &stream, request_callback); //Load a very large page, such as the hackaday RSS feed
-  //HTTPResult r = http.get("http://hackaday.com/feed/", &stream, request_callback); //Load a very large page, such as the hackaday RSS feed
-  HTTPResult r = http.get("http://mbed.org/blog/feeds/entries/", &stream, request_callback); //Load a very large page
-  
+  HTTPResult r = http.get("http://api.supertweet.net/1.1/statuses/home_timeline.json", &stream, request_callback); 
+  //HTTPResult r = http.get("http://api.supertweet.net/1.1/statuses/mentions_timeline.json", &stream, request_callback);
+
   while(!completed)
   {
     Net::poll(); //Polls the Networking stack
diff -r b69bca736df0 -r 8a9a71b740a7 HTTPClientStreamingExample.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClientStreamingExample.lib	Mon Aug 19 12:11:40 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/donatien/code/HTTPClientStreamingExample/#b69bca736df0
diff -r b69bca736df0 -r 8a9a71b740a7 NetServices.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NetServices.lib	Mon Aug 19 12:11:40 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/segundo/code/NetServices/#4e2468d7d5cb