<?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:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><description /><title>I'm just aperson</title><generator>Tumblr (3.0; @aperson)</generator><link>http://aperson.tumblr.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AdventuresInUsingLinux" /><feedburner:info uri="adventuresinusinglinux" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://tumblr.superfeedr.com/" /><item><title>So I wrote a bot for Reddit...</title><description>&lt;p&gt;My python has been a little rusty, so I decided to fill a small niche that I found on &lt;a href="http://reddit.com" target="_blank"&gt;Reddit&lt;/a&gt;.  It started off from spending way to much time on &lt;a href="http://reddit.com/r/minecraft" target="_blank"&gt;/r/minecraft&lt;/a&gt;, a subreddit I help moderate.  Every time someone from Mojang would make a tweet, someone would post it to the subreddit.  Another user and I had an informal competition of who could post the content of the tweet in the comments first.  This had a few useful purposes for the community and served for a friendly pissing-contest between a few of us.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="http://reddit.com/user/tweet_poster" target="_blank"&gt;tweet_poster&lt;/a&gt;.  It has evolved a bit since the beginning where it would just post the tweet in the comments (well, technically, it never *just* did that, but I digress); it now has a small feature-set that is stretched about as far as I can go for a bot that fits as small of a niche that it does.  From it&amp;#8217;s &lt;a href="http://reddit.com/help/faqs/tweet_poster" target="_blank"&gt;wiki&lt;/a&gt;, it:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;Finds all context for any given tweet, not just the tweet being replied to like twitter shows [ie: conversation threads]. &lt;/li&gt;
&lt;li&gt;Unshortens &lt;em&gt;most&lt;/em&gt; url shorteners [now with more recursion!]. &lt;/li&gt;
&lt;li&gt;Turns @replies into links to the @user&amp;#8217;s profile. &lt;/li&gt;
&lt;li&gt;Turns #tags in to links to a search for that tag. &lt;/li&gt;
&lt;li&gt;For user profile submissions, a comment-ified version will be posted along with the last tweet/conversation by the user. &lt;/li&gt;
&lt;li&gt;Tries to ignore submissions that have the tweet&amp;#8217;s text as the title. &lt;/li&gt;
&lt;li&gt;Includes a big endian formatted timestamp for each tweet. &lt;/li&gt;
&lt;li&gt;Includes a [Translate] button for easily translating tweets. &lt;/li&gt;
&lt;li&gt;Tries to rehost images linked in tweets to imgur.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The first feature is one that has been there from the beginning and its my favorite.  When you view a tweet that is in reply to someone on twitter you only see the tweet that it&amp;#8217;s in reply to.  With t_p, you&amp;#8217;ll see the entire conversation for as long as it went.  The next feature is another favorite and one that took a little work to get right (I am rusty at python, after-all).  I use a web service to unshorten urls, but not just that, it does it recursively (I hate url shorteners being where they&amp;#8217;re not needed!).  The next two features (the linking of @users and #tags) is just replication of what twitter already does and weren&amp;#8217;t really hard to implement.&lt;/p&gt;

&lt;p&gt;Next up on the feature list is a somewhat controversial and misunderstood feature: comment-ified profile pages.  Judging by the votes these comments receive, it&amp;#8217;s not a favorite feature, but appreciated in some submissions.  I think the main problem (and where it&amp;#8217;s misunderstood) is that people still don&amp;#8217;t entirely know how to create a direct link to the tweet they&amp;#8217;re trying to share.  I&amp;#8217;ve gotten a few comments in t_p&amp;#8217;s inbox stating that things were wrong and that it linked the wrong tweet, when in fact, the bot did exactly what it was supposed to.  Oh well, I still get people that confuse its comment footer with a claim that I&amp;#8217;m stating that they&amp;#8217;re a bot (it says: [This comment was posted by a bot][FAQ][Did I get it wrong?]).  You can&amp;#8217;t expect &lt;em&gt;everyone&lt;/em&gt; to be sharp on their toes.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;m trying to figure out better heuristics for my &amp;#8216;is the tweet in the submission title&amp;#8217; detection, but the current version works well enough.  All I do is strip all the non-word characters, make everything lowercase, and do a check if the tweet&amp;#8217;s text is in the title.  Simple, but mostly effective.&lt;/p&gt;

&lt;p&gt;The big endian dates aren&amp;#8217;t anything special, though there is a small story behind the wording of that line in the feature list:  I had originally called it &lt;a href="http://en.wikipedia.org/wiki/ISO_8601" target="_blank"&gt;ISO 8601&lt;/a&gt; formatted (which it *is*), but some user messaged t_p and argued that I was wrong in calling it that.  They wouldn&amp;#8217;t give up, so I told them fine, I&amp;#8217;ll just call it big endian (which is also correct).  I&amp;#8217;m a internet pendant, but there was nothing worth arguing in that one.  The translate button was a small feature that I didn&amp;#8217;t think I&amp;#8217;d be able to add.  I had originally dismissed it as I had read blog posts that the Google translate API was being shutdown (which it is in Dec.).  T_p gets a lot of attention in &lt;a href="/r/starcraft" target="_blank"&gt;/r/starcraft&lt;/a&gt; and in fact they give me the most support there.  Every now and then, they get tweets that are posted in Korean (I wonder why? :) and a translate button was asked for a few times.  Since /r/starcraft has been such a supportive community, I decided to give it a look and found a super simple solution: just throw the tweet&amp;#8217;s text in a big-ass url and send it to Google translate.&lt;/p&gt;

