philwilson.org

a geek commodity

I have forked Charbot Green

January 14th, 2010 by Phil

About a year ago Libby Miller wrote Charbot Green, a BBC Radio 4 announcement bot for Twitter. It’s written in JRuby, uses the H2 database and the source code is in SVN here.

A screenshot of CharbotGreen on Twitter

A screenshot of CharbotGreen on Twitter

It’s a really great app and I thought I’d have a play, but half-way through the install I realised that setting up an H2 DB server was a step too far, so instead I rewrote it to be a pure Ruby app using the SQLite3 database. Using SQLite3 keeps it a self-contained app in a single directory without the need to run a database server.

You can get the code from GitHub here.

My small changelist looks like this:

  • H2 replaced by SQLite3
  • links to iPlayer use the short form of the URL
  • if available, the subtitle, such as episode number is displayed
  • now a pure ruby app!

I haven’t tested it very hard, just run it up a couple of times, so please do let me know of bugs or feel free to go fork it yourself!

Tagged: , , , | 5 Comments »

Adding a bookmark to an Android Home screen

January 2nd, 2010 by Phil

It’s easy to add a link to a URL to the home screen on the iPhone. When you’re looking at a web page, just hit “+” and select “Add to Home Screen”. On Android it’s slightly more involved:

  • Bookmark the page you want to add to a home screen
  • Go to the home screen you want to add the link to
  • long-press in an empty space to bring up the “Add to Home Screen” menu
  • select “Shortcuts”
  • select “Bookmark”
  • choose your bookmark!

The icon you get will be the standard bookmark image with a small overlay of the site’s favicon. If the site provides <link rel="apple-touch-icon-precomposed" href="blah" /> in the <head> then that will be used in preference. Both the iPhone and Android support the apple-touch-icon-precomposed link rel-type so it’s the preferred way of setting a custom icon for your webpage.

Update: I should mention that the resolution of the image you link to shouldn’t be too important but that the Android Icon Guidelines say it should be a 48×48 transparent PNG. I ignored that and used an icon I had lying around that was 256×256 and the OS scaled it just fine. Google themselves use this technique and their image is 57×57. You can find lots of good, free icons for your apps on Smashing Magazine.

Tagged: , , , | 1 Comment »

Setting up the Play framework on Google App Engine

December 14th, 2009 by Phil

The Play framework is the most fun I’ve had developing Java web applications. It’s fast, natural, comes with a rails-like scaffolding for CRUD operations on your model, has built-in Selenium testing as well as unit and functional tests, and most importantly Just Works.

It also deploys natively onto Google App Engine, but this isn’t described very well in the official documentation so here are the basics:

Get started

  1. Get yourself a GAE account and set up an application. you will need the ID.
  2. Download a recent nightly of the stable 1.0 branch (1.0 final doesn’t work with GAE, and Play needs to sort out its versioning system here)
  3. Unzip
  4. Download the GAE SDK for Java
  5. Unzip
  6. Create your app (although use Siena rather than JPA if you want to persist to the GAE data store) and configure it to use the GAE module
  7. Add your GAE application ID to myapp/war/WEB-INF/appengine-web.xml

Deploy to a local dev GAE environment

  1. run play war myappname -o myappname-war
  2. run APPENGINE_SDK_DIR/bin/dev_appserver myappname-war

Deploy to the GAE server

  1. run play war myappname -o ../myappname-war
  2. run APPENGINE_SDK_DIR/bin/appcfg update myappname-war/
  3. log in to your app engine console and check out your application!

Tagged: , , | 3 Comments »

Importing Nokia podcast subscriptions into Google Reader

December 3rd, 2009 by Phil

Exporting the list of podcasts

  1. load the podcasting application, mark all items and hit “send -> bluetooth”. Contrary to what you might expect, this will send an OPML file listing your subscriptions to your PC

Edit the list ready for import

  1. Open your new Podcasting.opml file in a text editor
  2. Find/replace all instances of url= with xmlUrl=
  3. Immediately after the opening <body> tag put <outline title="podcasts" text="podcasts">
  4. Just before the closing </body> tag put </outline>
  5. (I also duplicated all the text=”blah” attributes with title=”blah” but I don’t know if this is actually necessary)

Import the list of podcasts

The Google Reader Import/Export page

The Google Reader Import/Export page

  1. load Google Reader
  2. Click “Settings” in the top right
  3. Go to the Import/Export tab
  4. Find your Podcasting.opml file and upload!

You should now find that you have a new folder called “podcasts” in your google reader containing all the podcasts from your Nokia device.

Even nicer – if you make the folder public (Settings -> Folders and Tags) you can import the OPML from Google Reader directly into other applications by giving the URL http://www.google.com/reader/public/subscriptions/user/USERID/label/podcasts where USERID is the long number in the URL of the “view public page” link next to your public podcasts folder in Settings -> Folders and Tags.

