David Singleton
Batch event importing to Last.fm

Over christmas I sorted out some old boxes from University and found all the paper ticket stubs for gigs from 2002 to 2005. That’s some meaty data I didn’t want to lose, I copied it to a spreadsheet with plans to import it in to the Last.fm events system (where I track all my current gig habbits).

Unfortunately the add events workflow is a real pain for adding more than one event at once, let alone the 50 I had. In the future we hope to add better support for adding multiple events, either with a new tool (aimed at promoters) or creating an event.add API method (and let someone else build it), but in the meantime I wanted a quick hack solution to speed things up.

Seeing as I had all my data in CSV already, the simplest approach is to generate URLs that pre-fill the “Add Event” form data and let you skip to the last step. Note; We use one-time form tokens to prevent XSRF attacks, so you can’t just submit the form a script. All the fields can be passed as GET variables to prefill, here are the query param names you’ll need to do this:

type
“gig” or “festival”
startday
2 digit day, eg 03
startmonth
2 digit month, eg 11
startyear
4 digit year, eg 2002
starttime
24 hour time separated by a colon, eg 20:00
venueid
The Last.fm venue id, you can find this in the venue URL
festivalName
Confusingly this is just event name/title, not festival specific
artistNames
Multiple artist names, specified as an array, eg artistNames[]=Blur&artistNames[]=Radiohead&artistNames[]=Pulp

So a complete example looks like:

http://last.fm/events/add?type=gig&artistNames[]=Sparta&startday=04&startmonth=10&startyear=2005&starttime=20:00&venueid=8777858&festivalName=

If you have your events in a structured format then it’s easy to build a quick script to generate these links and really reduce the time needed to add events. Far far from ideal I know (and I’m a bit embarrassed to post it) but it might save you some time. I promise to build event.add to the API soon.

Recent downtime & upcoming events

Sorry to the (few) people who haven’t been been able to access the site recently. For the past 6 months or so I’ve been hosting this blog on the server at work, so when we switched ISP’s (and thusly IPs) I completely forgot to update my DNS record.

Although it’s handy to host this at work I think it’d be for the best to get some proper hosting. We’ve done quite a lot of internal network reorganising recently, which means availability has been a bit patchy. It also means i cant host huge copyright infringing files Linux ISOs. I’ve been looking at switching to Dreamhost, as they have a pretty nice set of features, but I’m curious if anyone would recomend anything else?

Pub Standards

Tomorrow (Thursday) marks Pub Standards XV, the usual web/booze collision in the middle of London. The sly of you may noticed that the landmark Pub Standards C has been scheduled for March 13, 2014, I think Patrick might be being a little optomistic.

Barcamp

After managing to snag a ticket for Barcamp London 2 I’m really looking forward to it, unfortunately I have no idea what to give a presentation on. Don’t get me wrong, i’m full of ideas (contrary to the evidence of this blog recently), but presenting to a group of geeks, meant as a compliment, who really know their stuff is quite a daunting prospect. I’ve been finding it very hard to decide on a topic I feel authorative on, as i’m still somewhat a jack of all trades, rather than having a specialist subject.

My last ditch plan is a discussion on the dangers of microformats and how a semantic web isn’t all rainbows and kittens, but i’m very open to suggestions for somerthig better.

FOWA

Future of Web Apps is a two day event in London the week after Barcamp, definately a lot more business-y than any other events i’ve been to. I couldn’t help but get that impression while signing up an being if I was a Designer, Developer, Information Archiatect, MD or Venture Capitalist. Crikey, makes Pub Standards feel like free love and communism.

Still, the line up of speakers is quite interesting and i’m curious to see how it compares to, the seemingly much more grass roots, dconstuct of 2006. And of course, it’s paid for by work, so that’s nice.

SXSW

Texas! I can’t believe this is so soon, it’s really crept up on me, which you can take to mean I’ve organised nothing for the trip and everything will be done at the last minute, still I can’t wait. It’ll be my first time in the States, or for that matter on a plane, so it will certainly be an interesting experience. Not to mention a week+ off work, now that wil be nice.