<?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>Made of Everything You&#039;re Not &#187; twitter</title>
	<atom:link href="http://blog.ericlamb.net/tag/twitter/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ericlamb.net</link>
	<description>Thoughts on programming, people and life</description>
	<lastBuildDate>Thu, 27 Oct 2011 01:29:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Mea Culpa Twitter. Mea Culpa&#8230;</title>
		<link>http://blog.ericlamb.net/2009/11/mea-culpa-twitter-mea-culpa/</link>
		<comments>http://blog.ericlamb.net/2009/11/mea-culpa-twitter-mea-culpa/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 13:00:16 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Brain Dump]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[social networks]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=381</guid>
		<description><![CDATA[Anyone who knows me knows I&#8217;m not a fan of social networks. Frankly, I find participating in social networks to be a false representation of social behavior;  a farce I just don&#8217;t have the desire to humor. Not to get too preachy here but, well, this is my blog so na-na-nana-na: The way I look [...]]]></description>
			<content:encoded><![CDATA[<p>Anyone who knows me knows I&#8217;m not a fan of <a title="Social Networks" href="http://en.wikipedia.org/wiki/Social_Network" onclick="return TrackClick('http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FSocial_Network','Social+Networks')" target="_blank">social networks</a>. Frankly, I find participating in social networks to be a false representation of social behavior;  a farce I just don&#8217;t have the desire to humor. Not to get too preachy here but, well, this is my blog so na-na-nana-na:</p>
<div id="attachment_2592" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/10/twitter_logo.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F10%2Ftwitter_logo.png','Mea+Culpa+Twiter.+Mea+Culpa...')"><img class="size-medium wp-image-2592" title="Mea Culpa Twiter. Mea Culpa..." src="http://blog.ericlamb.net/wp-content/uploads/2009/10/twitter_logo-300x69.png" alt="Mea Culpa Twiter. Mea Culpa..." width="300" height="69" /></a><p class="wp-caption-text">Mea Culpa Twiter. Mea Culpa...</p></div>
<p>The way I look at social networks is as time sinks with little practical use compared to the maintenance and care required for the account. Not that I find them useless though. I had spent the last 4 years (around) working for a social marketing agency and have personally witnessed the benefits of social networks in building brand awareness and loyalty. But the work required entailed a dedicated, college educated, person and a couple student interns working 40 hours a week each to accomplish.</p>
<p>Me? I have shit to do thankyouverymuch. I <em>want</em> to spend my time producing ideas, projects and programs. I <em>don&#8217;t want</em> to spend any time tending to a social network profile with ephemeral friendships and connections. But apparently Twitter is different. <a title="We Travel In Tribes" href="http://www.randsinrepose.com/archives/2008/05/15/we_travel_in_tribes.html" onclick="return TrackClick('http%3A%2F%2Fwww.randsinrepose.com%2Farchives%2F2008%2F05%2F15%2Fwe_travel_in_tribes.html','We+Travel+In+Tribes')" target="_blank">Michael Lop</a> sums it up nicely:</p>
<blockquote><p>Twitter is a social network, yes, but it’s a social network without the superpoke scrabtaculous zombie noise and, for that, I’m thankful, because I’ve got work to do. Yes, I could spend days tidying my profile and scrubbing my friends list, but to what end? I want to know more people, and sure, it’s interesting to see what they’re up to, but what I really want to know is what is going on inside their heads with a minimum of fuss.</p></blockquote>
<p>So once again I&#8217;m late to a party acting like they&#8217;re <a title="Coming Late to the Framework Party" href="http://blog.ericlamb.net/2009/07/coming-late-to-the-framework-party/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F07%2Fcoming-late-to-the-framework-party%2F','Coming+Late+to+the+Framework+Party')" target="_self">lucky to have me</a>. I have finally, <em>finally,</em> begun to see the usefulness and benefits of <a title="Twitter" href="http://twitter.com/" onclick="return TrackClick('http%3A%2F%2Ftwitter.com%2F','Twitter')" target="_blank">Twitter</a>. It&#8217;s weird because I&#8217;ve been working so closely with Twitter for the last year interacting with their <a title="Twitter API" href="http://apiwiki.twitter.com/" onclick="return TrackClick('http%3A%2F%2Fapiwiki.twitter.com%2F','Twitter+API')" target="_blank">API</a> and I never &#8220;got&#8221; it until recently. I&#8217;m actually a little embarrassed about this. So many of my personal friends are on Twitter along with my peers online and I was a little pompous about the whole thing. My Bad.</p>
<p>What ended up turning  my perspective around was the realization that Twitter didn&#8217;t take any real effort. Outside of the marketing and announcement use (blog posts/updates, code release, project release, etc) all other status updates Twitter needs can be completely random thoughts along the lines of  a friendly conversation.</p>
<p>One key difference between Twitter and this blog is that this blog, and the discussion in it, are not in any way <em>personal</em> towards me or anyone else. But with Twitter, well, that can be, and probably should be, personal and a little intimate. Not completely understand, but the conversation appears to need to be a little more random and personal.</p>
<p>When I ask myself why I have this blog (and really why I think anyone has a blog), and if there&#8217;s a requirement of complete honesty, career is definitely at the top of the list. Yes there&#8217;s a love of writing and the conversation. But after that, career and ambition are what really motivates me to write and drives this site. (And yes ego has a little to do with it too but that&#8217;s a whole other discussion <img src='http://blog.ericlamb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p>So, we&#8217;re really talking about a tool of promotion and marketing. I can understand that a little better for some reason.</p>
<p>So yes. I am on <a title="Twitter: Mithra62" href="http://twitter.com/mithra62" onclick="return TrackClick('http%3A%2F%2Ftwitter.com%2Fmithra62','Twitter%3A+Mithra62')" target="_blank">Twitter</a> now and I actually like it. It&#8217;s liberating to be so open (which doesn&#8217;t make much sense to me at all&#8230; but there it is). If you&#8217;re a fan of this blog (hell, even if you hate me and think I&#8217;m an idiot) you might want to follow me <img src='http://blog.ericlamb.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/11/mea-culpa-twitter-mea-culpa/' addthis:title='Mea Culpa Twitter. Mea Culpa&#8230; '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/11/mea-culpa-twitter-mea-culpa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bragging Tweets With TweetMeme</title>
		<link>http://blog.ericlamb.net/2009/06/bragging-tweets-with-tweetmeme/</link>
		<comments>http://blog.ericlamb.net/2009/06/bragging-tweets-with-tweetmeme/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:00:34 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[promotion]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1974</guid>
		<description><![CDATA[Fuck, I hate Twitter; yet another tool to allow people to collect, well&#8230; people really. As an example, I signed up for a Twitter account so I could test Twitter functionality for some projects I&#8217;m working on. I don&#8217;t use Twitter for anything but testing yet I get notices daily about users now following me [...]]]></description>
			<content:encoded><![CDATA[<p>Fuck, I hate Twitter; yet another tool to allow people to collect, well&#8230; people really. As an example, I signed up for a Twitter account so I could test Twitter functionality for some projects I&#8217;m working on. I don&#8217;t use Twitter for anything but testing yet I get notices <em>daily</em> about users now following me (and none of them are readers of this blog).</p>
<div id="attachment_1976" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/06/tweetmeme_logo.jpg" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F06%2Ftweetmeme_logo.jpg','Tweetmeme')"><img class="size-medium wp-image-1976" title="Tweetmeme" src="http://blog.ericlamb.net/wp-content/uploads/2009/06/tweetmeme_logo-300x58.jpg" alt="Tweetmeme" width="300" height="58" /></a><p class="wp-caption-text">Tweetmeme</p></div>
<p>Still, Twitter is all the rage and I do have to admit it is fun working with all the little toys people are making with the Twitter API (playing with the API is really FUN).</p>
<p>One such tool is <a title="TweetMeme" href="http://tweetmeme.com/" onclick="return TrackClick('http%3A%2F%2Ftweetmeme.com%2F','TweetMeme')" target="_blank">TweetMeme</a>.</p>
<p>Accoring to the TweetMeme site:</p>
<blockquote><p>Tweetmeme is a service which aggregates all the popular links on twitter to determine which links are popular. Tweetmeme is able to categorize these links into categories and subcategories, making it easy to filter out the noise to find what your interested in.</p>
<p>We make it easy for you to subscribe to each category and the most popular through aur RSS feeds and Twitter accounts, you can find out more about theses through our <a title="TweetMeme Help" href="http://help.tweetmeme.com/" onclick="return TrackClick('http%3A%2F%2Fhelp.tweetmeme.com%2F','TweetMeme+Help')" target="_blank">help</a>.</p></blockquote>
<p>TweetMeme has a few ways to integrate their data into your site. The easiest way works by giving site owners a little sliver of JavaScript to embed in their site. The JavaScript adds a little button to the page for one click tweeting on Twitter.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;!--</span>mce<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #339933;">--&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;script src=&quot;http://tweetmeme.com/i/scripts/button.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;</pre></div></div>

<p>The above creates a little icon:</p>
<div id="attachment_1985" class="wp-caption aligncenter" style="width: 65px"><img class="size-full wp-image-1985" title="TweetMeme Icon" src="http://blog.ericlamb.net/wp-content/uploads/2009/06/tweetmem_icon.jpg" alt="TweetMeme Icon" width="55" height="70" /><p class="wp-caption-text">TweetMeme Icon</p></div>
<p>In theory, the above is all you&#8217;ll need to do; just drop that slip into a page and you&#8217;re good to go. The reality is that there are a couple rules you need to follow.</p>
<p>First, make sure you&#8217;re using a custom title meta for your pages. If you don&#8217;t all your Tweets will have the same title. Not good.</p>
<p>Second, make sure the page in question is open to the Internet. Don&#8217;t try and lock the page behind a log in barrier or TweetMeme won&#8217;t be able to parse the page to get the URL and title information.</p>
<p>Last, TweetMeme caches the data so don&#8217;t expect the update to be instant; you will be disappointed. For example, on the <a title="Dark Void" href="http://blog.ericlamb.net/2009/06/dark-void-blog/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F06%2Fdark-void-blog%2F','Dark+Void')">Dark Void</a> site we are constantly being hit up by the client about the delay. You probably won&#8217;t see the number in the widget increment for a bit; there&#8217;s nothing you can do about it.</p>
<p>TweetMeme also offers a <a title="TweetMeme Widget" href="http://widget.tweetmeme.com/" onclick="return TrackClick('http%3A%2F%2Fwidget.tweetmeme.com%2F','TweetMeme+Widget')" target="_blank">widget</a>, which I admit I haven&#8217;t used and but it looks like it&#8217;s basically the same thing as <a title="A Look at Tweetizen" href="http://blog.ericlamb.net/2009/04/a-look-at-tweetizen/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F04%2Fa-look-at-tweetizen%2F','A+Look+at+Tweetizen')">Tweetizen</a>.</p>
<p>It should be noted that I wasn&#8217;t able to get the TweetMeme Widget to work. Ever. It just shows a blank page. Good job, TweetMeme.</p>
<p>And of course, there&#8217;s the TweetMeme API. You just have to have an API to be taken seriously. It does seem a little redundant to have an API that&#8217;s populated with data from the Twitter API but, whatever. I haven&#8217;t looked at the API too much either but it doesn&#8217;t look too outside the norm for most APIs.</p>
<p>Anyway, there you go; TweetMeme. Marketers love it. I&#8217;m ambivalent.</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/06/bragging-tweets-with-tweetmeme/' addthis:title='Bragging Tweets With TweetMeme '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/06/bragging-tweets-with-tweetmeme/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Simple Twitter Search with PHP</title>
		<link>http://blog.ericlamb.net/2009/05/simple-twitter-search-with-php/</link>
		<comments>http://blog.ericlamb.net/2009/05/simple-twitter-search-with-php/#comments</comments>
		<pubDate>Thu, 14 May 2009 13:30:48 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[PHPTwitterSearch]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter api]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1642</guid>
		<description><![CDATA[So, I&#8217;ve already gone into detail on the Arc90 Twitter API Service and it&#8217;s pretty fun to work with. One small problem though; it&#8217;s pretty big, complicated and, well, bulky. There&#8217;s a lot you have to do to get something up and running. Enter PHPTwitterSearch; a pretty easy to use, lightweight, Twitter API Search class. [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve already gone into detail on the <a href="http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F04%2Farc90-twitter-api-service-part-1%2F','Arc90+Twitter+API+Service')">Arc90 Twitter API Service</a> and it&#8217;s pretty fun to work with. One small problem though; it&#8217;s pretty big, complicated and, well, bulky. There&#8217;s a lot you have to do to get something up and running.</p>
<div id="attachment_1643" class="wp-caption aligncenter" style="width: 186px"><a href="http://xkcd.com/574/" onclick="return TrackClick('http%3A%2F%2Fxkcd.com%2F574%2F','XKCD')" target="_blank"><img src="http://blog.ericlamb.net/wp-content/uploads/2009/05/swine_flu-176x300.png" alt="XKCD" title="XKCD" width="176" height="300" class="size-medium wp-image-1643" /></a><p class="wp-caption-text">XKCD</p></div>
<p>Enter <a href="http://ryanfaerman.com/twittersearch" onclick="return TrackClick('http%3A%2F%2Fryanfaerman.com%2Ftwittersearch','PHPTwitterSearch')" title="PHPTwitterSearch" target="_blank">PHPTwitterSearch</a>; a pretty easy to use, lightweight, Twitter API Search class. It&#8217;s based on the class originally developed by <a href="http://twitter.slawcup.com/twitter.class.phps" onclick="return TrackClick('http%3A%2F%2Ftwitter.slawcup.com%2Ftwitter.class.phps','David+Billingham')" title="David Billingham" target="_blank">David Billingham</a>, which I admit, I didn&#8217;t check out so I don&#8217;t know how much it&#8217;s based on.</p>
<p>The thing I didn&#8217;t really like about the Arc90 script was how complicated the search process was. In case you didn&#8217;t notice, I didn&#8217;t go into any detail about the search process; for precisely because it was just to complicated. I stopped having fun when working with the search functionality.</p>
<p>Simplicity was what immediately drew me to PHPTwitterSearch. Here&#8217;s a basic example of a search:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'findme'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SWTwitterSearch<span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TwitterSearch<span style="color: #000;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$search</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">results</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Very, very simple. The above searches the API for $query. </p>
<p>Here&#8217;s the best part though; for a little more complication all you have to do is chain the calls together.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SWTwitterSearch<span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$search</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TwitterSearch<span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$search</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'username'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">with</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'hashtag'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">to</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'username2'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">results</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The above searches the API for tweets from &#8220;username&#8221; with the hash string &#8220;#hashtag&#8221; that was sent to the user &#8220;username2&#8243;. </p>
<p>The class returns an array with objects that&#8217;s really basic and simple. </p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/05/simple-twitter-search-with-php/' addthis:title='Simple Twitter Search with PHP '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/05/simple-twitter-search-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arc90 Twitter API Service Part 2</title>
		<link>http://blog.ericlamb.net/2009/05/arc90-twitter-api-service-part-2/</link>
		<comments>http://blog.ericlamb.net/2009/05/arc90-twitter-api-service-part-2/#comments</comments>
		<pubDate>Wed, 06 May 2009 13:59:58 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter api]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1547</guid>
		<description><![CDATA[As promised, here&#8217;s the follow up to Arc90 Twitter API Service Part 1. If you haven&#8217;t read that piece yet you probably should&#8230; Here are the rest of the methods for interacting with Twitter via the Arc90 Twitter API Service. It should be noted that nearly everything in the below is taken from the generously [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, here&#8217;s the follow up to <a href="http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F04%2Farc90-twitter-api-service-part-1%2F','Arc90+Twitter+API+Service+Part+1')" title="Arc90 Twitter API Service Part 1">Arc90 Twitter API Service Part 1</a>. If you haven&#8217;t read that piece yet you probably should&#8230;</p>
<div id="attachment_1527" class="wp-caption aligncenter" style="width: 165px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/04/twitter_logo_header.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F04%2Ftwitter_logo_header.png','Twitter')"><img src="http://blog.ericlamb.net/wp-content/uploads/2009/04/twitter_logo_header.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F04%2Ftwitter_logo_header.png','Twitter')" alt="Twitter" title="Twitter" width="155" height="36" class="size-full wp-image-1527" /></a><p class="wp-caption-text">Twitter</p></div>
<p>Here are the rest of the methods for interacting with Twitter via the <a href="http://lab.arc90.com/2008/06/php_twitter_api_client.php" onclick="return TrackClick('http%3A%2F%2Flab.arc90.com%2F2008%2F06%2Fphp_twitter_api_client.php','Arc90+Twitter+API+Service')" title="Arc90 Twitter API Service" target="_blank">Arc90 Twitter API Service</a>.</p>
<p>It should be noted that nearly everything in the below is taken from the generously documented source code.</p>
<h3>Get Messages</h3>
<p>Returns a list of the 20 most recent direct messages sent to the authenticating user. The XML and JSON versions include detailed information about the sending and recipient users. This method can return XML< JSON, ATOM and RSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
$params['page'] = '0';
$params['since'] = mktime(date(&quot;H&quot;)-4, date(&quot;i&quot;), date(&quot;s&quot;)); //unix timestamp;
$params['since_id'] = '0';
*/</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessages</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Sent Messages</h3>
<p>Returns a list of the 20 most recent direct messages sent by the authenticating user.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
$params['page'] = '0';
$params['since'] = mktime(date(&quot;H&quot;)-4, date(&quot;i&quot;), date(&quot;s&quot;)); //unix timestamp;
$params['since_id'] = '0';
*/</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getSentMessages</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Send Message</h3>
<p>Sends a new direct message to the specified user from the authenticating user. This shows up under their &#8220;Direct Messages&#8221; section.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Hello from my script!'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'USER_TO_SEND_TO'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//can be username or user_id</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sendMessage</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Destroy Message</h3>
<p>Destroys the direct message specified in the required ID parameter. The authenticating user must be the recipient of the specified direct message.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_OF_MESSAGE_TO_DELETE'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">destroyMessage</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Create Friendship</h3>
<p>Befriends the user specified in the ID parameter as the authenticating user. Returns the befriended user in the requested format when successful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_OF_USER_TO_BEFRIEND'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createFriendship</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Destroy Friendship</h3>
<p>Discontinues friendship with the user specified in the ID parameter as the authenticating user.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_OF_USER_TO_DESTROY_FRIEND'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">destroyFriendship</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Check if Friendship Exists</h3>
<p>Tests if a friendship exists between two users.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$user_a</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'USER_1'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user_b</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'USER_2'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">friendshipExists</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$user_a</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_b</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Location</h3>
<p>Updates the location attribute of the authenticating user, as displayed on the side of their profile and returned in various API methods. Please note this is not normalized, geocoded, or translated to latitude/longitude at this time.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Home'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateLocation</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$location</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Delivery Device</h3>
<p>Sets which device Twitter delivers updates to for the authenticating user. $device Must be one of: sms, im, none.</p>
<p>Sending &#8216;none&#8217; as the device parameter will disable IM or SMS updates.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$device</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'sms'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateDeliveryDevice</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$device</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Profile Colors</h3>
<p>Sets one or more hex values that control the color scheme of the authenticating user&#8217;s profile page on twitter.com. These values are also returned in the /users/show API method.</p>
<p>At least one of the $params is required.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'profile_background_color'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#FFFFFF'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'profile_text_color'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#000000'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'profile_link_color'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#CCCCCC'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'profile_sidebar_fill_color'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#999999'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'profile_sidebar_border_color'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#FFFFFF'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateProfileColors</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$params</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Profile Image</h3>
<p>Updates the authenticating user&#8217;s profile image. Image must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/path/to/image/'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Local file path of the image to be uploaded</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateProfileImage</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Profile Background Image</h3>
<p>Updates the authenticating user&#8217;s profile background image. Image must be a valid GIF, JPG, or PNG image of less than 800 kilobytes in size. Images with width larger than 2048 pixels will be scaled down.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/path/to/image/'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Local file path of the image to be uploaded</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateProfileBackgroundImage</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$image</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Profile</h3>
<p>Sets values that users are able to set under the &#8220;Account&#8221; tab of their settings page. Only the parameters specified will be updated; to only update the &#8220;name&#8221; attribute, for example, only include that parameter in your request.</p>
<p>At least one of the $params is required.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Name_TO_Use'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Email_To_Use'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'url'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'URL_TO_Use'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'location'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Location_TO_Use'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'description'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Description_TO_Use'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateProfile</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$params</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Favorites</h3>
<p>Returns the 20 most recent favorite statuses for the authenticating user or user specified by the ID parameter.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//The ID or screen name of the user for whom to request a list of favorite statuses.</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFavorites</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Create Favorite</h3>
<p>Favorites the status specified in the ID parameter as the authenticating user. Returns the favorite status when successful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The ID of the status to favorite</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createFavorite</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Destroy Favorite</h3>
<p>Un-favorites the status specified in the ID parameter as the authenticating user. Returns the un-favorited status in the requested format when successful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The ID of the status to favorite</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">destroyFavorite</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Follow</h3>
<p>Enables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.</p>
<p>NOTE: The Notification Methods require the authenticated user to already be friends with the specified user. Otherwise the error &#8220;there was a problem following the specified user&#8221; will be returned.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The ID or screen name of the user to follow</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">follow</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Leave</h3>
<p>Disables notifications for updates from the specified user to the authenticating user. Returns the specified user when successful.</p>
<p>NOTE: The Notification Methods require the authenticated user to already be friends with the specified user. Otherwise the error &#8220;there was a problem following the specified user&#8221; will be returned.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The ID or screen name of the user to leave</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">leave</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Block</h3>
<p>Blocks the user specified in the ID parameter as the authenticating user. Returns the blocked user in the requested format when successful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The ID or screen name of the user to block</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">block</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Un-Block</h3>
<p>Un-blocks the user specified in the ID parameter as the authenticating user. Returns the un-blocked user in the requested format when successful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//The ID or screen name of the user to block</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">unblock</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Graph Friends</h3>
<p>Returns an array of numeric IDs for every user the specified user is following.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//ID or screen_name of the user to retrieve the friends ID list for</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">graphFriends</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Graph Followers</h3>
<p>Returns an array of numeric IDs for every user the specified user is followed by.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_TO_Use'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//ID or screen_name of the user to retrieve the followers ID list for</span>
&nbsp;
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">graphFollowers</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$format</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/05/arc90-twitter-api-service-part-2/' addthis:title='Arc90 Twitter API Service Part 2 '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/05/arc90-twitter-api-service-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Look at Tweetizen</title>
		<link>http://blog.ericlamb.net/2009/04/a-look-at-tweetizen/</link>
		<comments>http://blog.ericlamb.net/2009/04/a-look-at-tweetizen/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 13:10:55 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tweetizen]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1555</guid>
		<description><![CDATA[For those of you living under a rock for the past couple years Twitter is all the rage; for what I have no idea though. As I&#8217;ve said previously, Twitter&#8217;s pretty stupid, but fuck man, the clients like it so what are you gonna do. As part of my research into all things Twitter I [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you living under a rock for the past couple years <a href="http://www.twitter.com/" onclick="return TrackClick('http%3A%2F%2Fwww.twitter.com%2F','Twitter')" title="Twitter" target="_blank">Twitter</a> is all the rage; for what I have no idea though. As I&#8217;ve said previously, <a href="http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F04%2Farc90-twitter-api-service-part-1%2F','Arc90+Twitter+API+Service+Part+1')" title="Arc90 Twitter API Service Part 1">Twitter&#8217;s pretty stupid</a>, but fuck man, the clients like it so what are you gonna do.</p>
<div id="attachment_1556" class="wp-caption aligncenter" style="width: 291px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/04/tweetizen_logo.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F04%2Ftweetizen_logo.png','Tweetizen')"><img src="http://blog.ericlamb.net/wp-content/uploads/2009/04/tweetizen_logo.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F04%2Ftweetizen_logo.png','Tweetizen')" alt="Tweetizen" title="Tweetizen" width="281" height="73" class="size-full wp-image-1556" /></a><p class="wp-caption-text">Tweetizen</p></div>
<p>As part of my research into all things Twitter I recently took a look at <a href="http://www.tweetizen.com/index.php" onclick="return TrackClick('http%3A%2F%2Fwww.tweetizen.com%2Findex.php','Tweetizen')" title="Tweetizen" target="_blank">Tweetizen</a>. According the Tweetizen website:</p>
<blockquote><p>
Tweetizen is a simple web-based tool designed to help you filter the daily influx of tweets, and easily find the ones that are relevant to you.
</p></blockquote>
<p>It&#8217;s basically a site that uses the Twitter API to aggregate tags and keywords. Tweetizen doesn&#8217;t have an API of it&#8217;s own though I suspect this is would be a simple thing for them to implement; unless they&#8217;re pussies that is. </p>
<p>Are you pussies Tweetizen?</p>
<p>Instead of an API they do offer a cheap JavaScript widget that can be embedded into a website if you&#8217;re into half-assing the concept of &#8220;sharing&#8221;. Just embed the below into the head of your website:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"> &lt;style type=&quot;text/css&quot;&gt;@import &quot;http://embed.tweetizen.com/embed.css&quot;;&lt;/style&gt;</pre></div></div>

<p>And embed the below somewhere in your site:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;twtzn&quot; class=&quot;tweetizen_embed&quot;&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://embed.tweetizen.com/tweetizen.embed.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://embed.tweetizen.com?id=twtzn&amp;g=Breaking+News&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>It looks just like every other widget they offer but you can style it using CSS if you wish. I imagine it would be incredibly tedious to really make the widget stand apart from the pack with just CSS but it&#8217;s all they offer. They do provide a sample CSS file for usage along with instructions on the <a href="http://www.tweetizen.com/faq" onclick="return TrackClick('http%3A%2F%2Fwww.tweetizen.com%2Ffaq','Tweetizen+FAQ')">Tweetizen FAQ</a> page to help the process along.</p>
<p>For me Tweetizen is a lose; but as mentioned above the clients love this shit so I&#8217;m in whether I like it or not.</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/04/a-look-at-tweetizen/' addthis:title='A Look at Tweetizen '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/04/a-look-at-tweetizen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arc90 Twitter API Service Part 1</title>
		<link>http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/</link>
		<comments>http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 13:21:32 +0000</pubDate>
		<dc:creator>Eric Lamb</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter api]]></category>

		<guid isPermaLink="false">http://blog.ericlamb.net/?p=1511</guid>
		<description><![CDATA[Twitter is all the rage these days; everyone&#8217;s on it and everyone seems to love it. Not me, of  course. Like most social networking tools and services I find the whole thing pretty stupid. And, again, I&#8217;m apparently wrong because I&#8217;ve done some digging into manipulating the Twitter API so I can use it on [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Twitter" href="http://twitter.com/" onclick="return TrackClick('http%3A%2F%2Ftwitter.com%2F','Twitter')" target="_blank">Twitter</a> is all the rage these days; everyone&#8217;s on it and everyone seems to love it. Not me, of  course. Like most social networking tools and services I find the whole thing pretty stupid.</p>
<div id="attachment_1527" class="wp-caption aligncenter" style="width: 165px"><a href="http://blog.ericlamb.net/wp-content/uploads/2009/04/twitter_logo_header.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F04%2Ftwitter_logo_header.png','Twitter')"><img class="size-full wp-image-1527" title="Twitter" src="http://blog.ericlamb.net/wp-content/uploads/2009/04/twitter_logo_header.png" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2Fwp-content%2Fuploads%2F2009%2F04%2Ftwitter_logo_header.png','Twitter')" alt="Twitter" width="155" height="36" /></a><p class="wp-caption-text">Twitter</p></div>
<p>And, again, I&#8217;m apparently wrong because I&#8217;ve done some digging into manipulating the <a title="Twitter API" href="http://apiwiki.twitter.com/" onclick="return TrackClick('http%3A%2F%2Fapiwiki.twitter.com%2F','Twitter+API')" target="_blank">Twitter API</a> so I can use it on my client&#8217;s sites.</p>
<p>There are a few <a title="Twitter API Libraries" href="http://apiwiki.twitter.com/Libraries" onclick="return TrackClick('http%3A%2F%2Fapiwiki.twitter.com%2FLibraries','Twitter+API+Libraries')" target="_blank">different libraries</a> available for accessing the API, in all the popular programming languages, but the one I chose was the <a title="PHP Twitter API Client" href="http://lab.arc90.com/2008/06/php_twitter_api_client.php" onclick="return TrackClick('http%3A%2F%2Flab.arc90.com%2F2008%2F06%2Fphp_twitter_api_client.php','PHP+Twitter+API+Client')" target="_blank">PHP Twitter API Client</a>. Unlike all the other php libraries available this one has <em>sick </em><a title="PHP Twitter API Client Documentation" href="http://www.arc90.com/_assets/Arc90_Service_Twitter/docs/" onclick="return TrackClick('http%3A%2F%2Fwww.arc90.com%2F_assets%2FArc90_Service_Twitter%2Fdocs%2F','PHP+Twitter+API+Client+Documentation')" target="_blank">documentation</a>. We&#8217;re talking full phpdocumentor documentation; pure geak porn here.</p>
<p>I wanted to document the client but it&#8217;s a really, REALLY, exhaustive codeset so I&#8217;m going to break it up into 2 different posts. </p>
<h3>The Basics</h3>
<p>The Arc90 API client requires the entire library be in the php include path so you&#8217;ll have to either modify the php.ini directly or use <a title="ini_set" href="http://us3.php.net/manual/en/function.ini-set.php" onclick="return TrackClick('http%3A%2F%2Fus3.php.net%2Fmanual%2Fen%2Ffunction.ini-set.php','ini_set')" target="_blank">ini_set</a> to include the library. Kinda sucks, but whatever.</p>
<p>The client can also return the response in a few different data formats: XML, JSON and sometimes even RSS and ATOM depending on how you call the API and whether that format is available. For the purposes of this article all the examples will be returned in JSON format.</p>
<p>In order for the client to work you  have to have <a title="CURL" href="http://us3.php.net/curl" onclick="return TrackClick('http%3A%2F%2Fus3.php.net%2Fcurl','CURL')" target="_blank">CURL</a> installed and available to php. Most hosts already do but you never know so it&#8217;s best to check with your host if you&#8217;re not sure.</p>
<p>It&#8217;s also important to familiarize yourself with all the ins and outs of the Twitter API. They employ <a title="Rate Limiting" href="http://apiwiki.twitter.com/Rate-limiting" onclick="return TrackClick('http%3A%2F%2Fapiwiki.twitter.com%2FRate-limiting','Rate+Limiting')" target="_blank">rate limiting</a> and have some useful <a title="Getting Started with the Twitter API" href="http://apiwiki.twitter.com/Getting-Started" onclick="return TrackClick('http%3A%2F%2Fapiwiki.twitter.com%2FGetting-Started','Getting+Started+with+the+Twitter+API')" target="_blank">information for developers</a> that&#8217;ll help make the API a little less painful.</p>
<h3>Basic Example</h3>
<p>The client is a full OOP service with exceptions so the basic layout of the algorithm is like the below:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//echo ini_get('include_path');</span>
<span style="color: #22f;">require_once</span> <span style="color: #0000ff;">'Arc90/Service/Twitter.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'YOUR_USERNAME'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'YOUR_PASSWORD'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$twitter</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Arc90_Service_Twitter<span style="color: #000;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
try
<span style="color: #000;">&#123;</span> 
&nbsp;
	<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFriendsTimeline</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// If Twitter returned an error (401, 503, etc), print status code</span>
	<span style="color: #22f;">if</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isError</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span>
	<span style="color: #000;">&#123;</span>
		<span style="color: #22f;">echo</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">http_code</span><span style="color: #339933;">;</span>
	<span style="color: #000;">&#125;</span>
	<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000;">&#125;</span>
catch<span style="color: #000;">&#40;</span>Arc90_Service_Twitter_Exception <span style="color: #000088;">$e</span><span style="color: #000;">&#41;</span>
<span style="color: #000;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Print the exception message (invalid parameter, etc)</span>
	<span style="color: #22f;">print</span> <span style="color: #000088;">$e</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>For all additional examples I&#8217;ll only be displaying exactly what&#8217;s necessary; take that into account.</p>
<h3>End Session</h3>
<p>Ends the session of the authenticating user, returning a null cookie. Use this method to sign users out of client-facing applications like widgets.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">endSession</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Public Timeline</h3>
<p>Returns the 20 most recent statuses from non-protected users who have set a custom user icon. This method can return  JSON, XML, ATOM and RSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPublicTimeline</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Friends Timeline</h3>
<p>Returns the 20 most recent statuses posted by the authenticating user and that user&#8217;s friends. This method can return  JSON, XML, ATOM and RSS.</p>
<p>If the optional $params are passed you can pare down the results.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'since'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mktime</span><span style="color: #000;">&#40;</span><span style="color: #990000;">date</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;H&quot;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//unix timestamp</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'since_id'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'POST_ID_TO_USE_SINCE'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//id of post</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'count'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'10'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//must be &lt; 200</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFriendsTimeline</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span><span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get User Timeline</h3>
<p>Returns the most recent statuses posted from the authenticating user based on the set options. This method can return  JSON, XML, ATOM and RSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'since'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mktime</span><span style="color: #000;">&#40;</span><span style="color: #990000;">date</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;H&quot;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;i&quot;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">date</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #000;">&#41;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//unix timestamp</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_OF_USER_TO_CHECK'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//id of user to look up</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'since_id'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'902529454'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//id of post</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'count'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'10'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//must be &lt; 200</span>
<span style="color: #000088;">$params</span><span style="color: #000;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #000;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getUserTimeline</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span><span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Show Status</h3>
<p>Returns the status for a single user based on the provided id. This method can return XML and JSON.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">showStatus</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'ID_OF_USER_TO_CHECK'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Update Status</h3>
<p>Updates the authenticating user&#8217;s status and returns the posted status in the requested format when successful.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'My Script Sent This Status'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">updateStatus</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$status</span><span style="color: #339933;">,</span> <span style="color: #000088;">$in_reply_to_status_id</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$format</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Replies</h3>
<p>Returns the 20 most recent @replies (status updates prefixed with @username) for the authenticating user. Returns JSON, XML, ATOM and RSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
$params['page'] = '0';
$params['since'] = mktime(date(&quot;H&quot;)-4, date(&quot;i&quot;), date(&quot;s&quot;)); //unix timestamp 4 hours ago;
$params['since_id'] = '0';
*/</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getReplies</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Destroy Status</h3>
<p>Destroys the status specified by the required ID parameter. The authenticating user must be the author of the specified status.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ID_OF_STATUS_TO_DESTROY'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">destroyStatus</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Friends</h3>
<p>Returns the 20 most recent statuses from non-protected users who have set a custom user icon. This method can return ATOM and RSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
$params['id'] = 'ID_OF_USER_TO_GET_FRIENDS_FOR'; 
$params['page'] = '0';
$params['since'] = mktime(date(&quot;H&quot;)-4, date(&quot;i&quot;), date(&quot;s&quot;)); //unix timestamp;
$params['lite'] = TRUE; //removes status
*/</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFriends</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Get Followers</h3>
<p>Returns the authenticating user&#8217;s followers, each with current status inline. They are ordered by the order in which they joined Twitter (this is going to be changed). This method can return ATOM and RSS.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$params</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">/*
$params['id'] = 'ID_OF_USER_TO_GET_FRIENDS_FOR'; 
$params['page'] = '0';
$params['lite'] = TRUE; //removes status
*/</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getFollowers</span><span style="color: #000;">&#40;</span><span style="color: #0000ff;">'json'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$params</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Show User</h3>
<p>According to the source code on this method:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Returns extended information for a given user, specified by ID, screen name, or email.
 *
 * This information includes design settings, so third party developers can theme their widgets
 * according to a given user's preferences.
 * 
 * You must be properly authenticated to request the page of a protected user.
 *
 * The API allows a user to be identified by ID, screen name, or email.
 * Any of these fields may be provided using the $id parameter.
 *
 * A user ID must be passed as an integer.
 * A screen name or an email address must be passed as a string.
 *
 * Show data for a user with an ID of 123: showUser(123)
 * Show data for a user with a screen name of 123: showUser(&quot;123&quot;)
 */</span></pre></td></tr></table></div>

<p>Can return in XML or JSON.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$id</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'SCREEN_NAME_ID_OR_EMAIL_OF_USER_TO_CHECK'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$twitter</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">showUser</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'json'</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Print the XML response</span>
<span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getData</span><span style="color: #000;">&#40;</span><span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">print_r</span><span style="color: #000;">&#40;</span> <span style="color: #990000;">json_decode</span><span style="color: #000;">&#40;</span><span style="color: #000088;">$return</span><span style="color: #000;">&#41;</span> <span style="color: #000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Be sure to check out <a href="http://blog.ericlamb.net/2009/05/arc90-twitter-api-service-part-2/" onclick="return TrackClick('http%3A%2F%2Fblog.ericlamb.net%2F2009%2F05%2Farc90-twitter-api-service-part-2%2F','Arc90+Twitter+API+Service+Part+2')" title="Arc90 Twitter API Service Part 2">Part 2 of the series</a> for details on the remaining methods and functionality.</p>
<div><a class="addthis_button" href="http://blog.ericlamb.net//addthis.com/bookmark.php?v=250" addthis:url='http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/' addthis:title='Arc90 Twitter API Service Part 1 '><img src="//cache.addthis.com/cachefly/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a></div>]]></content:encoded>
			<wfw:commentRss>http://blog.ericlamb.net/2009/04/arc90-twitter-api-service-part-1/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

