<?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>Christopher S. Penn's Awaken Your Superhero &#187; Languages</title>
	<atom:link href="http://www.christopherspenn.com/tag/languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christopherspenn.com</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 00:22:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>How to auto-follow on Twitter</title>
		<link>http://www.christopherspenn.com/2008/06/13/how-to-auto-follow-on-twitter/</link>
		<comments>http://www.christopherspenn.com/2008/06/13/how-to-auto-follow-on-twitter/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 14:28:47 +0000</pubDate>
		<dc:creator>Christopher S. Penn</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[FriendFeed]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Mozilla Thunderbird]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Question]]></category>
		<category><![CDATA[User]]></category>

		<guid isPermaLink="false">http://www.christopherspenn.com/?p=437</guid>
		<description><![CDATA[Image via Wikipedia Ever since announcing that I&#8217;d basically follow anyone who&#8217;s followed me, I had to come up with a way to make this happen in a timely, efficient process. So here&#8217;s how I do it, if you want to use this bizarre workflow yourself. Aggregate all the &#8220;now following you&#8221; emails from Twitter [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; float: right; display: block;"><a href="http://en.wikipedia.org/wiki/Image:BBEdit.png"><img style="border: medium none; display: block;" src="http://upload.wikimedia.org/wikipedia/en/8/89/BBEdit.png" alt="BBEdit" /></a></p>
<p class="zemanta-img-attribution">Image via <a href="http://en.wikipedia.org/wiki/Image:BBEdit.png" target="_blank">Wikipedia</a></p>
</div>
<p>Ever since announcing that I&#8217;d basically follow anyone who&#8217;s followed me, I had to come up with a way to make this happen in a timely, efficient process. So here&#8217;s how I do it, if you want to use this bizarre workflow yourself.</p>
<ol>
<li>Aggregate all the &#8220;now following you&#8221; emails from <a href="http://twitter.com/cspenn" target='_blank'>Twitter</a> in Mozilla Thunderbird.</li>
<li>In Thunderbird, filter all these to a separate folder.</li>
<li>On disk, open the Twitter folder in BBEdit.</li>
<li>Extract all the lines containing &#8220;is now following&#8221;.</li>
<li>De-dupe, then dump these into a text file.</li>
<li>Strip out the Twitter usernames in parentheses.</li>
<li>Copy and paste that list into a plain text file I call follow.txt.</li>
<li>Run fu.php (a php script) to process those user names.</li>
<li>Done!</li>
</ol>
<p>fu.php is more or less the magic sauce along with BBEdit. I do this once every day or so to sync up new followers, and it works like a charm. fu.php I run in the Mac OS Terminal. This process looks complex, but in reality, it takes all of 2 minutes to do at most.</p>
<p>Here&#8217;s the source code:</p>
<p>&lt;?php<br />
// curl twitter follow script</p>
<p>set_time_limit(3600);</p>
<p>function follow($username)<br />
{<br />
$url = &#8220;http://username:password@twitter.com/friendships/create/$username.json&#8221;;</p>
<p>if (!$curld = curl_init()) {<br />
echo &#8220;Could not initialize cURL session.\n&#8221;;<br />
exit;<br />
}</p>
<p>echo $url;<br />
if (!$curld = curl_init()) {<br />
echo &#8220;Could not initialize cURL session.\n&#8221;;<br />
exit;<br />
}</p>
<p>curl_setopt($curld, CURLOPT_GET, true);<br />
curl_setopt($curld, CURLOPT_URL, $url);<br />
curl_setopt($curld, CURLOPT_HEADER, false);<br />
curl_setopt($curld, CURLOPT_RETURNTRANSFER, true);<br />
$output=curl_exec($curld);</p>
<p>//echo &#8220;Received data: \n\n$output\n\n&#8221;;</p>
<p>$pile=json_decode($output,true);<br />
return $pile;</p>
<p>}</p>
<p>$handle = @fopen(&#8220;follow.txt&#8221;, &#8220;r&#8221;);<br />
if ($handle) {<br />
while (!feof($handle)) {<br />
$users[] = fgets($handle, 4096);<br />
}<br />
fclose($handle);<br />
}</p>
<p>foreach($users as $key=&gt; $value){<br />
$user=ereg_replace(&#8220;\n&#8221;,&#8221;",$value);<br />
$result=follow($user);<br />
print_r($result);<br />
}</p>
<p>?&gt;</p>
<p>Did you enjoy this blog post? If so, please subscribe right now!</p>
<p><a href="http://www.feedburner.com/fb/a/emailverifySubmit?feedId=761786"><img src="http://www.christopherspenn.com/btn-email.png"/></a> <a href="http://www.google.com/ig/add?feedurl=http://feeds.feedburner.com/ChristopherSPenn"><img src="http://www.christopherspenn.com/btn-google.png"/></a> <a href="http://feeds.feedburner.com/ChristopherSPenn"><img src="http://www.christopherspenn.com/btn-rss.png"/></a> </p>
<p>Get this and other great articles from the source at <a href="http://www.ChristopherSPenn.com">www.ChristopherSPenn.com</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/710b0785-d5f7-4e9b-92ae-d9e791f2fa35/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_c.png?x-id=710b0785-d5f7-4e9b-92ae-d9e791f2fa35" alt="Zemanta Pixie" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.christopherspenn.com/2008/06/13/how-to-auto-follow-on-twitter/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>
