<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Infinite Pig Theorem</title>
	
	<link>http://log.damog.net</link>
	<description>A weblog by David Moreno.</description>
	<lastBuildDate>Sun, 28 Jun 2009 02:01:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/TeoremaDelCerdoInfinito" type="application/rss+xml" /><item>
		<title>Perl in the Time of Social Networks delivered in Pittsburgh, PA</title>
		<link>http://log.damog.net/2009/06/perl-in-the-time-of-social-networks-delivered-in-pittsburgh-pa/</link>
		<comments>http://log.damog.net/2009/06/perl-in-the-time-of-social-networks-delivered-in-pittsburgh-pa/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 02:01:36 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[baseball]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[pittsburgh]]></category>
		<category><![CDATA[social networks]]></category>
		<category><![CDATA[yapc]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=900</guid>
		<description><![CDATA[I attended YAPC&#124;10 during this past week. The overall experience was quite particular, with ups and downs, but after all I made it back in one piece.
I rode a Greyhound bus on my crusade of saving a few bucks. I always had issues with buses, when I was a child I used to go from [...]]]></description>
			<content:encoded><![CDATA[<p>I attended <a href="http://yapc10.org">YAPC|10</a> during this past week. The overall experience was quite particular, with ups and downs, but after all I made it back in one piece.</p>
<p>I rode a <a href="http://twitter.com/GreyhoundBus">Greyhound</a> bus on my crusade of saving a few bucks. I always had issues with buses, when I was a child I used to go from <a href="http://en.wikipedia.org/wiki/Celaya">Celaya</a> to Mexico City (and back) almost every weekend for a couple of years and I developed a phobia against the whole bus experience. Even though, getting to Pittsburgh from New York City was cheaper riding a bus than the other alternatives anyway, flying or train. Anyways, it was an awful experience that prevented me from being complete recovered after each travel leg.</p>
<p>Staying at the <a href="http://en.wikipedia.org/wiki/Carnegie_Mellon_University">CMU</a> dorms was also a nice and pleasant experience, feeling for three days like I was a kid on a nice American college. I might want to do that some time in the future pursuing a Master&#039;s degree (some day).</p>
<p>At YAPC, I had the nice chance to get to know a lot of people I&#039;d only known by mailing lists and <a href="http://search.cpan.org/">CPAN</a> modules authors that I use on a daily basis. I also had attended <a href="http://conferences.mongueurs.net/yn2008/">YAPC 08</a> last year in Chicago, so I already knew a small group of mongers.</p>
<p>I delivered my talk about <a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=2&amp;url=http%3A%2F%2Fyapc10.org%2Fyn2009%2Ftalk%2F2019&amp;ei=TNhGSsz2E4uMtgf2nO28Ag&amp;usg=AFQjCNEOfDGg0lJfxNaCoXuwrHtWkMeutA&amp;sig2=3I6CebhFGNvJikg_451vbA">Perl and social networks</a> on Tuesday. I gave it an small twist by moving it into a more motivational, business perspective for hackers, in the last minute. I was overall satisfied with it, and I also think some things were not well done and had to be changed. Fortunately, quite some people came to me and gave good, positive, constructive feedback about it, that I was very thankful to receive, and unfortunately some people also threw destructive criticism that only makes you think how douche-baggy people in the community you can be. In any way, I was happy and satisfied, some observations:</p>
<ul>
<li>I have to take out a lot of personal stuff I poured into it because people don&#039;t care (and it&#039;s not their fault, it&#039;s mine).</li>
<li>Focusing more on actual code. I can try to focus on motivating people to adventure into social networks application development using Perl, but the YAPC audience is more into actual development and coding techniques than money-making ideas.</li>
<li>I still have to practice my speech. I took the time to write my lines scripts for each one of the slides, but that makes the interaction with the people a bit more difficult to establish.</li>
</ul>
<p>And some interesting points around YAPC in general:</p>
<ul>
<li>In the auction, event that is done every year helping <a href="http://www.perlfoundation.org/">TPF</a> raise some funds and that a similar approach would be great to have in conferences like <a href="http://debconf.org">DebConf</a>, the highest bid for a lunch with <a href="http://en.wikipedia.org/wiki/Larry_Wall">Larry Wall</a> reached <strong>one thousand dollars</strong>. I was a bit surprised.</li>
<li>They took us in a tour at <a href="http://en.wikipedia.org/wiki/Heinz_Field">Heinz Field</a>, home of the <a href="http://en.wikipedia.org/wiki/Pittsburgh_Steelers">Pittsburgh Steelers</a>, it was awesome, although it was already a bit late and couldn&#039;t take good pictures of the field. Pictures are on <a href="http://www.flickr.com/photos/raquelydavid/sets/72157620471209726/">this Flickr set</a>.</li>
<li>I had some time at the end of my stay in Pittsburgh so I took the opportunity to go to <a href="http://en.wikipedia.org/wiki/Pnc_park">PNC Park</a> and watch the <a href="http://en.wikipedia.org/wiki/Pittsburgh_Pirates">Pittsburgh Pirates</a> kick one of their greatest rivals (as I learned there, because of the proximity), the <a href="http://en.wikipedia.org/wiki/Cleveland_Indians">Cleveland Indians</a>. Pictures are on <a href="http://www.flickr.com/photos/raquelydavid/sets/72157620543866974/">this set</a>.</li>
<li>Some people outside the venue also joined me on the conference as I setup an improvised ustream transmission. Unfortunately, I never got to press the &#034;Start recording&#034; button, so no video of it. Bummer. However, God willing, I will record my next delivery of the talk on <a href="http://yapceurope2009.org/ye2009/talk/2028">YAPC::EU</a> in Lisbon, in early August.</li>
</ul>
<p>I&#039;ve placed the slides on a PDF <a href="http://github.com/damog/perl-socnet/blob/master/Perl%20in%20the%20Time%20of%20Social%20Networks.pdf">here</a>. You can also clone the <a href="http://github.com/damog/perl-socnet">entire repository</a> containing the source Keynote file.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Kg7AMN65SAcAo2Wl77QE5kIXAXY/0/da"><img src="http://feedads.g.doubleclick.net/~a/Kg7AMN65SAcAo2Wl77QE5kIXAXY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Kg7AMN65SAcAo2Wl77QE5kIXAXY/1/da"><img src="http://feedads.g.doubleclick.net/~a/Kg7AMN65SAcAo2Wl77QE5kIXAXY/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/06/perl-in-the-time-of-social-networks-delivered-in-pittsburgh-pa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sync your Twitter followers and friends</title>
		<link>http://log.damog.net/2009/06/sync-your-twitter-followers-and-friends/</link>
		<comments>http://log.damog.net/2009/06/sync-your-twitter-followers-and-friends/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 18:30:29 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[gems]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=898</guid>
		<description><![CDATA[I have a couple of accounts in Twitter (namely @debian and @planetalinux) that are starting to bring a lot of followers (well, at least some of them). And given that I consider these accounts to be Twitter-polite enough, I like to follow the followers back too; however, this task sometimes gets really hard and it&#039;s [...]]]></description>
			<content:encoded><![CDATA[<p>I have a couple of accounts in Twitter (namely @<a href="http://twitter.com/debian">debian</a> and @<a href="http://twitter.com/planetalinux">planetalinux</a>) that are starting to bring a lot of followers (well, at least some of them). And given that I consider these accounts to be Twitter-polite enough, I like to follow the followers back too; however, this task sometimes gets really hard and it&#039;s tiring to go through the followers pages and follow those that I don&#039;t follow yet over and over.</p>
<p>So, I spent a few minutes and came up with this simple Ruby script that uses <a href="http://addictedtonew.com/">John Nunemaker</a>&#039;s awesome <a href="http://twitter.rubyforge.org">Twitter gem</a>.</p>
<pre class="brush: ruby">
#!/opt/local/bin/ruby

require &quot;rubygems&quot;
require &quot;twitter&quot;

httpauth = Twitter::HTTPAuth.new(
	ARGV[0] || &#039;yehyeh&#039;,
	ARGV[1] || &#039;kissm3&#039;
)

base = Twitter::Base.new(httpauth)

i = 0
(base.follower_ids - base.friend_ids).each do |id|
  i += 1
  begin
    base.friendship_create id
  rescue Twitter::General =&gt; e
    puts &quot;#{e.class}: #{e.message}&quot;
  end
end
puts &quot;#{i} new friendships.&quot;

i = 0
(base.friend_ids - base.follower_ids).each do |id|
  i += 1
  base.friendship_destroy id
end
puts &quot;#{i} destroyed friendships.&quot;

puts &quot;#{base.friend_ids.size} friends now.&quot;
puts &quot;#{base.follower_ids.size} followers now.&quot;
</pre>
<p>What this little code does is exactly that, it will start following the followers you don&#039;t follow yet, and it will stop following the people that don&#039;t follow you back, right? Got it? It&#039;s basically synchronizing your friends with your followers. As said, this is particularly helpful when you are maintaining a community account and want to keep up befriending your kind followers <img src='http://log.damog.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Handling the exception <code>Twitter::General</code> on line 18 is only done because the twitter gem raises it even when you are trying to befriend an account to which you have already requested friendship (like pending requests to protected updates accounts) or those of suspended accounts (spammers).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/tDznTU-5GU9Lek_x_HsfANrMdPA/0/da"><img src="http://feedads.g.doubleclick.net/~a/tDznTU-5GU9Lek_x_HsfANrMdPA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/tDznTU-5GU9Lek_x_HsfANrMdPA/1/da"><img src="http://feedads.g.doubleclick.net/~a/tDznTU-5GU9Lek_x_HsfANrMdPA/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/06/sync-your-twitter-followers-and-friends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cheating the world you tweet less</title>
		<link>http://log.damog.net/2009/06/cheating-the-world-you-tweet-less/</link>
		<comments>http://log.damog.net/2009/06/cheating-the-world-you-tweet-less/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 21:41:56 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[rubx]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=887</guid>
		<description><![CDATA[The number of updates on my Twitter page kind of bothers me sometimes. It&#039;s a reminder of the amount of time I&#039;ve spent and wasted on Twitter, it&#039;s an ever-itching mole in front of my face. However, I can cheat the system and society and still feel good about myself. What if I just remove [...]]]></description>
			<content:encoded><![CDATA[<p>The number of updates on my <a href="http://twitter.com/damog">Twitter page</a> kind of <strong>bothers me</strong> sometimes. It&#039;s a reminder of the amount of time I&#039;ve spent and wasted on Twitter, it&#039;s an ever-itching mole in front of my face. However, I can cheat the system and society and still feel good about myself. What if I just remove all freaking replies I&#039;ve made, <em>except</em> for those of people I do care about (like <a href="http://maggit.net">my fiance</a> or <a href="http://twitter.com/rubx">Ruby Boobie</a>)? And also, I don&#039;t want to remove very recent replies.</p>
<p>Well, let&#039;s just do it already.</p>
<pre class="brush: perl">
#!/opt/local/bin/perl

use Modern::Perl;

use Net::Twitter;
use DateTime::Format::DateParse;
use DateTime;

binmode STDOUT, &quot;:utf8&quot;;

my $t = Net::Twitter-&gt;new(
    user =&gt; shift @ARGV || &#039;lazy_fuck&#039;,
    password =&gt; shift @ARGV || &#039;bl0wm3&#039;);

my $whitelist = [qw/maggit rubx axiombox/];

my $then = DateTime-&gt;now;
$then-&gt;subtract(days =&gt; 5);

my $x = 1;
for my $i (1..80) {

    my $tweets = $t-&gt;user_timeline({ page =&gt; $i, count =&gt; 200 })
        or die &quot;No fish for you, loser.\n&quot;;

    for my $h (@$tweets) {
        next unless $h-&gt;{&quot;in_reply_to_screen_name&quot;};
        next if grep { $_ eq $h-&gt;{&quot;in_reply_to_screen_name&quot;} } @$whitelist;

        my $date = DateTime::Format::DateParse-&gt;parse_datetime($h-&gt;{&quot;created_at&quot;});
        next unless $date &lt; $then;

        say $x, &quot;: (&quot;, $h-&gt;{&quot;id&quot;}, &quot;) &quot;, $h-&gt;{&quot;text&quot;};
        $t-&gt;destroy_status($h-&gt;{&quot;id&quot;});
        $x++;
    }
}
</pre>
<p>This little fucker will try to fetch your latest 16&#039;000 tweets (if you have&#8230; <em>twat</em>, *grin*, more than that, you&#039;ve got real issues and I cannot help there, get a shrink or something).</p>
<p>It&#039;ll make 80 requests for your timeline (remember Twitter gives you a 100-request hour limit), so only if the reply doesn&#039;t come from a certain people AND the reply is older than a given period of time (I&#039;m setting it to one week for me), it&#039;ll get rid of it. If a friend doesn&#039;t see the reply in a week, she probably never will. After that, it just destroys the tweet (or it tries at least, from my experience, Twitter is still experimenting a hell lot of issues on their service).</p>
<p>That way you can cheat the system removing useless tweets that no one (not even you or the recipient) cares about anymore. Or just&#8230; don&#039;t give a shit, and you are all set too.</p>
<p>The first time I ran it, I went from like 6k tweets to 2500, which was a nice drop <img src='http://log.damog.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . If you feel like it, just grab it and customize to fit your needs. You will be needing the <a href="http://search.cpan.org">CPAN</a> modules <a href="http://search.cpan.org/dist/Modern-Perl">Modern::Perl</a>, <a href="http://search.cpan.org/dist/DateTime">DateTime</a>, <a href="http://search.cpan.org/dist/DateTime-Format-DateParse">DateTime::Format::DateParse</a> and of course, <a href="http://search.cpan.org/dist/Net-Twitter">Net::Twitter</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/5Gn1hssLJi0ZxVbchw40MgY4ZAY/0/da"><img src="http://feedads.g.doubleclick.net/~a/5Gn1hssLJi0ZxVbchw40MgY4ZAY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/5Gn1hssLJi0ZxVbchw40MgY4ZAY/1/da"><img src="http://feedads.g.doubleclick.net/~a/5Gn1hssLJi0ZxVbchw40MgY4ZAY/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/06/cheating-the-world-you-tweet-less/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>@debianproject is now @debian!</title>
		<link>http://log.damog.net/2009/06/debianproject-is-now-debian/</link>
		<comments>http://log.damog.net/2009/06/debianproject-is-now-debian/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 16:08:59 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[awesome]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=885</guid>
		<description><![CDATA[Thanks to Jamie, who used to have the name registered and now handed it over, Twitter Debian&#039;s Twitter username is now @debian (go follow Jamie now!). If you were already following @debianproject, nothing will change.
Having @debian on Twitter is actually kind of awesome!
]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://twitter.com/macwarlock">Jamie</a>, who used to have the name registered and now handed it over, <a href="http://twitter.debian.net">Twitter Debian</a>&#039;s <a href="http://twitter.com/">Twitter</a> username is now <strong>@<a href="http://twitter.com/debian">debian</a></strong> (go follow Jamie now!). If you were already following @debianproject, nothing will change.</p>
<p>Having <strong>@<a href="http://twitter.com/debian">debian</a></strong> on Twitter is actually kind of awesome!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/IgYqOduSr4tpXiMFFchnc2SXqxc/0/da"><img src="http://feedads.g.doubleclick.net/~a/IgYqOduSr4tpXiMFFchnc2SXqxc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/IgYqOduSr4tpXiMFFchnc2SXqxc/1/da"><img src="http://feedads.g.doubleclick.net/~a/IgYqOduSr4tpXiMFFchnc2SXqxc/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/06/debianproject-is-now-debian/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debian Maintainers now able to post to Debian Twitter</title>
		<link>http://log.damog.net/2009/05/debian-maintainers-now-able-to-post-to-debian-twitter/</link>
		<comments>http://log.damog.net/2009/05/debian-maintainers-now-able-to-post-to-debian-twitter/#comments</comments>
		<pubDate>Tue, 26 May 2009 20:17:46 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[identi.ca]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=883</guid>
		<description><![CDATA[I&#039;ve added support for Debian Maintainers to post tweets to Debian Twitter (both on Identi.ca and Twitter). Feel free to use it.
]]></description>
			<content:encoded><![CDATA[<p>I&#039;ve added support for <a href="http://wiki.debian.org/Maintainers">Debian Maintainers</a> to post tweets to <a href="http://twitter.debian.net">Debian Twitter</a> (both on <a href="http://identi.ca/debianproject">Identi.ca</a> and <a href="http://twitter.com/debianproject">Twitter</a>). Feel free to use it.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/GBTjvRWdHLXm9IUJUUPSIk1v3fI/0/da"><img src="http://feedads.g.doubleclick.net/~a/GBTjvRWdHLXm9IUJUUPSIk1v3fI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GBTjvRWdHLXm9IUJUUPSIk1v3fI/1/da"><img src="http://feedads.g.doubleclick.net/~a/GBTjvRWdHLXm9IUJUUPSIk1v3fI/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/05/debian-maintainers-now-able-to-post-to-debian-twitter/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Twitter's OAuth + Perl</title>
		<link>http://log.damog.net/2009/05/twitters-oauth-perl/</link>
		<comments>http://log.damog.net/2009/05/twitters-oauth-perl/#comments</comments>
		<pubDate>Thu, 21 May 2009 19:06:42 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[oauth]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=869</guid>
		<description><![CDATA[During the last week, unbeatable Tatsuhiko Miyagawa uploaded Net::Twitter::OAuth to CPAN, which provides an awesome interface for Net::OAuth::Simple and Twitter by subclassing Net::Twitter. This way, it&#039;s very easy to develop Twitter client applications using its new OAuth method dropping the need for users to hand their credentials to third parties.
You will have to register your [...]]]></description>
			<content:encoded><![CDATA[<p>During the last week, unbeatable <a href="http://bulknews.vox.com/">Tatsuhiko Miyagawa</a> uploaded <a href="http://search.cpan.org/dist/Net-Twitter-OAuth/">Net::Twitter::OAuth</a> to <a href="http://search.cpan.org/">CPAN</a>, which provides an awesome interface for <a href="http://search.cpan.org/dist/Net-OAuth-Simple/">Net::OAuth::Simple</a> and <a href="http://twitter.com/">Twitter</a> by subclassing <a href="http://search.cpan.org/dist/Net-Twitter/">Net::Twitter</a>. This way, it&#039;s very easy to develop Twitter client applications using its <em>new</em> <a href="http://apiwiki.twitter.com/OAuth-FAQ">OAuth method</a> dropping the need for users to hand their credentials to third parties.</p>
<p>You will have to register your application on Twitter previously. You can do so <a href="http://twitter.com/oauth_clients">here</a>. If this is a web application that you will be building, you can provide a callback URL which is the page where the user will get redirected once she has granted access to your application. If you just want to test, setting a desktop application is probably the way to go.</p>
<p>Once you have registered your application, you will get two strings, key and secret consumer. Refer to general <a href="http://oauth.net/">OAuth</a> documentation for deeper details.</p>
<p>Install Net::Twitter::OAuth as any other Perl module:</p>
<pre class="brush: shell">
$ sudo cpan Net::Twitter::OAuth
</pre>
<p>Now, using it is very simple:</p>
<pre class="brush: perl">
my $client = Net::Twitter::OAuth-&gt;new(
  consumer_key    =&gt; &quot;YOUR-CONSUMER-KEY&quot;,
  consumer_secret =&gt; &quot;YOUR-CONSUMER-SECRET&quot;,
);
</pre>
<p>No transactions or requests have been made yet. Here you need the user&#039;s access and secret tokens. If you already have them, which means that the user has already gone through the authorization process, you have to pass it now (you already stored them on database, a configuration file or whatever the data model you use):</p>
<pre class="brush: perl">
if ($access_token &amp;&amp; $access_token_secret) {
  $client-&gt;oauth-&gt;access_token($access_token);
  $client-&gt;oauth-&gt;access_token_secret($access_token_secret);
}
</pre>
<p>Now you can query Twitter so it can provide you access:</p>
<pre class="brush: perl">
unless ($client-&gt;oauth-&gt;authorized) {
  # The client is not yet authorized: Do it now
  print &quot;Authorize this app at &quot;, $client-&gt;oauth-&gt;get_authorization_url, &quot; and hit RET\n&quot;;

  &lt;STDIN&gt;; # wait for input

  my($access_token, $access_token_secret) = $client-&gt;oauth-&gt;request_access_token;
  save_tokens($access_token, $access_token_secret); # if necessary
}
</pre>
<p>All these snippets come from the example&#039;s of Net::Twitter::OAuth. So basically, if you are not authorized, which means that either the user hasn&#039;t even been prompted for authorization or denied access before, then you get the authorization URL which you can give to the user to visit.</p>
<p>Once the user has granted access, you can call <tt>request_access_token</tt> which will return the user&#039;s tokens. Here&#039;s where you can save those tokens for future use.</p>
<p>After that block, you are pretty much done and can use the regular Net::Twitter methods:</p>
<pre class="brush: perl">
my $res = $client-&gt;update({ status =&gt; &#039;me ownz oauth!!1&#039; });
</pre>
<p>Soon, a real life application post using <a href="http://search.cpan.org/dist/HTTP-Engine/">HTTP::Engine</a>, <a href="http://search.cpan.org/dist/KiokuDB/">KiokuDB</a> and Net::Twitter::OAuth.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/BFGHOA1VC898DRXU79glcOFBn0A/0/da"><img src="http://feedads.g.doubleclick.net/~a/BFGHOA1VC898DRXU79glcOFBn0A/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/BFGHOA1VC898DRXU79glcOFBn0A/1/da"><img src="http://feedads.g.doubleclick.net/~a/BFGHOA1VC898DRXU79glcOFBn0A/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/05/twitters-oauth-perl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Perl in the Time of Social Networks</title>
		<link>http://log.damog.net/2009/05/perl-in-the-time-of-social-networks/</link>
		<comments>http://log.damog.net/2009/05/perl-in-the-time-of-social-networks/#comments</comments>
		<pubDate>Sat, 09 May 2009 17:43:15 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[social networks]]></category>
		<category><![CDATA[yapc]]></category>
		<category><![CDATA[blogger]]></category>
		<category><![CDATA[catalyst]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[moose]]></category>
		<category><![CDATA[myspace]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[YAPCEU2009]]></category>
		<category><![CDATA[YAPCNA10]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=864</guid>
		<description><![CDATA[This is going to be a fantastic and exciting Perl summer.
During the last week, I received notification that the talk I&#039;ve proposed for both YAPC::NA and YAPC::EU was accepted.
I will be talking about Perl in the Time of Social Networks, which is mainly two broad things: how Perl can actively power a modern social networking [...]]]></description>
			<content:encoded><![CDATA[<p>This is going to be a fantastic and exciting Perl summer.</p>
<p>During the last week, I received notification that the talk I&#039;ve proposed for both <a href="http://yapc10.org/yn2009/">YAPC::NA</a> and <a href="http://yapceurope2009.org/ye2009/">YAPC::EU</a> was accepted.</p>
<p>I will be talking about <strong>Perl in the Time of Social Networks</strong>, which is mainly two broad things: how Perl can actively power a modern social networking site (I&#039;ll be releasing a free -<em>as in speech</em>- social network website, similar to <a href="http://lovdbyless.com/">Lovd</a> or <a href="http://railsspace.com/">RailSpace</a>, built with pure <a href="http://www.catalystframework.org/">Catalyst</a>); and about high-load applications dealing with social networks&#039; APIs and users (a <a href="http://www.iinteractive.com/moose/">Moose</a>-based universal social network distributor), with <a href="http://twitter.com">Twitter</a>, <a href="http://www.facebook.com">Facebook</a>, <a href="http://www.myspace.com/">MySpace</a>, <a href="http://www.blogger.com">Blogger</a>, <a href="http://last.fm">LastFM</a>, and others. My current contractor has been sponsoring the development and research for this since almost two years now, and we believe it&#039;s ready to go public: there&#039;s a lot of work backing us up.</p>
<p>I&#039;ll be presenting <a href="http://yapc10.org/yn2009/talk/2019">the talk</a> in Pittsburgh, PA, on <a href="http://yapc10.org/yn2009/schedule?day=2009-06-23">June 23rd</a> at YAPC|10. If you are around the area, come and attend the talk!</p>
<p>On YAPC::EU::2009, I will be <a href="http://yapceurope2009.org/ye2009/talk/2028">presenting</a> in Lisbon, Portugal, on <a href="http://yapceurope2009.org/ye2009/schedule?day=2009-08-04">August 4th</a>, which is conveniently placed just after <a href="http://debconf9.debconf.org">DebConf 9</a>, which will happen in Cáceres, Spain the week before (I will also be there).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/kz76nC-L274xRJ-gG11yCh-2pMg/0/da"><img src="http://feedads.g.doubleclick.net/~a/kz76nC-L274xRJ-gG11yCh-2pMg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/kz76nC-L274xRJ-gG11yCh-2pMg/1/da"><img src="http://feedads.g.doubleclick.net/~a/kz76nC-L274xRJ-gG11yCh-2pMg/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/05/perl-in-the-time-of-social-networks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>GitHub's Octocat stickers!</title>
		<link>http://log.damog.net/2009/05/githubs-octocat-stickers/</link>
		<comments>http://log.damog.net/2009/05/githubs-octocat-stickers/#comments</comments>
		<pubDate>Wed, 06 May 2009 17:53:56 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[github]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[stickers]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=861</guid>
		<description><![CDATA[They arrived today!

Also, I must say, they flew away immediately with work buddies, so from the 8 stickers the guys kindly sent, I only kept two, but that&#039;s cool. I guess  
Thanks GitHub!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/blog/369-get-your-github-stickers">They</a> arrived today!</p>
<p><a href="http://www.flickr.com/photos/raquelydavid/3508311774/"><img class="aligncenter" src="http://farm4.static.flickr.com/3664/3508311774_23324a98be.jpg" alt="" width="500" height="375" /></a></p>
<p>Also, I must say, they flew away immediately with work buddies, so from the 8 stickers the guys kindly sent, I only kept two, but that&#039;s cool. I guess <img src='http://log.damog.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thanks <a href="http://github.com">GitHub</a>!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/y3_VoxOAo75Eh4mVySvLYxc3lPE/0/da"><img src="http://feedads.g.doubleclick.net/~a/y3_VoxOAo75Eh4mVySvLYxc3lPE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/y3_VoxOAo75Eh4mVySvLYxc3lPE/1/da"><img src="http://feedads.g.doubleclick.net/~a/y3_VoxOAo75Eh4mVySvLYxc3lPE/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/05/githubs-octocat-stickers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debian NYC get-together and PGP key signing</title>
		<link>http://log.damog.net/2009/05/debian-nyc-get-together-and-pgp-key-signing/</link>
		<comments>http://log.damog.net/2009/05/debian-nyc-get-together-and-pgp-key-signing/#comments</comments>
		<pubDate>Wed, 06 May 2009 15:08:07 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[beer]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[planet-debian]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[keysigning]]></category>
		<category><![CDATA[nyc]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=857</guid>
		<description><![CDATA[If you happen to be in the NYC area this Friday May 8th, come over to our get-together to have a few beers/club sodas at Pacific Standard in Park Slope, Brooklyn (at 8 pm, map here). We will also be holding a PGP/GPG key signing par-tay at 9 pm, so make sure you bring your [...]]]></description>
			<content:encoded><![CDATA[<p>If you happen to be in the NYC area this Friday May 8th, come over to our get-together to have a few beers/club sodas at <a href="http://www.pacificstandardbrooklyn.com/">Pacific Standard</a> in Park Slope, Brooklyn (at 8 pm, <a href="http://maps.google.com/maps?oi=map&amp;q=82+Fourth+Avenue,+Brooklyn,+NY">map here</a>). We will also be holding a PGP/GPG key signing par-tay at 9 pm, so make sure you bring your government-issued ID and your printed keys. More information about it, <a href="http://lists.vireo.org/pipermail/debiannyc/2009-May/000277.html">here</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/a6_P63tRpRgZSz94FKlj_gh3rMA/0/da"><img src="http://feedads.g.doubleclick.net/~a/a6_P63tRpRgZSz94FKlj_gh3rMA/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/a6_P63tRpRgZSz94FKlj_gh3rMA/1/da"><img src="http://feedads.g.doubleclick.net/~a/a6_P63tRpRgZSz94FKlj_gh3rMA/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/05/debian-nyc-get-together-and-pgp-key-signing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Twitter alerts and regular expressions</title>
		<link>http://log.damog.net/2009/04/on-twitter-alerts-and-regular-expressions/</link>
		<comments>http://log.damog.net/2009/04/on-twitter-alerts-and-regular-expressions/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 12:17:58 +0000</pubDate>
		<dc:creator>David Moreno</dc:creator>
				<category><![CDATA[nerd]]></category>
		<category><![CDATA[planeta linux]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[alerts]]></category>

		<guid isPermaLink="false">http://log.damog.net/?p=855</guid>
		<description><![CDATA[I don&#039;t know if I&#039;m the only one that does something like this, but I certainly trust I&#039;m not alone.
I love regular expressions (to which some people say there&#039;s nothing regular about) and I just found TweetBeep recently, which is a simple alerts system. There&#039;s nothing really new or innovative about it, given that you [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#039;t know if I&#039;m the only one that does something like this, but I certainly <em>trust</em> I&#039;m not alone.</p>
<p>I love regular expressions (to which some people say there&#039;s nothing <em>regular</em> about) and I just found <a href="http://tweetbeep.com">TweetBeep</a> recently, which is a simple alerts system. There&#039;s nothing really new or innovative about it, given that you can get the results yourself using advanced search on Twitter and consuming the results from a feed. However, I for sure, I don&#039;t want to spend time setting any of that up, and they do that quite easily, which is the whole difference, ease of use. You can get the results on time intervals via mail. Rocks.</p>
<p>So, one of my alerts is about regular expressions: I&#039;m receiving <em>everything</em> Twitter tweets about them, whether <em>regex</em>, <em>regexp</em>, <em>regexes</em>, <em>regexps</em>, etc. are mentioned, I get them. Now, I feel a bit nerdish/dorky about it given that I like to reply on those tweets on totally random people and try help them whenever it&#039;s possible (or just learn a bit more from other regex gurus), but what the hell.</p>
<p>Now, the good thing about this is that being a &#034;good person&#034; and fellow <em>regex</em> buddy with people is starting to pay off. Whether I&#039;m getting new very interesting followers, I also found a nice opportunities niche to take advantage of, and a couple of gigs have come up. I worship building strong relationships with people (as in long-term clients), and when starting to get to know some persons via a common interesting thing such as a regular expressions is just awesome, little piece of awesomeness.</p>
<p>For the geeky part of this post, if my regular expression Twitter alert had to be written as a regex, this would be it:</p>
<blockquote><p><tt>/regex(?:(ps?|es))?/</tt></p></blockquote>
<p>The questions now is, should I start following <tt>/regular\s*expres{1,2}ions?/</tt> too? Maybe I will <img src='http://log.damog.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p><a href="http://feedads.g.doubleclick.net/~a/M8soffjEx1cPPoyztNoK-49IayI/0/da"><img src="http://feedads.g.doubleclick.net/~a/M8soffjEx1cPPoyztNoK-49IayI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/M8soffjEx1cPPoyztNoK-49IayI/1/da"><img src="http://feedads.g.doubleclick.net/~a/M8soffjEx1cPPoyztNoK-49IayI/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://log.damog.net/2009/04/on-twitter-alerts-and-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
