<?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>chromakode &#187; reddit</title>
	<atom:link href="http://www.chromakode.com/tag/reddit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chromakode.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 30 Apr 2010 17:50:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My Alien Visitor</title>
		<link>http://www.chromakode.com/2009/02/my-alien-visitor/</link>
		<comments>http://www.chromakode.com/2009/02/my-alien-visitor/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 08:19:58 +0000</pubDate>
		<dc:creator>chromakode</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[alien]]></category>
		<category><![CDATA[bobblehead]]></category>
		<category><![CDATA[evolution]]></category>
		<category><![CDATA[orangered]]></category>
		<category><![CDATA[reddit]]></category>
		<category><![CDATA[socialite]]></category>

		<guid isPermaLink="false">http://www.chromakode.com/?p=757</guid>
		<description><![CDATA[
He claims to be from San Francisco. Affinity for bacon. Arrived with a document depicting various lifeforms from his home planet:

I will post further information as it becomes available.
]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.reddit.com/"><img class="aligncenter size-medium wp-image-769" title="Reddit Bobblehead" src="http://www.chromakode.com/wordpress/wp-content/uploads/2009/02/bobble-550x550.jpg" alt="Reddit Bobblehead" width="550" height="550" /></a></p>
<p>He claims to be from San Francisco. Affinity for bacon. Arrived with a document depicting various lifeforms from his home planet:</p>
<p><img class="aligncenter size-medium wp-image-775" title="Reddit Evolution" src="http://www.chromakode.com/wordpress/wp-content/uploads/2009/02/evolution-550x378.jpg" alt="Reddit Evolution" width="550" height="378" /></p>
<p>I will post further information as it becomes available.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chromakode.com/2009/02/my-alien-visitor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Socialite on AMO</title>
		<link>http://www.chromakode.com/2009/02/socialite-on-amo/</link>
		<comments>http://www.chromakode.com/2009/02/socialite-on-amo/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 06:57:29 +0000</pubDate>
		<dc:creator>chromakode</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[reddit]]></category>
		<category><![CDATA[socialite]]></category>

		<guid isPermaLink="false">http://www.chromakode.com/?p=742</guid>
		<description><![CDATA[As of approximately 7:08 am, Socialite is now publicly available on AMO (addons.mozilla.org).  It&#8217;s been a long time coming, and I&#8217;m excited to see how it&#8217;s received by the new users there.

]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">As of approximately 7:08 am, <a href="http://www.reddit.com/socialite/">Socialite</a> is now publicly <a href="https://addons.mozilla.org/en-US/firefox/addon/7799">available</a> on AMO (<a href="http://addons.mozilla.org">addons.mozilla.org</a>).  It&#8217;s been a long time coming, and I&#8217;m excited to see how it&#8217;s received by the new users there.</p>
<p style="text-align: center;"><a href="https://addons.mozilla.org/en-US/firefox/addon/7799"><img class="aligncenter size-full wp-image-744" title="Socialite in the Firefox add-ons manager" src="http://www.chromakode.com/wordpress/wp-content/uploads/2009/02/getsocialite.png" alt="Socialite in the Firefox add-ons manager" width="528" height="409" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chromakode.com/2009/02/socialite-on-amo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>saidit, a Greasemonkey script for reddit</title>
		<link>http://www.chromakode.com/2009/01/saidit-a-greasemonkey-script-for-reddit/</link>
		<comments>http://www.chromakode.com/2009/01/saidit-a-greasemonkey-script-for-reddit/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 08:06:13 +0000</pubDate>
		<dc:creator>chromakode</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[DOM storage]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[reddit]]></category>
		<category><![CDATA[saidit]]></category>
		<category><![CDATA[userscript]]></category>

		<guid isPermaLink="false">http://www.chromakode.com/?p=641</guid>
		<description><![CDATA[View and install the saidit Greasemonkey script on userscripts.org. Click here »
The saidit script enhances reddit comment pages by highlighting unread comments. It works by keeping track of the comments you&#8217;ve already viewed. Here&#8217;s what it looks like:

Features

Highlights unread reddit comments
Read comments are stored locally
Automatic removal of old data
Efficient implementation

Installation
If you&#8217;d like to give it [...]]]></description>
			<content:encoded><![CDATA[<div class="noticebox info">View and install the <a href="http://userscripts.org/scripts/show/40860">saidit</a> Greasemonkey script on userscripts.org. <a href="http://userscripts.org/scripts/show/40860">Click here »</a></div>
<p>The <a href="http://userscripts.org/scripts/show/40860">saidit</a> script enhances <a href="http://www.reddit.com">reddit</a> comment pages by highlighting unread comments. It works by keeping track of the comments you&#8217;ve already viewed. Here&#8217;s what it looks like:</p>
<p style="text-align: center;"><a href="http://www.reddit.com/r/funny/comments/7emij/original_drawing_of_a_7legged_spider_sells_for/c06gdav"><img class="aligncenter size-full wp-image-645 frame" title="Learning Gaucho theory with saidit" src="http://www.chromakode.com/wordpress/wp-content/uploads/2009/01/saidit.png" alt="saidit" width="500" height="210" /></a></p>
<h3>Features</h3>
<ul>
<li>Highlights unread reddit comments</li>
<li>Read comments are stored locally</li>
<li>Automatic removal of old data</li>
<li>Efficient implementation</li>
</ul>
<h3>Installation</h3>
<p>If you&#8217;d like to give it a spin, make sure you have <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a> installed. Then, just install <a href="http://userscripts.org/scripts/show/40860">saidit</a> from userscripts.org. Have fun!</p>
<p class="note">
<p style="text-align: center;"><span id="more-641"></span></p>
<h3>How it works</h3>
<p>For every comment viewed on reddit, saidit records the comment id in a &#8220;seen comments list&#8221; using <a href="https://developer.mozilla.org/En/DOM/Storage">DOM Storage</a>. When a reddit comments page is loaded, saidit scans through each comment and checks if the id is in the list. If the id is not found, the class &#8220;unread&#8221;, is added to the comment div (this class can then be styled to emphasize unread comments). The seen comments list is then updated to include the new comments.</p>
<p>Since the script scans through hundreds of comments during the time-sensitive page loading process, I needed to make checking comment ids as fast as possible. Experimentation showed that if the seen comment ids were loaded into the fields of an <a href="https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a>, looking up ids was much faster than using an <a href="https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a>. Currently, saidit takes up to 2.5 seconds on the largest comment pages (200+) on my machine. I&#8217;m continuing to look into ways of making it faster.</p>
<h3>Interoperability</h3>
<p>An interesting side-effect of using DOM Storage is that read comment data is accessible to JavaScript on reddit and any other user scripts. If you can think of any clever ways to use this data, feel free to load it using the loading code below, or simply fork saidit to create a new script. Please use your new powers for good, not evil!</p>
<p>Here&#8217;s what the data loading code looks like, using Mozilla&#8217;s non-standard implementation of <a href="https://developer.mozilla.org/En/DOM/Storage">DOM Storage</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span class="kw2">var</span> redditStorage <span class="sy0">=</span> globalStorage.<span class="me1">namedItem</span><span class="br0">&#40;</span><span class="st0">&quot;www.reddit.com&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw2">var</span> pageThingID <span class="sy0">=</span> getThingID<span class="br0">&#40;</span>getPageThing<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw2">var</span> seenArray <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">;</span>
<span class="kw2">var</span> seenObject <span class="sy0">=</span> <span class="br0">&#123;</span><span class="br0">&#125;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">var</span> seenData <span class="sy0">=</span> redditStorage.<span class="me1">getItem</span><span class="br0">&#40;</span><span class="st0">&quot;seen-&quot;</span><span class="sy0">+</span>pageThingID<span class="br0">&#41;</span><span class="sy0">;</span>
seenArray <span class="sy0">=</span> seenData.<span class="me1">value</span>.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&quot;,&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Build an object for faster access</span>
seenArray.<span class="me1">forEach</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span>element<span class="br0">&#41;</span> <span class="br0">&#123;</span>
  seenObject<span class="br0">&#91;</span>element<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>

<p>The &#8220;unread&#8221; class can be styled in subreddit CSS to achieve different effects. Just use a CSS rule similar to the default (perhaps with !important added):</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span class="re1">.comment</span><span class="re1">.unread</span> <span class="re1">.tagline</span> <span class="br0">&#123;</span>
  <span class="kw1">font-weight</span><span class="sy0">:</span> <span class="kw2">bold</span><span class="sy0">;</span>
  <span class="kw1">background-color</span><span class="sy0">:</span> <span class="re0">#fea</span><span class="sy0">;</span>
  <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">inline</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></div></div>

<p>If you discover any interesting ways to use these, please <a href="#respond">leave a comment</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.chromakode.com/2009/01/saidit-a-greasemonkey-script-for-reddit/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
