<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Adam Parrish &#187; essay</title>
	<atom:link href="http://www.decontextualize.com/tag/essay/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.decontextualize.com</link>
	<description>decontextualize.com</description>
	<lastBuildDate>Sun, 29 Jan 2012 23:57:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Social network APIs: A revised lexical analysis</title>
		<link>http://www.decontextualize.com/2010/04/social-network-apis-a-revised-lexical-analysis/</link>
		<comments>http://www.decontextualize.com/2010/04/social-network-apis-a-revised-lexical-analysis/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 14:00:55 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[essay]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[graphapi]]></category>
		<category><![CDATA[socialsoftware]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/?p=634</guid>
		<description><![CDATA[Last October I undertook a &#8220;lexical analysis&#8221; of the Twitter and Facebook APIs. Twitter came out on top in that analysis. I concluded that Twitter&#8217;s &#8220;simplicity &#8230; has been an important factor in [its] widespread growth among both users and developers&#8221; while Facebook&#8217;s &#8220;baroque and insular&#8221; API makes it impossible for users and developers to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.decontextualize.com/2009/10/social-network-apis-a-lexical-analysis/">Last October I undertook a &#8220;lexical analysis&#8221;</a> of the Twitter and Facebook APIs. Twitter came out on top in that analysis. I concluded that Twitter&#8217;s &#8220;simplicity &#8230; has been an important factor in [its] widespread growth among both users and developers&#8221; while Facebook&#8217;s &#8220;baroque and insular&#8221; API makes it impossible for users and developers to &#8220;keep track of how everything works together.&#8221; Facebook&#8217;s been promising changes for a while, and change has indeed arrived, in the form of the new <a href="http://developers.facebook.com/docs/api">Graph API</a>. So how does the Graph API compare, lexically, to Twitter? Here&#8217;s a revised analysis. (Spoiler: things are looking much better for Facebook.)</p>
<table cellspacing="10">
<tbody>
<tr>
<th><a href="http://wiki.developers.facebook.com/index.php/API">Facebook Graph API</a></th>
<th><a href="http://apiwiki.twitter.com/Twitter-API-Documentation">Twitter</a></th>
</tr>
<tr>
<td valign="top" width="50%"><b>Verbs</b><br />
get<br />
post<br />
delete</p>
<p>      <b>Nouns</b><br />
album<br />
photo<br />
event<br />
group<br />
link<br />
note<br />
page<br />
photo<br />
post<br />
status message<br />
user<br />
video<br />
comment<br />
feed<br />
noreply<br />
maybe<br />
invited<br />
attending<br />
declined<br />
picture<br />
member<br />
home<br />
tag<br />
activities<br />
interests<br />
friends<br />
music<br />
books<br />
movies<br />
television<br />
likes<br />
inbox<br />
outbox<br />
updates<br />
search
</td>
<td valign="top" width="50%"><b>Verbs</b><br />
      get<br />
      show<br />
      update<br />
      destroy<br />
      post<br />
      put<br />
      exists<br />
      verify<br />
      end<br />
      follow<br />
      leave<br />
      report<br />
      request<br />
      authorize<br />
      authenticate</p>
<p>      <b>Nouns</b><br />
      search<br />
      trend<br />
      status<br />
      timeline<br />
      mention<br />
      retweet<br />
      friend<br />
      follower<br />
      direct message<br />
      friendship<br />
      id<br />
      account<br />
      session<br />
      delivery device<br />
      color<br />
      image<br />
      profile<br />
      favorite<br />
      notification<br />
      block<br />
      spam<br />
      search<br />
      token<br />
      test<br />
      place<br />geocode</td>
</tr>
</tbody>
</table>
<p>The tally: the Twitter API holds steady with <b>26</b> nouns and <b>15</b> verbs. The Graph API, meanwhile, has <b>35</b> nouns* and <b>3</b> verbs&#8212;a tremendous improvement on Facebook&#8217;s old (so-called) REST API, which has 43 nouns and 24 verbs. The Twitter API and Facebook&#8217;s REST API average around 1.7 nouns per verb; the Graph API has almost 12 nouns per verb. What&#8217;s especially interesting? The Graph API has managed to sidestep any verbs that aren&#8217;t HTTP methods.</p>
<p>The Graph API is a big deal, and an important step forward for Facebook. Here are a few reason I think that&#8217;s the case.</p>
<p>First of all, the Graph API is dead simple, especially compared to Facebook&#8217;s old REST API. Just as an example: the old API has (by my count) seven nearly synonymous verbs (<code>set</code>, <code>create</code>, <code>add</code>, <code>register</code>, <code>upload</code>, <code>send</code>, <code>publish</code>) that all essentially mean &#8220;add content for a user.&#8221; These verbs aren&#8217;t interchangeable; each works with only a subset of nouns (or even just a single noun). Each verb has idiosyncratic behaviors, arguments and error messages. The Facebook REST API is, in short, a mishmash of conflicting conceptual models. It&#8217;s tough to get a handle on all of it.</p>
<p>Not so with the Graph API. Every resource has exactly the same interface. Once you understand what each noun is, it&#8217;s easy to understand how to manipulate it&#8212;there are only three possible verbs, after all!</p>
<p>The complexity of the REST API necessitated a client library to perform even very simple operations. The Graph API, on the other hand, is so simple, I think that most developers won&#8217;t even use a library at all&#8212;it&#8217;s easier to just hit the URLs directly. Simply put: if you know how to make HTTP requests, you know how to use the Graph API.</p>
<p>That&#8217;s the second thing that makes the Graph API so important&#8212;it&#8217;s the web. The Graph API isn&#8217;t just a bunch of function calls for retrieving information; it&#8217;s a set of URLs to representations of the data itself. The data is all in JSON format, so it&#8217;s easy for browsers to consume it directly. Image URLs return the images themselves, so they can be thrown right into <code>img</code> tags without an intermediary API call. Most importantly, the resources returned from the Graph API are hypermedia: they include URLs to related resources. An example (from the documentation):</p>
<pre class="brush: text">
{
   &quot;name&quot;: &quot;Facebook Developer Garage Austin - SXSW Edition&quot;,
   &quot;metadata&quot;: {
      &quot;connections&quot;: {
         &quot;feed&quot;: &quot;http://graph.facebook.com/331218348435/feed&quot;,
         &quot;picture&quot;: &quot;https://graph.facebook.com/331218348435/picture&quot;,
         &quot;invited&quot;: &quot;https://graph.facebook.com/331218348435/invited&quot;,
         &quot;attending&quot;: &quot;https://graph.facebook.com/331218348435/attending&quot;,
         &quot;maybe&quot;: &quot;https://graph.facebook.com/331218348435/maybe&quot;,
         &quot;noreply&quot;: &quot;https://graph.facebook.com/331218348435/noreply&quot;,
         &quot;declined&quot;: &quot;https://graph.facebook.com/331218348435/declined&quot;
      }
   }
}
</pre>
<p>The URLs are right there in the document, meaning that you don&#8217;t have to know anything else about how the Graph API works in order to get information related to a resource. Pretty slick. It&#8217;s an idea that (I think) every web API should incorporate.</p>
<p>There are, of course, a few factors that mitigate my enthusiasm for the Graph API. First off, it doesn&#8217;t quite model the entirety of Facebook&#8217;s functionality yet&#8212;notably, there aren&#8217;t any resources (so far) representing Facebook applications themselves. There are also privacy concerns that need to be addressed (<a href="http://zestyping.livejournal.com/256801.html">for example, event listings</a>). </p>
<p>Overall, though, the Graph API is beautifully constructed. It&#8217;s just as robust as the Facebook&#8217;s old API, but simpler, more convenient, and easier to integrate. As a developer (and programming instructor), my opinion has always been that Twitter&#8217;s main advantage over Facebook is its developer-friendly API. The Graph API has the potential to erase that advantage.</p>
<p><small>* There are a number of verb-like words and verb participles in the Facebook &#8220;noun&#8221; list. I classify them as such because, to my eye, they&#8217;re clearly presented in the API documentation as things you can act on, rather than actions you can take. For example, <i>attending</i> means &#8220;users who are attending something,&#8221; and acting on that resource allows you to fetch or manipulate that list of users.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2010/04/social-network-apis-a-revised-lexical-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Social network APIs: a lexical analysis</title>
		<link>http://www.decontextualize.com/2009/10/social-network-apis-a-lexical-analysis/</link>
		<comments>http://www.decontextualize.com/2009/10/social-network-apis-a-lexical-analysis/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:19:51 +0000</pubDate>
		<dc:creator>adam</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[essay]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.decontextualize.com/2009/10/social-network-apis-a-lexical-analysis/</guid>
		<description><![CDATA[Facebook Twitter Verbs get set ban unban create expire promote revoke run add remove register cancel edit invite rsvp delete refresh query is/are upload send mark publish Nouns allocation property metric restriction user info token session authorization permission batch comment friend count cookie member tag url handle group translation link string message thread folder note [...]]]></description>
			<content:encoded><![CDATA[<table>
<tbody>
<tr>
<th><a href="http://wiki.developers.facebook.com/index.php/API">Facebook</a></th>
<th><a href="http://apiwiki.twitter.com/Twitter-API-Documentation">Twitter</a></th>
</tr>
<tr>
<td valign="top" width="50%"><b>Verbs</b><br />
      get<br />
      set<br />
      ban<br />
      unban<br />
      create<br />
      expire<br />
      promote<br />
      revoke<br />
      run<br />
      add<br />
      remove<br />
      register<br />
      cancel<br />
      edit<br />
      invite<br />
      rsvp<br />
      delete<br />
      refresh<br />
      query<br />
      is/are<br />
      upload<br />
      send<br />
      mark<br />
      publish</p>
<p>      <b>Nouns</b><br />
      allocation<br />
      property<br />
      metric<br />
      restriction<br />
      user<br />
      info<br />
      token<br />
      session<br />
      authorization<br />
      permission<br />
      batch<br />
      comment<br />
      friend<br />
      count<br />
      cookie<br />
      member<br />
      tag<br />
      url<br />
      handle<br />
      group<br />
      translation<br />
      link<br />
      string<br />
      message<br />
      thread<br />
      folder<br />
      note<br />
      notification<br />
      list<br />
      e-mail<br />
      page<br />
      fan<br />
      photo<br />
      album<br />
      profile<br />
      sms<br />
      stream<br />
      option<br />
      like<br />
      filter<br />
      status<br />
      video<br />
      limit</td>
<td valign="top" width="50%"><b>Verbs</b><br />
      get<br />
      show<br />
      update<br />
      destroy<br />
      post<br />
      put<br />
      exists<br />
      verify<br />
      end<br />
      follow<br />
      leave<br />
      report<br />
      request<br />
      authorize<br />
      authenticate</p>
<p>      <b>Nouns</b><br />
      search<br />
      trend<br />
      status<br />
      timeline<br />
      mention<br />
      retweet<br />
      friend<br />
      follower<br />
      direct message<br />
      friendship<br />
      id<br />
      account<br />
      session<br />
      delivery device<br />
      color<br />
      image<br />
      profile<br />
      favorite<br />
      notification<br />
      block<br />
      spam<br />
      search<br />
      token<br />
      test</td>
</tr>
</tbody>
</table>
<p>I made this list by combing through both services&#8217; API documentation and extracting noun-like words and verb-like words from the names of resources or methods. Facebook count: <b>24</b> verbs, <b>43</b> nouns. Twitter count: <b>15</b> verbs, <b>24</b> nouns.</p>
<p>Here&#8217;s what I think these numbers mean.</p>
<p>Facebook manages many different kinds of content, and allows you to perform many different kinds of actions on that content, though the actions that you can perform on one kind of content are inconsistent with the actions you can perform on another. Twitter has fewer types of content, and a more consistent set of HTTP-like actions to perform on that content.</p>
<p>The Facebook API tends toward the baroque and insular, while the Twitter API tries its best to be a part of the web. In general, the Twitter API is much more straightforward.</p>
<p>I think this simplicity&#8212;this paucity of nouns and verbs&#8212;has been an important factor in Twitter&#8217;s widespread growth among both users and developers.</p>
<p>Developers can be confident that&#8212;even if Twitter&#8217;s API changes&#8212;they&#8217;ll still be doing mostly the same actions (getting, posting, updating) on mostly the same things (statuses, friendships, direct messages). Users know exactly how all the moving parts of Twitter work together, and are therefore better able to understand how a given application might augment that.</p>
<p>On Facebook, the opposite is true. User statuses, notifications, event invitations, feed stories, photos&#8212;they all have different interfaces and behave in different ways.  Even long-time developers can&#8217;t keep track of how everything works together.</p>
<p>Interestingly, <a href="http://developers.facebook.com/news.php?blog=1&#038;story=326">Facebook&#8217;s platform roadmap</a> says that one of Facebook&#8217;s goals is to &#8220;focus [...] communication on the stream and Inbox,&#8221; which will make communication on Facebook feel much more like Twitter. I think this is a smart move&#8212;anything that simplifies the user&#8217;s model of how communication on Facebook works is a good idea, both for users and developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.decontextualize.com/2009/10/social-network-apis-a-lexical-analysis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

