🕷 zenspider.com

by ryan davis

Looking for the Ruby Quickref?

STIW4: Confessions of an Info-Junkie

Published 2007-07-18 @ 01:06

Tagged toys

<deep sigh>

Hi, my name is Ryan and… and I am an info-junkie.

Hi Ryan!

I use NetNewsWire (pro) to read my newsfeeds. Too many newsfeeds. I’ve got 178 feeds currently tho that fluctuates. I’ve got them grouped into prioritized groups so I can focus on certain ones more than others, like “ruby” vs “ruby-bored”. I know that’s not good… but… That works pretty well, actually.

Why I’m really here… my real problem… From these feeds, I queue up even more. Like, I read wiki update feeds and queue up whole pages to read for later. Loads of them. 132 of them right now. I’m weak. I know it. I gotta know! But since I can’t group them the way I can the feeds, I’d like SOME way to bring some order out of chaos… ### sort_nnw_tabs.rb

  #!/usr/local/bin/ruby -w
  require 'enumerator'
  Dir.chdir File.expand_path("~/Library/Application Support/NetNewsWire") do
    path = "BrowserTabs.plist"
    raise $? unless system "plutil -convert xml1 #{path}"
    file = File.read(path)
    lines = file.split(/\n/)
    head, meat, tail = lines[0..3], lines[4..-3].enum_slice(6).to_a, lines[-2..-1]
    body = head + meat.sort_by { |subarray| subarray[-2] } + tail
    File.open(path, 'w') do |f|
      f.puts body.join("\n")
    raise $? unless system "plutil -lint #{path}"
    raise $? unless system "plutil -convert binary1 #{path}"

Quit NNW, fire this puppy up, and run NNW and now your 40 tabs of wiki pages are all grouped together…

Hey… where’d everybody go?

Standard Disclaimer Applies I won’t be responsible for your data-loss. Besides, you should already have backups.