Google Reader view public page section

Google Reader view public page section

Tagged: , , , , | No Comments »

Life-changing

November 8th, 2009 by Phil

Three months ago my first son, Daniel was born.

happy baby

I think it fair to say that blogging and coding have not been high on my agenda :)

Tagged: , | 1 Comment »

No more NewsGator, no Google Reader API

August 9th, 2009 by Phil

So everyone heard earlier this week that NewsGator is shutting down their aggregator synchronising service and getting everyone to switch to Google Reader.

There are two big problems for me:

There are also other issues of course, like Google owning yet another piece of monopoly pie, but the others affect me more directly right now.

Both NetNewsWire and FeedDemon now have the ability to sync with Google Reader, but there’s no published API, so I can’t mirror their behaviour in my own Linux desktop aggregator. At best I could use Niall Kennedy’s work from 2005 or maybe code from pyrfeed which has some documentation from 2007. Neither is an option I would choose willingly.

Tagged: , | 3 Comments »

Photo-frame dashbaord

August 7th, 2009 by Phil

In a comment on peterme.com over a year ago, I said

I’d like to see a personal dashboard being displayed through one of those digital wifi photo frames attached to the inside of my front door, so I can see the appointments my wife and I have got that day on my way out, plus other reminders based on previously gathered data. It can’t be far away, surely?

Apparently I was wrong, because I’ve not yet seen anyone doing this, but this kind of scenario came up at work the other day and, having forgotten suggesting it before, I suggested it again, in particular, using cron and imagemagick to take a screenshot of a web page, save it as an image and send it to the wifi photo frame.

This sounds terrifyingly doable, and semi-useful. If I could find a decent, cheap wifi photo frame, that might be something to keep me busy one weekend!

| No Comments »

How curious are humans?

July 27th, 2009 by Phil

I’m reasonably confident that at some unspecified point in the future we’ll tear the Universe in two.

I feel slightly proud about that.

| No Comments »

HTML 5

July 25th, 2009 by Phil

I don’t understand the recent hullaballoo over HTML 5. Its creation has been going on for years, and yet, suddenly it appears as though hundreds of supposed professionals in the field have only just heard of it because Jeffry Zeldman wrote a blog post. Even the WaSP has an interview with Hixie about it back in May! Welcome to your industry, people! Luckily for them, people like Jeremy Keith have stepped forward to give a potted summary of what’s going on and what it means for those who haven’t been paying attention in class.

Of course, this means that the same arguments that were brought up when HTML 5 started in the HTML WG and when the W3C adopted the existing work for their standard have come up all over again. Not that many of them ever went away of course, with accessibility in particular being the favourite one (important to get right after HTML4 set such an awesome example).

The absolute most-recent fuss is about a document called Restructuring HTML5 by Manu Sporny which contains some interesting notions like distributed source control of the spec document (via git) and adding the ability to make inline comments on the spec; neither of which I’d thought of before in this context. The former I can’t really see making any difference because it would presumably just increase the amount of work for any editor(s) (at least it would if we maintained Manu’s comparison to the Linux kernel) but the latter might be a good idea, especially having seen it work first-hand with The Django Book. It would also seem to make sense to break more parts of it out into separate docs like some sections already have been.  Of course, there are some also extremely poorly-considered thoughts like conflating the scientific process with consensus-forming which makes me rather hope that Manu enjoys his blood-letting sessions.

I like the document; it at least tries to be broadly constructive, and is written in nice big letters and an easy-to-read font. A table of contents might be nice though.

In other news, HTML4 and XHTML 1.0 will continue to work for probably decades to come, yet there are no two 100% interoperable implementations of either.

Tagged: , | 1 Comment »

Github worries me

July 18th, 2009 by Phil

I’m not that keen on git (for mostly aesthetic reasons although I suspect I’ll have to get over this soon), and github makes me jump through a couple of hoops too many to get up and running for the first time, but those aren’t things that worry me.

I’m worried about github going away.

Specifically I’m worried about it going away because so many people I actually know use it. Of course, github reminds me of this every time I log in because its social network features that allow you to follow people as well as projects has a constantly updating stream of activity from those people and projects; something that, as far as I know, Sourceforge and Google Code have never allowed you to do. For me, this changes the dynamic of a hosted version control system quite drastically, because you’re suddenly being shown, very clearly, all the changes your friends are making, and how much they’re investing in this system.

What I really want to know is – where else are they hosting their code? I mean, this is the kind of thing a distributed version control system makes easy, right? But as far as I know, none of these people are hosting their code themselves so if github went away I’d have no way of not only keeping track of what’s going on but of accessing their code at all.

This never seemed to be an obvious concern before on places like sourceforge, or rather, one that was much more localised to “me and the projects I’m interested in”. By spreading that to my network it somehow seems like a much more important problem.

Tagged: , | 5 Comments »

« Older Entries