Get Twitter Timeline from Supertweet

Dependencies:   EthernetNetIf HTTPClientStreamingExample NetServices mbed

Fork of HTTPClientStreamingExample by Donatien Garnier

Revision:
4:8a9a71b740a7
Parent:
3:b69bca736df0
--- 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