&lt;p&gt;Last on the feature list is the newest and probably the most involved feature.  Twittpic and yfrog were small challenges to build a regex to yank the direct links to pictures.  After I got those, I had to start work on interfacing with &lt;a href="http://imgur.com/" target="_blank"&gt;imgur&lt;/a&gt;&amp;#8217;s API.  There was a small quirk I had to work-around with httplib2, but it works and I don&amp;#8217;t want to deal with it right now.  The real problem I want to solve in that area is finding a way to yank images off of twitter&amp;#8217;s newish picture hosting service.  If anyone knows a way to do that, let me know :).&lt;/p&gt;

&lt;p&gt;There were a few internal, mini-accomplishments that I figured out (a rewrite, adding a database, and learning some small tricks were among them), but those aren&amp;#8217;t entirely worth writing about.  I might try to write about them if I ever get around to rewriting them all.&lt;/p&gt;

&lt;p&gt;Anyways, I just wanted to make a smallish write-up on my reddit bot.  It makes more karma on reddit in a month than I do in a year, and I&amp;#8217;m rather proud of it.&lt;/p&gt;

&lt;p&gt;I&amp;#8217;ll end this post with a picture of bot&amp;#8217;s console just after I learned about terminal color codes (it&amp;#8217;s a little different now):&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lqodokqKkS1qanby1.png" alt="" title="COLOR ALL THE THINGS!"/&gt;&lt;em&gt;color all the things!&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AdventuresInUsingLinux/~4/UxTXqcifFDo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AdventuresInUsingLinux/~3/UxTXqcifFDo/9536934029</link><guid isPermaLink="false">http://aperson.tumblr.com/post/9536934029</guid><pubDate>Mon, 29 Aug 2011 00:59:18 -0500</pubDate><category>reddit</category><category>twitter</category><category>python3</category><feedburner:origLink>http://aperson.tumblr.com/post/9536934029</feedburner:origLink></item><item><title>Maybe I called it too early</title><description>&lt;p&gt;I don&amp;#8217;t know what combination of things got sound working yesterday, but all I know is I currently don&amp;#8217;t have anything coming out of my speakers.  Somewhere between uninstalling alsa, installing pulseaudio, and installing vlc some magic happened and I acquired sound.  I&amp;#8217;ve been pouring through logs but I can&amp;#8217;t reproduce things or get consistent sound.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s hoping I can figure it out before I go insane trying.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AdventuresInUsingLinux/~4/pYXUBDyoDA4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AdventuresInUsingLinux/~3/pYXUBDyoDA4/3045764556</link><guid isPermaLink="false">http://aperson.tumblr.com/post/3045764556</guid><pubDate>Tue, 01 Feb 2011 02:13:15 -0600</pubDate><category>linux</category><feedburner:origLink>http://aperson.tumblr.com/post/3045764556</feedburner:origLink></item><item><title>Sound over HDMI - WORKS!</title><description>&lt;p&gt;I&amp;#8217;ve never been able to get this working before. Lo and behold, all it took was a purge of all of alsa and installing pulseaudio.  I&amp;#8217;m so happy that I can use my mediacenter computer again.  I was going nuts using my borrowed dvd player (let alone dvds).&lt;/p&gt;

&lt;p&gt;Huzzah!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AdventuresInUsingLinux/~4/8GvoEFGdfjo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AdventuresInUsingLinux/~3/8GvoEFGdfjo/3030211542</link><guid isPermaLink="false">http://aperson.tumblr.com/post/3030211542</guid><pubDate>Mon, 31 Jan 2011 07:12:02 -0600</pubDate><feedburner:origLink>http://aperson.tumblr.com/post/3030211542</feedburner:origLink></item><item><title>Adventures in virtual machines!</title><description>&lt;p&gt;While I was working on building a new server setup, I decided to take notes of the installed size of Ubuntu after every major package I installed.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is an x64 system.  The installed size is determined via df -h after I clean the package cache&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command-line install&lt;/strong&gt; (from the &lt;a href="https://help.ubuntu.com/community/Installation/MinimalCD" target="_blank"&gt;minimal install iso&lt;/a&gt;)&lt;em&gt;:&lt;/em&gt;  728M  (hot damn! I thought this was going to be smaller)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;with virtualbox-ose&lt;/strong&gt;:  899M  (not bad, that&amp;#8217;s still under 1GiB)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;apache2, autofs, openssh-server, sshfs&lt;/strong&gt;:  914M  (yes! cli-only and I can get away running this all under a GiB!)&lt;/p&gt;

&lt;p&gt;So I guess the smallest I can get comfortably get away with is a bit under a GiB.  It&amp;#8217;s a shame I use this box to watch movies on, and I need X.  I won&amp;#8217;t bore with any more details, at least until I get the final installed size figured out.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AdventuresInUsingLinux/~4/Z39AR2LFyio" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AdventuresInUsingLinux/~3/Z39AR2LFyio/2940228080</link><guid isPermaLink="false">http://aperson.tumblr.com/post/2940228080</guid><pubDate>Wed, 26 Jan 2011 07:19:00 -0600</pubDate><feedburner:origLink>http://aperson.tumblr.com/post/2940228080</feedburner:origLink></item><item><title>I'm going to try this out again</title><description>&lt;p&gt;I haven&amp;#8217;t tried to do this in a while, so I decided to nuke everything and start anew with tumblr.  Instead of trying to have a theme, I&amp;#8217;m just going to wing it and put whatever I feel like here.  No restrictions for me that way.  That could translate into me actually using this instead of losing motivation.&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s hoping I keep going.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/AdventuresInUsingLinux/~4/LiBFaCY9KEo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AdventuresInUsingLinux/~3/LiBFaCY9KEo/2939509704</link><guid isPermaLink="false">http://aperson.tumblr.com/post/2939509704</guid><pubDate>Wed, 26 Jan 2011 04:58:08 -0600</pubDate><feedburner:origLink>http://aperson.tumblr.com/post/2939509704</feedburner:origLink></item></channel></rss>
