Pages: [1]   Go Down
Author Topic: Lifegraph: A new library for connecting to JSON APIs like Facebook  (Read 821 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After using the WiFlyHQ library for a couple of socially connected devices, I decided to wrap up the useful parts so other people can connect to Facebook, or any other JSON API.

The source code and examples are here: https://github.com/lifegraph/arduino-lifegraph.

A tutorial for setting up an Arduino and making a call to Facebook is here: https://github.com/lifegraph/arduino-wifi-setup
More tutorials: http://www.lifegraphlabs.com/

Give it a try, and let me know what you think. I'll keep adding features to make this the most useful.

Code:
  // Make an HTTP request for graph.facebook.com/lifegraphlabs
  Facebook.get ( NULL, "lifegraphlabs" );
  int status_code = Facebook.request();
 
  // The request is successful if it returns an HTTP status code
  // of "200" (HTTP OK). Update the light accordingly.
  digitalWrite(light, status_code == 200 ? HIGH : LOW);

  // Notify terminal of our status.
  Serial.print("HTTP Status Code: ");
  Serial.println(status_code);
Logged

Pages: [1]   Go Up
Jump to: