1. Not Advocatist, but …

    I have this idea I’d like to work on some time:

    MacRumors has this nifty buyer’s guide that tells you when it’s a good idea to be thinking about an upgrade because a given product family is due. If you take a look at the top, there’s some tidy, consistent markup:

    There’s a table (class = buyerstable) and number of data cells with lists (class "buyerslist"), each of which contain list items (with classes of red, green and yellow) wrapping the name of each product family.

    So … Nokogiri:

    !/usr/bin/env ruby 
    
    require "rubygems"
    require "nokogiri"
    require "open-uri"
    
    interesting_products = ["iPad", "iPhone", "iPad Mini", "MacBook Air"]
    
    url = "http://buyersguide.macrumors.com"
    
    doc = Nokogiri::HTML(open(url))
    
    doc.search('ul.buyerslist').each do |bl|
      bl.search('li.green').each do |product|
        if interesting_products.include?(product.text)
          puts product.text unless product.text.include?("Gazelle")
        end
      end
    end
    

    So, it seems to me there’s a programmatic way to tell if interesting things might be about to happen in Apple’s product lines. Do I care because I’m interested in knowing the best time to upgrade my Apple products?

    No!

    I care because most Apple writers become insufferable when there aren’t new products for them to fawn over. They delve into bitter, weird little obsessions, spend their time gloating over nits they have successfully picked, and do weird shit like call out Paul Thurott (whom I have met and is a nice guy who gave me a funny Microsoft mug when I was a Linux columnist) and Rob Enderle (who is an absurd thinker whose main contribution to the world of consulting is the productization of trolling). In other words, Mac writers, given no new stuff to talk about, become as bad as the things they hate, just like Nietzsche says people will.

    So it occurs to me that if you’ve got a programmatic way to see if product changes are coming, you’ve got a programmatic way to see if the Mac people have anything worth reading. So if you’ve got an RSS reader that can programmatically turn subscriptions on or off, you’ve got a programmatic way to ignore people who become annoying on reasonably predictable cycles. Alternately, maybe something like grapi would do the trick by talking to Google Reader directly (meaning your changes show up on all your devices).

    More Precise Annoyance Removal

    But what about feeds that are good most of the time, but have annoyances embedded in them? Kind of a nice NetNewsWire feature is the ability to make any script that returns a valid feed into a subscription. I used the example code from the Ruby 1.9.3 RSS library to make a simple script that reads in a feed, skips the stuff that matches a pattern, and then adds the remainder back to a feed:

    !/usr/bin/env ruby
    require 'rubygems'
    require 'rss'
    require 'open-uri'
    require 'sanitize'
    
    url = 'http://rss.macworld.com/macworld/feeds/main'
    scrub_pattern = /(the\ week\ in|macalope)/i
    title = "Scrubbed MacWorld"
    author = "Mike's RSS Scrubber"
    
    scrubbed_items = []
    open(url) do |rss|
      feed = RSS::Parser.parse(rss)
      feed.items.each do |item|
        title = item.title
        unless item.title.match(scrub_pattern)
          scrubbed_items << item
        end
      end
    end
    
    rss = RSS::Maker.make("atom") do |maker|
      maker.channel.author = author
      maker.channel.updated = Time.now.to_s
      maker.channel.about = "http://www.ruby-lang.org/en/feeds/news.rss"
      maker.channel.title = title
    
      scrubbed_items.each do |scrubbed_item|
        maker.items.new_item do |item|
            item.link = scrubbed_item.link
            item.title = scrubbed_item.title
            item.description = Sanitize.clean(scrubbed_item.description)
            item.pubDate = scrubbed_item.pubDate
        end
      end
    end
    
    puts rss
    

    This clears out a lot of MacWorld’s “second bite at the apple” (heh) roundup posts, and the Macalope, who is dull.

    It occurs to me that maybe the overarching project here is to define a set of feeds I have an uneasy relationship with in a simple YAML file, like:

    ---
    title: Some Mac Dude's Feed
    shortname: some_mac_dude
    url: http://somemacdude.com/rss
    scrub: /somepattern/
    

    Then genericize the script above so a simple Sinatra service can serve up feeds from an endpoint, like http://mph.puddingbowl.org/feeds/some_mac_dude. Then they’re scrubbed, available to Google Reader, and I can build the “is this blog going to irritate me when Apple’s not rolling out new product” logic into the app.

    Say! We can also add tags!

    ---
    title: Some Mac Dude's Feed
    shortname: some_mac_dude
    url: http://somemacdude.com/rss
    scrub: /somepattern/
    tags: 
        - mac
        - coffee
        - children
    

    And set up an “annoyance” endpoint on the Sinatra app that can add and destroy annoyances from the feeds served. Then a little mobile app to manually toggle annoyances on and off as they occur to me.

    Gosh, Mike …

    Yeah, I know, o.k.? I know.

    Keep reading →
  2. Little Free Libraries Coming to Lents (care to help?)

    So, there are these things called “Little Free Libraries.” You build a small, weatherproof box, stick it on a post in your front yard, and you put books in it. People can take books or add books. You keep it stocked up if it runs low and keep it fixed up. That’s about it.

    Some neighbors of ours (the Springwater folks, who helped us build a retaining wall a few years ago), wanted to start a neighborhood library. I mentioned Little Free Libraries, and it seems several people had the same idea all at the same time. So Laura Jones, the librarian at Kelly Elementary –Ben’s school–got a grant, and a number of other folks from around the city contributed a design and did some preassembly work for eight or ten little libraries in our part of Lents.

    Yesterday we had a building party at Kelly Elementary, with each library host family getting help assembling their library. Ours isn’t quite done yet (needs shingles, a nice doorknob and a little finishing work). The host families now have a few weeks to get them painted and ready to go up. Toward the end of February, the Springwater folks will come around and dig the postholes and pour the concrete, then come around again the next day to mount the libraries. There’ll be a neighborhood bike tour to see all the libraries, and we’ll be hosting a kickoff party at our house.

    I’m a little excited about the whole thing: I’m really looking forward to keeping an inventory of the books in our little library, just to see what kind of use it gets. I’m hoping that ours, being across from a park, will see some use from the people who just come to hang out during nice weather and might like to have something to read while they’re sitting under a tree.

    I’m also a little trepidatious, because I don’t want it to get vandalized. The flip side of living across the street from a park is that the pleasant people sitting under trees reading books by day are replaced by drunk assholes after 10:00 p.m. (Or teenagers dry-humping on the teeter totters, but they’re not usually interested in breaking anything.)

    I’ve got a few ideas for our home’s library:

    1. It might be fun to tag the books and do the occasional ride through the neighborhood to other little libraries to see if any of the titles migrate.

    2. One of my neighbors is an Army Corps of Engineers mathematician, and he’s interested in a campaign to build a small web app so Lents librarians can keep track of their inventories online.

    3. It seems like an easy hack to tear apart one of those solar-powered garden lights, hook the door up to a switch to make a little light come on, for after dark visitors who aren’t interested in vandalism. I’d thought about just mounting a light that would come on after dark, but that might be a beacon for trouble.

    I’m sort of torn on the ideas that involve broadcasting the library’s presence. Having held a few garage sales where the book scanner people turn up in force, I don’t know if it would be a good idea for all our neighbors to plot interesting titles on a map. It was fun to think about building a library app and providing an API …

    Would You Like to Help?

    Since we’ll have to keep the library stocked up, donations are welcome. If you’ve got any books you’d like to contribute, I’d be happy to take them off your hands.

    Better yet, if you do a zine or have published something you’d like to share, I’d love to include stuff like that in our library.

    I’m sure I’ll have to go down to Goodwill or Value Village with a twenty now and then to stock back up, but the more original work I can include, the better. And self-published stuff you did on a shoestring is the very best: I’d really like it if our patrons could see and enjoy creative work that didn’t come from a big publishing house. You won’t just be sharing your words, you might be sharing a hint or a nudge.

    #building stuff #lents #little free libraries

    Keep reading →