<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>hi, it&#39;s mike</title>
    <link>https://mike.puddingtime.org/tags/netnewswire/</link>
    <description>Recent content on hi, it&#39;s mike</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>mike@puddingtime.org (mike)</managingEditor>
    <webMaster>mike@puddingtime.org (mike)</webMaster>
    <copyright>© 2026, mike</copyright>
    <lastBuildDate>Tue, 17 Feb 2009 23:23:50 +0000</lastBuildDate>
    <atom:link href="https://mike.puddingtime.org/tags/netnewswire/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Updated: Post NetNewsWire Items to Evernote</title>
      <link>https://mike.puddingtime.org/posts/2009-02-17-updated-post-netnewswire-items-to-evernote/</link>
      <pubDate>Tue, 17 Feb 2009 23:23:50 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-02-17-updated-post-netnewswire-items-to-evernote/</guid>
      
      <description>​***Updated:**​ ​Look at the comments. Ed points out that you don’t need FastScripts to add a Ruby script to the script menu. Use the Keyboard Shortcuts pref pane to tie it to a shortcut (which is much better than the old “name the script with underscores and pixie dust to get a shortcut” method.)*​ …</description>
      <content:encoded><![CDATA[<p>​***Updated:**<em>​ ​</em>Look at the comments. Ed points out that you don&rsquo;t need FastScripts to add a Ruby script to the script menu.  Use the Keyboard Shortcuts pref pane to tie it to a shortcut (which is much better than the old &ldquo;name the script with underscores and pixie dust to get a shortcut&rdquo; method.)*​</p>
<p>I started using <a href="http://evernote.com/">Evernote</a> in earnest over the past week. The big motivation to get started came from the benefits of clipping things at home and pulling them down from my iPhone while out of the house, which was something we needed to do a lot over the weekend.</p>
<p>Evernote&rsquo;s first Mac iteration wasn&rsquo;t very grand:  No scripting support, no way to export notes. Those issues have been addressed, so what you&rsquo;re left with is something very much like <a href="http://barebones.com/products/yojimbo/">Yojimbo</a>, only with a really good mobile client, network sync (that doesn&rsquo;t involve MobileMe), multi-platform support and publicly shareable notebooks. (Here&rsquo;s <a href="http://www.download.com/8301-2007_4-9975572-12.html">Evernote in a nutshell</a>.)</p>
<p>The scripting syntax is as clean as anything, so it was pretty simple to adapt my <a href="http://mph.puddingbowl.org/2009/02/save-to-instapaper-from-netnewswire/">NetNewsWire =&gt; InstaPaper</a> script to save stuff from NNW to Evernote.</p>
<p>A quick recommendation on running Ruby appscripts in OS X: Red Sweater Software&rsquo;s <a href="http://www.red-sweater.com/fastscripts/">FastScripts</a>, which provides an enhanced script menu that lets you run scripts written in something besides Applescript, and which allows you to assign keyboard shortcuts to those scripts.  The InstaPaper and Evernote scripts I&rsquo;ve got for NNW are tied to cmd-opt-i and cmd-opt-e respectively.</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;p&gt;</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">\[sourcecode language=&#34;ruby&#34;\]</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">\!/usr/bin/env ruby</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">require &#39;rubygems&#39;</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">require &#39;appscript&#39;</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">require &#39;sanitize&#39;</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">include Appscript</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">nnw = app\(&#34;NetNewsWire&#34;\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">en = app\(&#34;EverNote&#34;\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">item = nnw\.selectedHeadline\.get</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">url = item\.URL\.get</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">title = item\.title\.get</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">description = Sanitize\.clean\(item\.description\.get\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">note = en\.create\_note\(:title =&gt; title, :notebook =&gt; &#34;Inbox&#34;, :with\_text =&gt; description\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">note\.source\_URL\.set\(url\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">\[/sourcecode\]</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;/p&gt;</span></span></code></pre></div>
<p>#evernote #netnewswire</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Updated%3A%20Post%20NetNewsWire%20Items%20to%20Evernote">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>Save to Instapaper from NetNewsWire</title>
      <link>https://mike.puddingtime.org/posts/2009-02-10-save-to-instapaper-from-netnewswire/</link>
      <pubDate>Tue, 10 Feb 2009 06:30:23 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-02-10-save-to-instapaper-from-netnewswire/</guid>
      
      <description>At some point some applescripts I found for posting from NetNewsWire to Instapaper broke. A few days ago, during one of my rare jaunts to the bottom of the Instapaper homepage I came across a reference to the Read Later API. I wrote it down on my todo list as a thing to deal with over lunch some …</description>
      <content:encoded><![CDATA[<p>At some point some applescripts I found for posting from NetNewsWire to <a href="http://instapaper.com">Instapaper</a> broke. A few days ago, during one of my rare jaunts to the bottom of the Instapaper homepage I came across a reference to the <a href="http://blog.instapaper.com/post/73123968/read-later-api">Read Later API</a>. I wrote it down on my todo list as a thing to deal with over lunch some day.</p>
<p>The API involves nothing more than an HTTP request with a half-dozen parameters, a few of which are optional. I stopped shy of simulating the wonderful Instapaper response popup, settling instead on a system beep:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;p&gt;</span></span></code></pre></div>
<p>[sourcecode language=&lsquo;ruby&rsquo;]</p>
<p>!/usr/bin/env ruby</p>
<p>require &lsquo;rubygems&rsquo;</p>
<p>require &lsquo;open-uri&rsquo;</p>
<p>require &lsquo;openssl&rsquo;</p>
<p>require &lsquo;appscript&rsquo;</p>
<p>include Appscript</p>
<p>require &lsquo;osax&rsquo;</p>
<p>include OSAX</p>
<p>username = &ldquo;USERNAME&rdquo;</p>
<p>password = &ldquo;PASSWORD&rdquo;</p>
<p>nnw = app(&ldquo;NetNewsWire&rdquo;)</p>
<p>OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE</p>
<p>item = nnw.selectedHeadline.get</p>
<p>url = URI.encode(item.URL.get).gsub!(/^htt.+?///, &ldquo;&rdquo;)</p>
<p>title = item.title.get</p>
<p>description = item.description.get.gsub!(/&lt;.+?&gt;/, &ldquo;&rdquo;)</p>
<p>selection = description.length &gt; 150 ? description.slice(0,150) + &quot; ...&quot; : description</p>
<p>base_url = &ldquo;https://www.instapaper.com/api/add?&rdquo;</p>
<p>params = &ldquo;title={title}&amp;url={url}&amp;username={username}&amp;password={password}&amp;selection={selection}&rdquo;</p>
<p>post_url = &ldquo;{base_url}{params}&rdquo;</p>
<p>begin</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">response = open\(URI\.encode\(post\_url\)\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">osax\.beep</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">or display a dialog:</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">osax\.display\_dialog\(&#34;Posted\.&#34;\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">rescue =&gt; ex</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">case ex\.message\.gsub\(/\\s\.\*/, &#34;&#34;\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code> ```
</code></pre>
<p>when &ldquo;400&rdquo; : message = &ldquo;Error: Bad Request.&rdquo;</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">     ```
</span></span><span class="line"><span class="cl">when &#34;403&#34; : message = &#34;Bad password/username\.&#34;</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code> ```
</code></pre>
<p>when &ldquo;500&rdquo; : message = &ldquo;Server error.&rdquo;</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<p>end</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<p>osax.display_dialog(message)</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">end
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">\[/sourcecode\]</span></span></code></pre></div>
</p>
```
<p>#appscript #instapaper #netnewswire #ruby</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Save%20to%20Instapaper%20from%20NetNewsWire">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>Wrapping Up NNW Attention Tracking With Ruby</title>
      <link>https://mike.puddingtime.org/posts/2009-01-11-wrapping-up-nnw-attention-tracking-with-ruby/</link>
      <pubDate>Sun, 11 Jan 2009 16:05:09 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-01-11-wrapping-up-nnw-attention-tracking-with-ruby/</guid>
      
      <description>Well, it’s not the prettiest, but I wanted to finish the basics of my NNW feed attention tracking so I could feel free to drop it in a cron job and forget about doing much more with it.
This includes a hash for weighting some feeds that require a look to see what an entry is about vs. being able to …</description>
      <content:encoded><![CDATA[<p>Well, it&rsquo;s not the prettiest, but I wanted to finish the basics of my NNW feed attention tracking so I could feel free to drop it in a cron job and forget about doing much more with it.</p>
<p>This includes a hash for weighting some feeds that require a look to see what an entry is about vs. being able to tell from just the headline.  I used erb to spit out a Web page I can drop onto lighttpd running on my MacBook:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-gdscript3" data-lang="gdscript3"><span class="line"><span class="cl"><span class="o">&lt;</span><span class="n">div</span> <span class="n">style</span><span class="o">=</span><span class="s2">&#34;text\-align:center;&#34;</span><span class="o">&gt;!</span><span class="p">[](</span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">media</span><span class="o">.</span><span class="n">puddingtime</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">archive</span><span class="o">/</span><span class="n">mph</span><span class="o">.</span><span class="n">puddingbowl</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">wordpress</span><span class="o">/</span><span class="n">wp</span><span class="o">-</span><span class="n">content</span><span class="o">/</span><span class="n">uploads</span><span class="o">/</span><span class="mi">2009</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="n">attention</span><span class="o">-</span><span class="n">charts</span><span class="o">.</span><span class="n">png</span><span class="p">)</span><span class="o">&lt;/</span><span class="n">div</span><span class="o">&gt;</span></span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;p&gt;</span></span></code></pre></div>
<p>[sourcecode language=&lsquo;ruby&rsquo;]</p>
<p>!/usr/bin/ruby</p>
<p>require &lsquo;rubygems&rsquo;</p>
<p>require &lsquo;appscript&rsquo;</p>
<p>require &lsquo;google_chart&rsquo;</p>
<p>require &rsquo;erb&rsquo;</p>
<p>include Appscript</p>
<p>nnw = app(&ldquo;NetNewsWire&rdquo;)</p>
<p>Lose NNW synthetic groups, feeds that serve some utility purpose, feeds I don&rsquo;t care to track</p>
<p>unwanted_groups = [&ldquo;Clippings&rdquo;, &ldquo;Mobile&rdquo;, &ldquo;Flagged Items&rdquo;, &ldquo;Latest News&rdquo;, &ldquo;monitors&rdquo;, &ldquo;miscfeeds&rdquo;, &ldquo;mma&rdquo;, &ldquo;people_blogs&rdquo;]</p>
<p>some feeds have opaque headlines that require a look before deciding whether to read</p>
<p>this creates false &ldquo;attention,&rdquo; so these adjustments are subtracted when the chart is generated:</p>
<p>sub_adjustments = {&ldquo;MetaFilter&rdquo; =&gt; 50, &ldquo;Daring Fireball&rdquo; =&gt; 20}</p>
<p>feeds = nnw.subscriptions[its.is_group.eq(false)].get</p>
<p>feeds.sort!{ |a,b| b.calculated_attention_score.get &lt;=&gt; a.calculated_attention_score.get}</p>
<p>groups = nnw.subscriptions[its.is_group.eq(true)].get</p>
<p>groups.reject!{|g| unwanted_groups.include?(g.display_name.get) }</p>
<p>groupnames = []</p>
<p>groups.each {|g| groupnames &laquo; g.display_name.get}</p>
<p>graphs = [groups, feeds]</p>
<p>graph_names = [&ldquo;groups&rdquo;, &ldquo;top feeds&rdquo;]</p>
<p>groupnames.each do |g|</p>
<p>feeds = nnw.subscriptions[its.group.display_name.eq(g)].get</p>
<p>feeds.reject!{|f| f.calculated_attention_score.get &lt; 1 }</p>
<p>graphs &laquo; feeds</p>
<p>graph_names &laquo; g</p>
<p>end</p>
<p>markup = []</p>
<p>graphs.each do |g|</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">graph\_name = graph\_names\.shift</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">pc = GoogleChart::PieChart\.new\(&#39;500x200&#39;, graph\_name, false\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">g\[0\.\.9\]\.each do |s|</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">name = s\.display\_name\.get</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code>  ```
</code></pre>
<p>if sub_adjustments.has_key?(name)</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">  </span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">      ```
</span></span><span class="line"><span class="cl">score = s\.calculated\_attention\_score\.get \- sub\_adjustments\[name\]</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code>```
</code></pre>
<p>else</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">      ```
</span></span><span class="line"><span class="cl">score = s\.calculated\_attention\_score\.get</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code>```
</code></pre>
<p>end</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">    ```
</span></span><span class="line"><span class="cl">@feedname = s\.display\_name\.get\.gsub\(/\(\\&#34;|\\&#39;\)/, &#34;&#34;\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code>```
</code></pre>
<p>pc.data &ldquo;{@feedname} ({score})&rdquo;, score</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">end
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">markup &lt;&lt; %Q@ `![]({pc.to_url})` @
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">end
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">@page = &lt;&lt;END\_OF\_PAGE</span></span></code></pre></div>
<p>&lt;!DOCTYPE html PUBLIC &ldquo;-//W3C//DTD XHTML 1.0 Transitional//EN&rdquo;</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    ```
</span></span><span class="line"><span class="cl">&#34;http://www\.w3\.org/TR/xhtml1/DTD/xhtml1\-transitional\.dtd&#34;&gt;</span></span></code></pre></div>
<p>​<code>&lt;html xmlns=&quot;</code>​​<code>http://www\.w3\.org/1999/xhtml</code>​​<code>&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</code>​</p>
<p><code>&lt;head&gt;</code></p>
<p><code>&lt;meta http\-equiv=&quot;content\-type&quot; content=&quot;text/html; charset=utf\-8&quot; /&gt;</code></p>
<p><code>&lt;title&gt;</code> NetNewsWire Attention Charts <code>&lt;/title&gt;</code></p>
<p><code>&lt;/head&gt;</code></p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;body&gt;</span></span></code></pre></div>
<p>&lt;% markup.each do |m|%&gt;</p>
<p>&lt;%= m %&gt;</p>
<p>&lt;% end %&gt;</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;/body&gt;</span></span></code></pre></div>
<p><code>&lt;/html&gt;</code></p>
<p>END_OF_PAGE</p>
<p>File.open(&quot;/Users/mph/Sites/attention/index.html&quot;, &lsquo;w&rsquo;) {|f| f.write(ERB.new(@page).result) }</p>
<p>[/sourcecode]</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;/p&gt;</span></span></code></pre></div>
<p>#attention #netnewswire #rb-appscript #ruby</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Wrapping%20Up%20NNW%20Attention%20Tracking%20With%20Ruby">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>Graphing NetNewsWire With the Google Chart API</title>
      <link>https://mike.puddingtime.org/posts/2009-01-09-graphing-netnewswire-with-the-google-chart-api/</link>
      <pubDate>Fri, 09 Jan 2009 13:39:37 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-01-09-graphing-netnewswire-with-the-google-chart-api/</guid>
      
      <description>There’s a nice Ruby wrapper for the Google Chart API. Here’s that NetNewsWire group attention chart using it:
&lt;p&gt; [sourcecode language=‘ruby’]
!/usr/bin/ruby
require ‘rubygems’
require ‘appscript’
require ‘google_chart’
include Appscript
nnw = app(“NetNewsWire”)
unwanted_groups = [“Clippings”, …</description>
      <content:encoded><![CDATA[<p>There&rsquo;s a nice <a href="http://code.google.com/p/gchartrb/">Ruby wrapper</a> for the <a href="http://code.google.com/apis/chart/">Google Chart API</a>.  Here&rsquo;s that NetNewsWire group attention chart using it:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;p&gt;</span></span></code></pre></div>
<p>[sourcecode language=&lsquo;ruby&rsquo;]</p>
<p>!/usr/bin/ruby</p>
<p>require &lsquo;rubygems&rsquo;</p>
<p>require &lsquo;appscript&rsquo;</p>
<p>require &lsquo;google_chart&rsquo;</p>
<p>include Appscript</p>
<p>nnw = app(&ldquo;NetNewsWire&rdquo;)</p>
<p>unwanted_groups = [&ldquo;Clippings&rdquo;, &ldquo;Mobile&rdquo;, &ldquo;Flagged Items&rdquo;, &ldquo;Latest News&rdquo;, &ldquo;monitors&rdquo;, &ldquo;miscfeeds&rdquo;]</p>
<p>groups = nnw.subscriptions[its.is_group.eq(true)].get</p>
<p>groups.reject!{|g| unwanted_groups.include?(g.display_name.get) }</p>
<p>pc = GoogleChart::PieChart.new(&lsquo;500x200&rsquo;, &ldquo;Groups&rdquo;, false)</p>
<p>groups.each do |s|</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">pc\.data s\.display\_name\.get, s\.calculated\_attention\_score\.get</span></span></code></pre></div>
<p>end</p>
<p>puts pc.to_url</p>
<p>[/sourcecode]</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;/p&gt;</span></span></code></pre></div>
<p>&ldquo;pc.to_url&rdquo; yields:</p>
<p><code>http://chart\.apis\.google\.com/chart?chtt=Groups&amp;chd=s:9ieaHBA&amp;cht=p&amp;chl=mma|mac|blogs|politics|web|people\_blogs|news&amp;chs=500x200</code></p>
<p>which produces this:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-gdscript3" data-lang="gdscript3"><span class="line"><span class="cl"><span class="o">&lt;</span><span class="n">div</span> <span class="n">style</span><span class="o">=</span><span class="s2">&#34;text\-align:center;&#34;</span><span class="o">&gt;!</span><span class="p">[](</span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">media</span><span class="o">.</span><span class="n">puddingtime</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">archive</span><span class="o">/</span><span class="n">mph</span><span class="o">.</span><span class="n">puddingbowl</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">wordpress</span><span class="o">/</span><span class="n">wp</span><span class="o">-</span><span class="n">content</span><span class="o">/</span><span class="n">uploads</span><span class="o">/</span><span class="mi">2009</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="n">chart</span><span class="o">.</span><span class="n">png</span><span class="p">)</span><span class="o">&lt;/</span><span class="n">div</span><span class="o">&gt;</span></span></span></code></pre></div>
<p>And here it is doing the <a href="http://mph.puddingbowl.org/2009/01/dumping-your-safari-history-with-ruby-apples-curious-epoch/">Safari views-per-day history</a>:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-gdscript3" data-lang="gdscript3"><span class="line"><span class="cl"><span class="o">&lt;</span><span class="n">div</span> <span class="n">style</span><span class="o">=</span><span class="s2">&#34;text\-align:center;&#34;</span><span class="o">&gt;!</span><span class="p">[](</span><span class="n">https</span><span class="p">:</span><span class="o">//</span><span class="n">media</span><span class="o">.</span><span class="n">puddingtime</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">archive</span><span class="o">/</span><span class="n">mph</span><span class="o">.</span><span class="n">puddingbowl</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">wordpress</span><span class="o">/</span><span class="n">wp</span><span class="o">-</span><span class="n">content</span><span class="o">/</span><span class="n">uploads</span><span class="o">/</span><span class="mi">2009</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="n">c02424c4</span><span class="o">-</span><span class="n">a793</span><span class="o">-</span><span class="mi">4630</span><span class="o">-</span><span class="mf">9e58</span><span class="o">-</span><span class="n">b1206af280b5</span><span class="o">.</span><span class="n">jpg</span><span class="p">)</span><span class="o">&lt;/</span><span class="n">div</span><span class="o">&gt;</span></span></span></code></pre></div>
<p>#google charts #netnewswire #ruby</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Graphing%20NetNewsWire%20With%20the%20Google%20Chart%20API">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>More Feed Graphing With NNW and Ruby, The Distant Rumble of ActiveRecord</title>
      <link>https://mike.puddingtime.org/posts/2009-01-09-more-feed-graphing-with-nnw-and-ruby-the-distant/</link>
      <pubDate>Fri, 09 Jan 2009 01:31:45 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-01-09-more-feed-graphing-with-nnw-and-ruby-the-distant/</guid>
      
      <description>I did a little more fiddling with NNW &amp; Ruby this morning. I’m working toward putting together a little attentional dashboard that gives me the attention scores for my most read feeds, then breaks things down into charts for each feed group.
Right now I’ve got eight groups:
mma -- mixed martial arts …</description>
      <content:encoded><![CDATA[<p>I did a little more fiddling with NNW &amp; Ruby this morning. I&rsquo;m working toward putting together a little attentional dashboard that gives me the attention scores for my most read feeds, then breaks things down into charts for each feed group.</p>
<p>Right now I&rsquo;ve got eight groups:</p>
<ul>
<li>mma -- mixed martial arts news</li>
<li>mac -- mac stuff</li>
<li>blogs -- blogs that aren&rsquo;t written by people I know</li>
<li>politics -- blogs that are primarily political</li>
<li>miscfeeds -- a collection of monitors for things like new Netflix releases, client sites I watch, Dreamhost updates, etc.</li>
<li>web -- stuff to do with Web development</li>
<li>news -- institutional news sources (the Oregonian, NYT, etc.)</li>
<li>people_blogs -- blogs that are written by people I know</li>
</ul>
<p>NetNewsWire has three groups it chunks in as well:</p>
<ul>
<li>Latest News: everything that&rsquo;s unread in all feeds</li>
<li>Flagged Items: everything I&rsquo;ve flagged</li>
<li>Clippings: stuff saved from the NNW iPhone client</li>
</ul>
<p>For purposes of NNW&rsquo;s scripting dictionary, anything that&rsquo;s not a feed you pull down from someone&rsquo;s server somewhere is &ldquo;synthetic.&rdquo;  So to break things down into groups and leave out NNW&rsquo;s groups, I just put all the undesired groups and synthetic feeds into an array.</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-gdscript3" data-lang="gdscript3"><span class="line"><span class="cl">\<span class="o">!</span>\<span class="p">[</span><span class="n">nnw</span>\<span class="n">_groups</span>\<span class="n">_attention</span>\<span class="o">.</span><span class="n">png</span>\<span class="p">]</span>\<span class="p">(</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">mph</span>\<span class="o">.</span><span class="n">puddingbowl</span>\<span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">wordpress</span><span class="o">/</span><span class="n">wp</span>\<span class="o">-</span><span class="n">content</span><span class="o">/</span><span class="n">uploads</span><span class="o">/</span><span class="mi">2009</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="n">nnw</span>\<span class="o">-</span><span class="n">groups</span>\<span class="o">-</span><span class="n">attention</span>\<span class="o">.</span><span class="n">png</span>\<span class="p">)</span></span></span></code></pre></div>
<p>This morning&rsquo;s efforts didn&rsquo;t get me very far, but now it&rsquo;s generating two graphs: one for most read feeds and one for my groups.</p>
<p>The people_blogs group you can see in the chart shows a low attention score, which should not be interpreted to mean I don&rsquo;t read blogs by people I know much.  They&rsquo;re actually at the top of my list of things to read each day, but I also tend to keep moribund and likely extinct blogs in that list around indefinitely against the day the author quits dribbling precious creative fluids into Twitter.  Consequently, when I get around to adding a <code>case</code> block to weight all the groups with NNW&rsquo;s <code>scripted attention score</code> , the people_blogs group will get its due.</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;p&gt;</span></span></code></pre></div>
<p>[sourcecode language=&lsquo;ruby&rsquo;]</p>
<p>!/usr/bin/ruby</p>
<p>require &lsquo;rubygems&rsquo;</p>
<p>require &lsquo;appscript&rsquo;</p>
<p>require &lsquo;scruffy&rsquo;</p>
<p>include Appscript</p>
<p>nnw = app(&ldquo;NetNewsWire&rdquo;)</p>
<p>nnw doesn&rsquo;t differentiate between differing kinds of synthetic items</p>
<p>unwanted_groups = [&ldquo;Clippings&rdquo;, &ldquo;Mobile&rdquo;, &ldquo;Flagged Items&rdquo;, &ldquo;Latest News&rdquo;, &ldquo;monitors&rdquo;, &ldquo;miscfeeds&rdquo;]</p>
<p>biglist = nnw.subscriptions.get</p>
<p>feeds = biglist.reject{|s| s.is_group.get != false}  get rid of folders</p>
<p>feeds.sort!{ |a,b| b.calculated_attention_score.get &lt;=&gt; a.calculated_attention_score.get}</p>
<p>groups = biglist.reject{|s| s.is_group.get == false}  get rid of non-folders</p>
<p>groups.reject!{|g| unwanted_groups.include?(g.display_name.get) }</p>
<p>graphs = [groups, feeds[0,9]]</p>
<p>graph_names = [&ldquo;Groups&rdquo;, &ldquo;Feeds&rdquo;]</p>
<p>graphs.each do |g|</p>
<p>scores = {}</p>
<p>graph_name = graph_names.shift</p>
<p>graph = Scruffy::Graph.new</p>
<p>graph.title = &ldquo;NNW Attention Scores by &quot; + graph_name</p>
<p>graph.renderer = Scruffy::Renderers::Pie.new</p>
<p>g.each do |s|</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">unless unwanted\_groups\.include?\(s\.display\_name\.get\)</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code>```
</code></pre>
<p>name = s.display_name.get</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">    ```
</span></span><span class="line"><span class="cl">score = s\.calculated\_attention\_score\.get</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>
<pre><code>```
</code></pre>
<p>title = name + &quot; ({score})&rdquo;  get the attention score into the graph legend</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">    ```
</span></span><span class="line"><span class="cl">scores\[title\] = score</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">end</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">end</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">graph\.add :pie, &#39;&#39;, scores</span></span></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">graph\.render  :to =&gt; &#34;/Users/mph/Desktop/graphs/nnw\_\{graph\_name\.downcase\}\_attention\.png&#34;,:as =&gt; &#39;png&#39;</span></span></code></pre></div>
<p>end</p>
<p>[/sourcecode]</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">&lt;/p&gt;</span></span></code></pre></div>
<p>Deeper History</p>
<p>The other thought that occurred to me is that I&rsquo;m getting close to calling in ActiveRecord and sqlite so I can start tracking history over a longer period of time than the 90 days or so of Web history I&rsquo;ve got Safari retaining. Some experimenting with Safari&rsquo;s history yesterday netted me a chart with overlapping &ldquo;total pages viewed by day&rdquo; lines for the past month and the month previous:</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-gdscript3" data-lang="gdscript3"><span class="line"><span class="cl">\<span class="o">!</span>\<span class="p">[</span><span class="n">safari</span>\<span class="n">_views</span>\<span class="o">.</span><span class="n">png</span>\<span class="p">]</span>\<span class="p">(</span><span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">mph</span>\<span class="o">.</span><span class="n">puddingbowl</span>\<span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">wordpress</span><span class="o">/</span><span class="n">wp</span>\<span class="o">-</span><span class="n">content</span><span class="o">/</span><span class="n">uploads</span><span class="o">/</span><span class="mi">2009</span><span class="o">/</span><span class="mi">01</span><span class="o">/</span><span class="n">safari</span>\<span class="o">-</span><span class="n">views</span>\<span class="o">.</span><span class="n">png</span>\<span class="p">)</span></span></span></code></pre></div>
<p>The numbers aren&rsquo;t very good because I was using Firefox a lot up until starting vacation, when I started using Safari more, mostly because <a href="http://8-p.info/greasekit/">Greasekit</a> and <a href="http://blog.macromates.com/2006/textmate-tricks/">Edit in Textmate</a> cover most of the reason I&rsquo;d bother keeping Firefox around (Greasemonkey and <a href="https://addons.mozilla.org/firefox/addon/4125">It&rsquo;s All Text</a>).</p>
<p>Firefox is making some improvements in AppleScript (hence Ruby via rb-appscript) support, but it&rsquo;s still way off: Its broken AppleScript from FF 2.x was further broken for FF 3.x, it still doesn&rsquo;t support the <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/SysServices/SysServices.html">services menu</a>, and it looks like, to judge the bugs I&rsquo;m following, the services menu support is going to be held up for a while longer.</p>
<p>It&rsquo;d be nice to store everything somewhere I could use a better querying language.</p>
<p>Anyhow ... that&rsquo;s what there&rsquo;s time for today.  Part of my overall &ldquo;get right&rdquo; efforts lately involve a fixed, relatively early bedtime and a fixed, relatively early wakeup time. So my extracurricular scripting is something I do over morning coffee, once I&rsquo;ve got Ben ready for the day and before it&rsquo;s time to announce myself to the job buy signing in on IM.</p>
<p>#attention #netnewswire #ruby</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20More%20Feed%20Graphing%20With%20NNW%20and%20Ruby%2C%20The%20Distant%20Rumble%20of%20ActiveRecord">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
    <item>
      <title>Graphing Your Favorite Feeds with NetNewsWire and Ruby</title>
      <link>https://mike.puddingtime.org/posts/2009-01-07-graphing-your-favorite-feeds-with-netnewswire-and/</link>
      <pubDate>Wed, 07 Jan 2009 06:11:26 +0000</pubDate><author>mike@puddingtime.org (mike)</author>
      <guid>https://mike.puddingtime.org/posts/2009-01-07-graphing-your-favorite-feeds-with-netnewswire-and/</guid>
      
      <description>After the election, my list of feeds in NetNewsWire became the source of some consternation. I&#39;m still not completely recovered from the &#34;must ... know&#34; paranoia that grips me, so I&#39;m loath to unsubscribe to the political stuff: What if the world starts to end? How will I know?
The holidays are …</description>
      <content:encoded><![CDATA[<p>After the election, my list of feeds in <a href="http://www.newsgator.com/Individuals/NetNewsWire/" title="Mac RSS Reader – News Reader for Apple - NetNewsWire by NewsGator">NetNewsWire</a> became the source of some consternation. I'm still not completely recovered from the "must ... know" paranoia that grips me, so I'm loath to unsubscribe to the political stuff: What if the world starts to end?  <i>How will I know?</i></p>
<p>The holidays are over, though, and it's time to quit indulging in a lot of distractions. So how to figure out what I ought to get rid of in my feed reader?  I don't always pay a lot of attention to what I'm reading the most, so I could end up dropping something that's more interesting to me than I realized.  And there's always the chance that there's something I don't really need to be following that I'm reading too much without realizing.</p>
<p>I thought about how much I like <a href="http://www.google.com/reader/">Google Reader's</a> attention tracking, which would help solve this sort of question pretty quickly.  NetNewsWire also tracks attention information, providing a way to sort feeds if you go to <code>View -> Sort Subscriptions By ...</code> and selecting "Attention."</p>
<p>At some point NetNewsWire started including the calculated attention score in its AppleScript dictionary.  The definition for it is:</p>
<blockquote>
<p>&ldquo;The calculated attention score for this subscription, based on clicks and actions (such as posting to weblog, posting to del.icio.us, etc.). For groups it is the average of the subscription inside the group.&rdquo;</p>
</blockquote>
<p>It was pretty easy to get a list of attention scores out of NNW using ruby and rb-appscript:</p>
<p>
<p>[sourcecode language=&lsquo;ruby&rsquo;]</p>
<p>!/usr/bin/ruby</p>
<p>require &lsquo;rubygems&rsquo;</p>
<p>require &lsquo;appscript&rsquo;</p>
<p>include Appscript</p>
<p>nnw = app(&ldquo;NetNewsWire&rdquo;)</p>
<p>subs = nnw.subscriptions.get</p>
<p>subs.reject!{|s| s.is_group.get != false}  get rid of folders</p>
<p>subs.sort!{ |a,b| b.calculated_attention_score.get &lt;=&gt; a.calculated_attention_score.get}</p>
<p>top = subs[0,25] get the top n subscriptions</p>
<p>subs.each do |s|</p>
<p>puts &ldquo;{s.display_name.get} - {s.calculated_attention_score.get}&rdquo;</p>
<p>end</p>
<p>[/sourcecode]</p>
</p>
<p>So there's my list, sorted by how much attention I'm giving each feed.</p>
<p>For the database project I'm working on over in Rails, it would be helpful to do some graphing so I used this little excursion as an excuse to test a few gems for that sort of thing.  Ultimately, I landed on <a href="http://scruffy.rubyforge.org/" title="Scruffy">scruffy</a>, which does all sorts of pretty things, but also just squirts out pie charts like some sort of Swanson's pot-pie factory.</p>
<p>Here's the scruffy-fied version of that script, limiting the results to the top 10 feeds in NNW:</p>
<p>
<pre><code>[sourcecode language='ruby']

!/usr/bin/ruby 

require 'rubygems'

require 'appscript'

require 'scruffy'

include Appscript

 Set up the graph

graph = Scruffy::Graph.new

graph.title = &quot;NNW Attention Scores&quot;

graph.renderer = Scruffy::Renderers::Pie.new

nnw = app(&quot;NetNewsWire&quot;)

subs = nnw.subscriptions.get

subs.reject!{|s| s.is_group.get != false}  get rid of folders

subs.sort!{ |a,b| b.calculated_attention_score.get &lt;=&gt; a.calculated_attention_score.get}

top = subs[0,9] get the top n subscriptions

scores = {}

top.each do |s| 

  name = s.display_name.get

  score = s.calculated_attention_score.get

  title = name + &quot; ({score})&quot;  get the attention score into the graph legend

  scores[title] = score

end

graph.add :pie, '', scores

graph.render  :to =&gt; &quot;nnw_attention.png&quot;,

              :as =&gt; 'png',

			

[/sourcecode]
</code></pre>
</p>
<p>Infolicious!</p>
<p>For the record, I think I'm going to mix deletions up with changing the update intervals. I can't believe the time I've wasted on MacWorld, and I think I can get more fiber from Talking Points Memo than I can Andrew Sullivan.  I'm torn about MacUpdate.  I rationalize keeping it around so I can stay current on security and bug fixes, but I have very few apps that don't utilize <a href="http://sparkle.andymatuschak.org/" title="Sparkle: a free software update framework for the Mac">Sparkle</a> or their own update framework, which means MacUpdate is more of a distracting parade of new crap I can futz with.</p>
<p>#attention #netnewswire #ruby</p>
<p><em><a href="mailto:mike@puddingtime.org?subject=Re%3A%20Graphing%20Your%20Favorite%20Feeds%20with%20NetNewsWire%20and%20Ruby">Drop a line about this</a>.</em></p>]]></content:encoded>
    </item>
  </channel>
</rss>
