will.thoughts.pop
RSS icon Email icon Home icon
  • Freecycle and Freegle group finder for the iPhone

    Posted on February 2nd, 2010 Will No comments

    Recycling Group Finder app for the iPhone

    I’ve launched my first iPhone app, the Recycling Group Finder for iPhone. It complements the Recycling Group Finder web app making it even easier to find your closest Freecycle or Freegle group by using the iPhone’s in-built GPS. Check out the information page and give it a go, it’s free.

  • Generating a plist file in rails

    Posted on January 25th, 2010 Will No comments

    I recently wrote an iPhone app (Waiting for approval in the app store at the time of writing) that needed data exported from a website (recyclinggroupfinder.com). The simplest way of handling external data in an app it seems is using a plist file, so I wrote this to generate one for me.

    First of all I made my action respond to the plist format:

    Next I created a builder file to format the data:

    Then register the MIME type at the bottom of environment.rb:

    Mime::Type.register "text/plist", :plist

    And that’s it! Well mostly. The XML file generated can be made significantly smaller by converting it into the binary plist format, run this on the command line in terminal after downloading the generated XML plist.

    cat things_xml.plist | plutil -convert binary1 - -o things.plist

    The resultant binary plist is almost half the size of the XML one, much better for inclusion in an iPhone app:

    pleb:~ will$ ls -l things*
    -rw-r--r-- 1 will will 1247300 20 Jan 18:50 things.plist
    -rw-r--r--@ 1 will will 2110437 20 Jan 18:50 things_xml.plist

    Of course it would be much better to generate the binary format directly, and the plist-official gem looks like it can handle that and I mean to investigate, but I wrote the XML version before finding the gem, and it works for me!

  • Ninja Tank Army

    Posted on September 6th, 2009 Will No comments

    I’m not sure how stealthy it’s going to be, but a “Ninja Tank Army” is possibly the coolest thing in the world:

    Ninja Tank Army