<?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>timwhitlock.info &#187; api</title>
	<atom:link href="http://timwhitlock.info/blog/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://timwhitlock.info</link>
	<description>Tim Whitlock&#039;s personal site and blog</description>
	<lastBuildDate>Thu, 15 Dec 2011 13:51:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>DIY Qwitter app</title>
		<link>http://timwhitlock.info/blog/2009/06/06/diy-qwitter-app/</link>
		<comments>http://timwhitlock.info/blog/2009/06/06/diy-qwitter-app/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 20:36:33 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/06/06/diy-qwitter-app/</guid>
		<description><![CDATA[If you know about the Qwitter service, then you may also know what people say about it &#8211; that it plain doesn&#8217;t work. So for my first Twitter app, I decided to make one that does. I have been made aware since then that there is also Twitdiff, although I haven&#8217;t tried it at time [...]]]></description>
			<content:encoded><![CDATA[<p>If you know about the <a href="http://useqwitter.com/" target="_blank">Qwitter</a> service, then you may also know what people say about it &#8211; that it plain doesn&#8217;t work. So for my first Twitter app, I decided to make one that does.</p>
<p>I have been made aware since then that there is also <a href="http://twitdiff.appspot.com/" target="_blank">Twitdiff</a>, although I haven&#8217;t tried it at time of writing.</p>
<p>If you don&#8217;t know about Qwitter, it&#8217;s a service that monitors your Twitter followers and emails you if someone <em>unfollows</em> you. My app currently tweets the notification instead, so everyone will know you&#8217;ve been qwit.</p>
<p>I&#8217;m not offering my app as a public service [yet] I knocked it up in 2 hours and if you know what you&#8217;re doing with a LAMP set-up you can download it and run it yourself.</p>
<p><strong>» <a href="http://web.2point1.com/wp-content/uploads/2009/06/qwitter-0-1-2.tgz">Download qwitter 0.1.2</a></strong><br />
Requires PHP &gt;= 5.2.x  + json extension, MySQL &gt;= 5.0.45</p>
<h3><span id="more-121"></span>INSTALL</h3>
<p>Ensure you have a PHP binary at /usr/bin/php and check the version is suitable</p>
<pre class="code"><strong>$ which php</strong>
<font color="#999999">/usr/bin/php</font>
<strong>$ /usr/bin/php --version</strong>
<font color="#999999">PHP 5.2.x (cli) (built: ..........)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies</font></pre>
<p>Unzip the download, and ensure it&#8217;s executable:</p>
<pre class="code"><strong>$ tar -xvzf qwitter-0-1.tar.gz</strong><strong>
$ cd qwitter-0-1
$ chmod u+x qwitter</strong></pre>
<p>Configure it for your Twitter account with these two constants:</p>
<pre class="code">define( 'TWITTER_USER', '' );
define( 'TWITTER_PASSWORD', '' );</pre>
<p>Configure it for your MySQL server. These constants are the default:</p>
<pre class="code">define('PLUG_DB_NAME', 'qwitter');
define('PLUG_DB_USER', 'qwitter');
define('PLUG_DB_PASS', '');
define('PLUG_DB_HOST', 'localhost');
define('PLUG_DB_PORT', '3306');</pre>
<p>Create the database table.</p>
<pre class="code">CREATE TABLE `qwitter_followers` (
`id` varchar(11) collate utf8_unicode_ci NOT NULL,
`modified` timestamp NULL default NULL,
`created` timestamp NOT NULL default '0000-00-00 00:00:00',
`unfollowed` timestamp NULL default NULL,
PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;</pre>
<p>Note that you can configure the table name prefix, so you can run multiple qwitters on the same data source. See <code>QWITTER_TABLE_PREFIX</code> constant</p>
<h3>USAGE</h3>
<p>You should test it works by simply running it, but the only way the app can do its job for real is to be run frequently &#8211; the more frequent the better. To set up a cron job and run the app every 5 minutes, create a crontab entry like this:</p>
<p><code>*/5   *   *   *   *   /path/to/qwitter &gt;/dev/null 2&gt;&amp;1</code></p>
<p>If you don&#8217;t know how to set up a cronjob, you&#8217;d better Google it.</p>
<p>Note that if someone follows and unfollows you within this time window, you won&#8217;t be informed. The app needs to see the follower at least once before it will notice that you&#8217;ve been since unfollowed.</p>
<h3>CHANGELOG</h3>
<p><strong>1.0.1</strong><br />
Added <code>QWITTER_TABLE_PREFIX</code> config<br />
Fixed loophole where blocked users were considered qwitters<br />
<strong>1.0.2</strong><br />
Added <code>QWITTER_NOTIFY</code> to support emailing of notification</p>
<h3>TODO</h3>
<ol>
<li><strike>Check missing followers against your block list. Currently blocking a user raises a notification.</strike> todone</li>
<li>Implement OAuth, so this can be offered as a service</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://timwhitlock.info/blog/2009/06/06/diy-qwitter-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bit.ly API command line tool</title>
		<link>http://timwhitlock.info/blog/2009/06/06/bitly-api-command-line-interface/</link>
		<comments>http://timwhitlock.info/blog/2009/06/06/bitly-api-command-line-interface/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 13:54:18 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bitly]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[url shortnener]]></category>

		<guid isPermaLink="false">http://web.2point1.com/2009/06/06/bitly-api-command-line-interface/</guid>
		<description><![CDATA[I&#8217;ve knocked up a really simple command line tool for interacting with the bit.ly API. It&#8217;s simple because: The output is currently pretty raw The bit.ly API doesn&#8217;t actually do very much » Download version 0.1.1 Requires PHP &#62;= 5.2.x + json extension INSTALL Ensure you have a PHP binary at /usr/bin/php and check the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve knocked up a really simple command line tool for interacting with the <a href="http://bit.ly">bit.ly</a> API.</p>
<p>It&#8217;s simple because:</p>
<ol>
<li>The output is currently pretty raw</li>
<li>The bit.ly API doesn&#8217;t actually do very much</li>
</ol>
<p><strong>» <a href="http://web.2point1.com/wp-content/uploads/2009/06/bitly-0-1-1.tgz" title="Bitly 0.1.1">Download version 0.1.1</a></strong></p>
<p>Requires PHP &gt;= 5.2.x + json extension</p>
<h3><span id="more-118"></span>INSTALL</h3>
<p>Ensure you have a PHP binary at /usr/bin/php and check the version is suitable</p>
<pre class="code"><strong>$ which php</strong>
<font color="#999999">/usr/bin/php</font>
<strong>$ /usr/bin/php --version</strong>
<font color="#999999">PHP 5.2.x (cli) (built: ..........)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies</font></pre>
<p>Unzip the download, and ensure it&#8217;s executable:</p>
<pre class="code"><strong>$ tar -xvzf bitly-0-1-1.tar.gz</strong><strong>
</strong><font color="#999999">bitly-0-1-1/
bitly-0-1-1/bitly
bitly-0-1-1/README</font>
<strong>$ cd bitly-0-1-1
$ chmod u+x bitly</strong></pre>
<p>Configure it for your bit.ly account, by redefining two constants at the top of the file. They look like this:</p>
<pre class="code">define( 'BITLY_USER', '' );
define( 'BITLY_PASSWORD', '' );</pre>
<p>Optionally move the executable somewhere useful:</p>
<pre class="code"><strong>$ mkdir -p ~/bin
$ mv -v bitly ~/bin</strong>
<font color="#999999">bitly -&gt;/home/xxxx/bin/bitly</font></pre>
<h3>USAGE</h3>
<p>Run the help command to see available commands</p>
<pre class="code"><strong>$ bitly -h</strong></pre>
<p>Example, to shorten a URL:</p>
<pre class="code"><strong>$ bitly shorten http://web.2point1.com</strong></pre>
<h3>CHANGELOG</h3>
<p><strong>Version 0.1</strong><br />
First release</p>
<p><strong>Version 0.1.1</strong><br />
Added &#8211;version switch<br />
Added history=1 into shorten method (ensures it actually goes into your bit.ly history)<br />
Added optional keyword for custom URLs to shorten method</p>
<h3>See also</h3>
<p><a href="http://code.google.com/p/bitly-api/wiki/ApiDocumentation">bit.ly API documentation</a></p>
]]></content:encoded>
			<wfw:commentRss>http://timwhitlock.info/blog/2009/06/06/bitly-api-command-line-interface/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

