{"id":628,"date":"2012-08-29T06:14:23","date_gmt":"2012-08-29T11:14:23","guid":{"rendered":"http:\/\/hoolihan.net\/blog-tim\/?p=628"},"modified":"2012-08-29T06:14:23","modified_gmt":"2012-08-29T11:14:23","slug":"working-with-social-network-apis","status":"publish","type":"post","link":"http:\/\/hoolihan.net\/blog-tim\/2012\/08\/29\/working-with-social-network-apis\/","title":{"rendered":"Working With Social Network APIs"},"content":{"rendered":"<p>Creating Vicinity Buzz naturally involved working with a the APIs of social networks. That information seemed worth sharing for those of you interested in writing any type of application that would integrate with a social network. <\/p>\n<h4>Developer Documentation<\/h4>\n<p>Any of the social networking sites you probably want to integrate with have developer api&#8217;s that are well documented. Here&#8217;s the starting points for a variety of services:<\/p>\n<ul>\n<li><a href=\"http:\/\/dev.twitter.com\/\">twitter<\/a><\/li>\n<li><a href=\"http:\/\/developers.facebook.com\/\">facebook<\/a><\/li>\n<li><a href=\"http:\/\/developer.linkedin.com\/apis\">linkedin<\/a><\/li>\n<li><a href=\"http:\/\/developers.google.com\/+\/api\/\">google+<\/a><\/li>\n<\/ul>\n<h4>Working With JSON<\/h4>\n<p>All of these APIs are best used with JSON. If you&#8217;re not familiar, you can read up at <a href=\"http:\/\/json.org\/\">json.org<\/a>. It&#8217;s the notation for serialization of javascript objects, and object literals. <\/p>\n<h4>Where To Make the Call From<\/h4>\n<p>If you are working in a standard web page, you could call the api from document.ready (assuming you are using jquery). This is the approach I take on <a href=\"http:\/\/hoolihan.net\">hoolihan.net<\/a>, my personal homepage. There is a twitter feed on the right side. <\/p>\n<p>If you have a bit more of an application, you may want to look at one of the many javascript frameworks that help you route events to actions. These are frameworks like <a href=\"http:\/\/backbonejs.org\/\">backbone<\/a>, <a href=\"http:\/\/knockoutjs.com\/\">knockout<\/a>, <a href=\"http:\/\/spinejs.com\/\">spine<\/a>, etc. There are also commercial variants like <a href=\"http:\/\/www.kendoui.com\/\">kendo<\/a>, <a href=\"http:\/\/dojotoolkit.org\/\">dojo<\/a>, and <a href=\"http:\/\/www.sencha.com\/\">sencha<\/a>. <\/p>\n<p>jQueryMobile is commonly paired with PhoneGap, and in that scenario, using something like backbone is a bit tricky. You may want to bring in a template binding library, but avoid routing.<\/p>\n<h4>Binding<\/h4>\n<p><a href=\"http:\/\/api.jquery.com\/category\/plugins\/templates\/\">jQuery.templates<\/a> was one of the first good javascript template binders that I&#8217;m aware of, but there are now many different options. In the jQuery world, most of the momentum seems aimed at <a href=\"https:\/\/github.com\/BorisMoore\/jsrender\">jsrender<\/a>. Recently I&#8217;ve considered bring in <a href=\"http:\/\/knockoutjs.com\/\">knockout<\/a> and only using the binding part, but I&#8217;m not far enough in to evaluate that direction.<\/p>\n<h4>API Keys<\/h4>\n<p>Unless you&#8217;re using the most basic parts of the API, you&#8217;ll probably need to register your app and get an API key. It&#8217;s a token that identifies your application. In the event of API abuse (too many calls, etc), they have information to contact you and analytics around the issue.<\/p>\n<h4>Open Authentication<\/h4>\n<p>This is a big topic, but if your application wants to use a social network to identify your users, this is possible via open authentication. If you are interested in this, get started <a href=\"http:\/\/www.openauthentication.org\/\">here<\/a>.<\/p>\n<h4>What Do You Think?<\/h4>\n<p>Are there any particular areas of the APIs that you&#8217;d like to see more detail about? Any conceptual parts that would warrant their own post? Let me know what you think below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating Vicinity Buzz naturally involved working with a the APIs of social networks. That information seemed worth sharing for those of you interested in writing any type of application that would integrate with a social network. Developer Documentation Any of the social networking sites you probably want to integrate with have developer api&#8217;s that are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,54,188,18,126,24],"tags":[226,142,141,213,217,189,276,158,77,69,140,202,272,91,124,40],"class_list":["post-628","post","type-post","status-publish","format-standard","hentry","category-data","category-javascript","category-mobile-2","category-programming","category-social-networks","category-web","tag-api","tag-data-2","tag-html5","tag-ios","tag-ipad","tag-iphone","tag-javascript","tag-jquery","tag-json","tag-linkedin","tag-mobile","tag-phonegap","tag-programming","tag-services","tag-technology","tag-xml"],"_links":{"self":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/comments?post=628"}],"version-history":[{"count":0,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/628\/revisions"}],"wp:attachment":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/media?parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/categories?post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/tags?post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}