<?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>CodeWord: Apokalyptik &#187; Ruby (on or off) Rails</title>
	<atom:link href="http://blog.apokalyptik.com/category/ruby-on-or-off-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.apokalyptik.com</link>
	<description>The random things that spew forth from my brain...</description>
	<lastBuildDate>Mon, 15 Mar 2010 17:42:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Time based bloom filters</title>
		<link>http://blog.apokalyptik.com/2010/01/06/time-based-bloom-filters/</link>
		<comments>http://blog.apokalyptik.com/2010/01/06/time-based-bloom-filters/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 04:29:56 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[SRSLY]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=498</guid>
		<description><![CDATA[I find this concept fascinating and plan to investigate further down this road.
]]></description>
			<content:encoded><![CDATA[<p>I find <a href="http://www.igvita.com/2010/01/06/flow-analysis-time-based-bloom-filters/">this concep</a>t fascinating and plan to investigate further down this road.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2010/01/06/time-based-bloom-filters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Howto: Enable regular expression highlighting in LimeChat</title>
		<link>http://blog.apokalyptik.com/2009/10/06/howto-enable-regular-expression-highlighting-in-limechat/</link>
		<comments>http://blog.apokalyptik.com/2009/10/06/howto-enable-regular-expression-highlighting-in-limechat/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 18:25:03 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/?p=464</guid>
		<description><![CDATA[in LimeChat.app/Contents/Resources/logrenderer.rb around line 419&#8230; WFM. IANAL. YMMV. RTFM. OMGWTF. WTL. GTFO. ETC.

    words.each do &#124;w&#124;
      next if w.empty?
      s = body
      offset = 0
# &#60;edit was=&#34;rex = Regexp.new(Regexp.escape(w), true)&#34;&#62;
      rex = [...]]]></description>
			<content:encoded><![CDATA[<p>in LimeChat.app/Contents/Resources/logrenderer.rb around line 419&#8230; WFM. IANAL. YMMV. RTFM. OMGWTF. WTL. GTFO. ETC.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">    words.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>w<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#9966CC; font-weight:bold;">next</span> <span style="color:#9966CC; font-weight:bold;">if</span> w.<span style="color:#9900CC;">empty</span>?
      s = body
      offset = <span style="color:#006666;">0</span>
<span style="color:#008000; font-style:italic;"># &lt;edit was=&quot;rex = Regexp.new(Regexp.escape(w), true)&quot;&gt;</span>
      rex = <span style="color:#CC00FF; font-weight:bold;">Regexp</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>w, <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#008000; font-style:italic;"># &lt;/edit&gt;</span>
      <span style="color:#9966CC; font-weight:bold;">while</span> rex =~ s
<span style="color:#008000; font-style:italic;"># &lt;edit&gt;</span>
        <span style="color:#9966CC; font-weight:bold;">begin</span>
<span style="color:#008000; font-style:italic;"># &lt;/edit&gt;</span>
          left = $~.<span style="color:#9966CC; font-weight:bold;">begin</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          right = $~.<span style="color:#9966CC; font-weight:bold;">end</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          pre = $~.<span style="color:#9900CC;">pre_match</span>
          post = $~.<span style="color:#9900CC;">post_match</span>
          ok = <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
          <span style="color:#9966CC; font-weight:bold;">if</span> exact_word_match
            <span style="color:#9966CC; font-weight:bold;">if</span> !pre.<span style="color:#9900CC;">empty</span>? <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> alphabetic?<span style="color:#006600; font-weight:bold;">&#40;</span>w.<span style="color:#9900CC;">first_char</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> alphabetic?<span style="color:#006600; font-weight:bold;">&#40;</span>pre.<span style="color:#9900CC;">last_char</span><span style="color:#006600; font-weight:bold;">&#41;</span>
              ok = <span style="color:#0000FF; font-weight:bold;">false</span>
            <span style="color:#9966CC; font-weight:bold;">elsif</span> !post.<span style="color:#9900CC;">empty</span>? <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> alphabetic?<span style="color:#006600; font-weight:bold;">&#40;</span>w.<span style="color:#9900CC;">last_char</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> alphabetic?<span style="color:#006600; font-weight:bold;">&#40;</span>post.<span style="color:#9900CC;">first_char</span><span style="color:#006600; font-weight:bold;">&#41;</span>
              ok = <span style="color:#0000FF; font-weight:bold;">false</span>
            <span style="color:#9966CC; font-weight:bold;">end</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
          <span style="color:#9966CC; font-weight:bold;">if</span> ok
            keywords <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:pos</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> offset<span style="color:#006600; font-weight:bold;">+</span>left, <span style="color:#ff3333; font-weight:bold;">:len</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> right<span style="color:#006600; font-weight:bold;">-</span>left <span style="color:#006600; font-weight:bold;">&#125;</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
          s = post
          offset <span style="color:#006600; font-weight:bold;">+</span>= right
<span style="color:#008000; font-style:italic;"># &lt;edit&gt;</span>
        <span style="color:#9966CC; font-weight:bold;">rescue</span>
          <span style="color:#9966CC; font-weight:bold;">next</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#008000; font-style:italic;"># &lt;/edit&gt;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2009/10/06/howto-enable-regular-expression-highlighting-in-limechat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s good for the server.  It&#8217;s good for the soul.</title>
		<link>http://blog.apokalyptik.com/2007/12/12/its-good-for-the-server-its-good-for-the-soul/</link>
		<comments>http://blog.apokalyptik.com/2007/12/12/its-good-for-the-server-its-good-for-the-soul/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 21:53:49 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/12/12/its-good-for-the-server-its-good-for-the-soul/</guid>
		<description><![CDATA[ack (http://petdance.com/ack/), love it (thanks nikolay)
]]></description>
			<content:encoded><![CDATA[<p><a href="http://petdance.com/ack/" target="_blank">ack (http://petdance.com/ack/)</a>, love it (thanks nikolay)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/12/12/its-good-for-the-server-its-good-for-the-soul/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autumn Leaves Leaf #3: Commander</title>
		<link>http://blog.apokalyptik.com/2007/10/03/autumn-leaves-leaf-3-commander/</link>
		<comments>http://blog.apokalyptik.com/2007/10/03/autumn-leaves-leaf-3-commander/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 02:41:31 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/10/03/autumn-leaves-leaf-3-commander/</guid>
		<description><![CDATA[This leaf is capable of running a script on the local server in response to the !deploy channel command.  For security you have to authenticate first.  To do so you send it a message with a password. it then it http authenticates against a specific url with your nickname and the mesage text [...]]]></description>
			<content:encoded><![CDATA[<p>This leaf is capable of running a script on the local server in response to the !deploy channel command.  For security you have to authenticate first.  To do so you send it a message with a password. it then it http authenticates against a specific url with your nickname and the mesage text as the password.  If the file fetched matches predesignated contents then you are added to the internal ACL.  Anyone in the ACL can run the !deploy command.  If you leave the chan, join the chan, change nicks, or quit irc you will be removed from the ACL and have to re-authenticate.  This could be adapted to any system command for any purpose. I ended up not needing this leaf; I still wanted to put it out there since its functional and useful.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/http'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'net/https'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Commander <span style="color:#006600; font-weight:bold;">&lt;</span> AutumnLeaf
&nbsp;
  before_filter <span style="color:#ff3333; font-weight:bold;">:authenticate</span>, <span style="color:#ff3333; font-weight:bold;">:only</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#ff3333; font-weight:bold;">:reload</span>, <span style="color:#ff3333; font-weight:bold;">:sync</span>, <span style="color:#ff3333; font-weight:bold;">:quit</span>, <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#006600; font-weight:bold;">&#93;</span>
  <span style="color:#ff6633; font-weight:bold;">$authenticated</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> authenticate_filter<span style="color:#006600; font-weight:bold;">&#40;</span>sender, channel, command, msg, options<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#ff6633; font-weight:bold;">$authenticated</span>.<span style="color:#9966CC; font-weight:bold;">include</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>sender<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#0000FF; font-weight:bold;">false</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> did_receive_private_message<span style="color:#006600; font-weight:bold;">&#40;</span>sender, msg<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#008000; font-style:italic;"># assumes there is a file at </span>
    <span style="color:#008000; font-style:italic;"># http://my.svnserver.com/svn/access </span>
    <span style="color:#008000; font-style:italic;"># whose contents are &quot;granted&quot; </span>
    <span style="color:#6666ff; font-weight:bold;">Net::HTTP</span>.<span style="color:#9900CC;">start</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'my.svnserver.com'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>http<span style="color:#006600; font-weight:bold;">|</span>
      req = <span style="color:#6666ff; font-weight:bold;">Net::HTTP::Get</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'/svn/access'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;
      req.<span style="color:#9900CC;">basic_auth</span><span style="color:#006600; font-weight:bold;">&#40;</span>sender, msg<span style="color:#006600; font-weight:bold;">&#41;</span>
      response = http.<span style="color:#9900CC;">request</span><span style="color:#006600; font-weight:bold;">&#40;</span>req<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#ff6633; font-weight:bold;">$authenticated</span> <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&lt;</span> sender <span style="color:#9966CC; font-weight:bold;">if</span> response.<span style="color:#9900CC;">body</span> == <span style="color:#996600;">&quot;granted&quot;</span>
    <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> someone_did_quit<span style="color:#006600; font-weight:bold;">&#40;</span>sender, msg<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#ff6633; font-weight:bold;">$authenticated</span>.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>sender<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> someone_did_leave_channel<span style="color:#006600; font-weight:bold;">&#40;</span>sender, channel<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#ff6633; font-weight:bold;">$authenticated</span>.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>sender<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> someone_did_join_channel<span style="color:#006600; font-weight:bold;">&#40;</span>sender, channel<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#ff6633; font-weight:bold;">$authenticated</span>.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>sender<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> deploy_command<span style="color:#006600; font-weight:bold;">&#40;</span>sender, channel, text<span style="color:#006600; font-weight:bold;">&#41;</span>
    message <span style="color:#996600;">&quot;deploying...&quot;</span>
    <span style="color:#CC0066; font-weight:bold;">system</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;sudo /usr/local/bin/deploy.sh 1&gt;/dev/null 2&gt;/dev/null&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/10/03/autumn-leaves-leaf-3-commander/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autumn Leaves Leaf #2: Feeder</title>
		<link>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-2-feeder/</link>
		<comments>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-2-feeder/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 20:52:15 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-2-feeder/</guid>
		<description><![CDATA[This handy little bot keeps track of RSS feeds, and announces in the channel when one is updated. (note: be sure to edit the path to the datafiles) Each poller runs inside its own ruby thread, and can be run on its own independent schedule

require 'thread'
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
require 'fileutils'
require 'digest/md5'
&#160;
class Feeder &#38;lt; AutumnLeaf
&#160;
def watch_feed&#40;url, [...]]]></description>
			<content:encoded><![CDATA[<p>This handy little bot keeps track of RSS feeds, and announces in the channel when one is updated. (note: be sure to edit the path to the datafiles) Each poller runs inside its own ruby thread, and can be run on its own independent schedule</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'thread'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rss/1.0'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rss/2.0'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'open-uri'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'fileutils'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'digest/md5'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Feeder <span style="color:#006600; font-weight:bold;">&amp;</span>lt; AutumnLeaf
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> watch_feed<span style="color:#006600; font-weight:bold;">&#40;</span>url, title, sleepfor=<span style="color:#006666;">300</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  message <span style="color:#996600;">&quot;Watching (#{title}) [#{url}] every #{sleepfor} seconds&quot;</span>
  feedid = <span style="color:#6666ff; font-weight:bold;">Digest::MD5</span>.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span>title<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC00FF; font-weight:bold;">Thread</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
    <span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#0000FF; font-weight:bold;">true</span>
      <span style="color:#9966CC; font-weight:bold;">begin</span>
        content = <span style="color:#996600;">&quot;&quot;</span>
        <span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>url<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>s<span style="color:#006600; font-weight:bold;">|</span>
          content = s.<span style="color:#9900CC;">read</span>
        <span style="color:#006600; font-weight:bold;">&#125;</span>
        rss = <span style="color:#6666ff; font-weight:bold;">RSS::Parser</span>.<span style="color:#9900CC;">parse</span><span style="color:#006600; font-weight:bold;">&#40;</span>content, <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        rss.<span style="color:#9900CC;">items</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>entry<span style="color:#006600; font-weight:bold;">|</span>
          digest = <span style="color:#6666ff; font-weight:bold;">Digest::MD5</span>.<span style="color:#9900CC;">hexdigest</span><span style="color:#006600; font-weight:bold;">&#40;</span>entry.<span style="color:#9900CC;">title</span><span style="color:#006600; font-weight:bold;">&#41;</span>
          <span style="color:#9966CC; font-weight:bold;">if</span> !<span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exist</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/tmp/.rss.#{feedid}.#{digest}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
            <span style="color:#CC00FF; font-weight:bold;">FileUtils</span>.<span style="color:#9900CC;">touch</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/tmp/.rss.#{feedid}.#{digest}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
            message <span style="color:#996600;">&quot;#{entry.title} (#{title}) #{entry.link}&quot;</span>
          <span style="color:#9966CC; font-weight:bold;">end</span>
          <span style="color:#CC0066; font-weight:bold;">sleep</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#006600; font-weight:bold;">&#125;</span>
      <span style="color:#9966CC; font-weight:bold;">rescue</span>
        <span style="color:#CC0066; font-weight:bold;">sleep</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">2</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
      <span style="color:#CC0066; font-weight:bold;">sleep</span><span style="color:#006600; font-weight:bold;">&#40;</span>sleepfor<span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#CC0066; font-weight:bold;">sleep</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> did_start_up
  watch_feed<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://planet.wordpress.org/rss20.xml&quot;</span>, <span style="color:#996600;">&quot;planet&quot;</span>, <span style="color:#006666;">600</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  watch_feed<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;http://wordpress.com/feed/&quot;</span>, <span style="color:#996600;">&quot;wpcom&quot;</span>, <span style="color:#006666;">300</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-2-feeder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autumn Leaves Leaf #1: Announcer</title>
		<link>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-1-announcer/</link>
		<comments>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-1-announcer/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 20:48:25 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-1-announcer/</guid>
		<description><![CDATA[This bot is perfect for anything where you need to easily build IRC channel notifications into an existing process. It&#8217;s simple, clean, and agnostic. Quite simply you connect to a TCP port, give it one line, the port closes, the line given shows up in the channel.  eg: echo &#8216;hello&#8217; &#124; nc -q 1 [...]]]></description>
			<content:encoded><![CDATA[<p>This bot is perfect for anything where you need to easily build IRC channel notifications into an existing process. It&#8217;s simple, clean, and agnostic. Quite simply you connect to a TCP port, give it one line, the port closes, the line given shows up in the channel.  eg: <strong>echo &#8216;hello&#8217; | nc -q 1 bothost 22122</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'socket'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'thread'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> Announcer <span style="color:#006600; font-weight:bold;">&amp;</span>lt; AutumnLeaf
&nbsp;
        <span style="color:#9966CC; font-weight:bold;">def</span> handle_incoming<span style="color:#006600; font-weight:bold;">&#40;</span>sock<span style="color:#006600; font-weight:bold;">&#41;</span>
                <span style="color:#CC00FF; font-weight:bold;">Thread</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
                line = sock.<span style="color:#CC0066; font-weight:bold;">gets</span>
                message line
                sock.<span style="color:#9900CC;">close</span>
                <span style="color:#006600; font-weight:bold;">&#125;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
        <span style="color:#9966CC; font-weight:bold;">def</span> did_start_up
                <span style="color:#CC00FF; font-weight:bold;">Thread</span>.<span style="color:#9900CC;">new</span> <span style="color:#006600; font-weight:bold;">&#123;</span>
                        listener = TCPServer.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">''</span>,<span style="color:#006666;">22122</span><span style="color:#006600; font-weight:bold;">&#41;</span>
                        <span style="color:#9966CC; font-weight:bold;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span>new_socket = listener.<span style="color:#9900CC;">accept</span><span style="color:#006600; font-weight:bold;">&#41;</span>
                                handle_incoming<span style="color:#006600; font-weight:bold;">&#40;</span>new_socket<span style="color:#006600; font-weight:bold;">&#41;</span>
                        <span style="color:#9966CC; font-weight:bold;">end</span>
                <span style="color:#006600; font-weight:bold;">&#125;</span>
        <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-leaf-1-announcer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Autumn Leaves (a ruby framework for IRC bots)</title>
		<link>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-a-ruby-framework-for-irc-bots/</link>
		<comments>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-a-ruby-framework-for-irc-bots/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 20:44:19 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/10/02/autumn-leaves-a-ruby-framework-for-irc-bots/</guid>
		<description><![CDATA[What an awesome awesome thing for people who use IRC in their day to day lives!  I&#8217;ll post a couple of utility leaves here real quick.
Link: http://www.shutupgeorge.com/al-docs/
]]></description>
			<content:encoded><![CDATA[<p>What an awesome awesome thing for people who use IRC in their day to day lives!  I&#8217;ll post a couple of utility leaves here real quick.</p>
<p>Link: <a href="http://www.shutupgeorge.com/al-docs/" target="_blank">http://www.shutupgeorge.com/al-docs/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/10/02/autumn-leaves-a-ruby-framework-for-irc-bots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby-Mapquest Release v0.003</title>
		<link>http://blog.apokalyptik.com/2007/02/17/ruby-mapquest-release-v0003/</link>
		<comments>http://blog.apokalyptik.com/2007/02/17/ruby-mapquest-release-v0003/#comments</comments>
		<pubDate>Sat, 17 Feb 2007 22:59:50 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Geospacial]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/02/17/ruby-mapquest-release-v0003/</guid>
		<description><![CDATA[Primarily a bugfix release.  Catch it here:
]]></description>
			<content:encoded><![CDATA[<p>Primarily a bugfix release.  Catch it <a href="http://blog.apokalyptik.com/ruby-mapquest/">here</a>:</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/02/17/ruby-mapquest-release-v0003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby-Mapquest Release v0.002</title>
		<link>http://blog.apokalyptik.com/2007/02/13/ruby-mapquest-release-v0002/</link>
		<comments>http://blog.apokalyptik.com/2007/02/13/ruby-mapquest-release-v0002/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 04:57:33 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Geospacial]]></category>
		<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/02/13/ruby-mapquest-release-v0002/</guid>
		<description><![CDATA[Welcome: ruby-Mapquest v0.002.  Wherein I&#8217;ve added support for routing (directions.)  Let me tell you that getting the info together for this was *NOT* a pretty picture&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Welcome: <a href="http://blog.apokalyptik.com/ruby-mapquest/">ruby-Mapquest</a> v0.002.  Wherein I&#8217;ve added support for routing (directions.)  Let me tell you that getting the info together for this was *NOT* a pretty picture&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/02/13/ruby-mapquest-release-v0002/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hpricot &lt;text&gt;sometext&lt;/text&gt; workaround</title>
		<link>http://blog.apokalyptik.com/2007/02/13/hpricot-sometext-workaround/</link>
		<comments>http://blog.apokalyptik.com/2007/02/13/hpricot-sometext-workaround/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 18:38:39 +0000</pubDate>
		<dc:creator>apokalyptik</dc:creator>
				<category><![CDATA[Ruby (on or off) Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Stuff]]></category>

		<guid isPermaLink="false">http://blog.apokalyptik.com/2007/02/13/hpricot-sometext-workaround/</guid>
		<description><![CDATA[As noted by the open trouble ticket here, The most awesome Hpricot seems to have come down with a bug, in that it&#8217;s not able to access &#8220;sometext&#8221; inside this: &#8220;&#60;text&#62;sometext&#60;/text&#62;&#8221;  It parses it ok (puts.doc.inspect definately shows the proper {elem}) you just cant get to it.  So heres my ugly little hack/workaround [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.whytheluckystiff.net/hpricot/ticket/55?replyto=description#comment" target="_blank">As noted by the open trouble ticket here</a>, The most awesome <a href="http://code.whytheluckystiff.net/hpricot">Hpricot</a> seems to have come down with a bug, in that it&#8217;s not able to access &#8220;sometext&#8221; inside this: &#8220;&lt;text&gt;sometext&lt;/text&gt;&#8221;  It parses it ok (puts.doc.inspect definately shows the proper {elem}) you just cant get to it.  So heres my ugly little hack/workaround for this issue until it&#8217;s resolved.  (I&#8217;m posting it here, since I cant seem to signup to make a comment on the bug report on the <a href="http://code.whytheluckystiff.net/hpricot">Hpricot home page</a>&#8230; and someone might find this useful)  This hack is specifically for web documents, however would also work for strings or files with only minor tweaks.</p>
<blockquote><p>    ## Begin hack<br />
doc = &#8220;&#8221;<br />
open(url) do |f|<br />
doc=doc + f.read<br />
end<br />
doc = doc.gsub(/&lt;text&gt;/, &#8220;&lt;mtext&gt;&#8221;)<br />
doc = doc.gsub(/&lt;\/text&gt;/, &#8220;&lt;/mtext&gt;&#8221;)<br />
doc = Hpricot(doc)<br />
## Should be one line<br />
## doc = Hpricot(open(url))<br />
## End hack</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.apokalyptik.com/2007/02/13/hpricot-sometext-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
