« May 2006 | Main | July 2006 »

June 23, 2006

New Ruby API Library (Now With YAML!)

Always one to be fashionably late (in my usual stylish t-shirt and pair of jeans), I'm pleased to announce the release of a new version of our Ruby API library. Here's the part you'll really like: XML and REXML have been replaced with YAML and Syck.

That's right, EVDB API methods now return data in three different formats, depending on the way they are called. Get your XML, JSON, or YAML like so:

http://api.evdb.com/rest/events/get?app_key=applicationkey&id=E0-001-001056650-4
http://api.evdb.com/json/events/get?app_key=applicationkey&id=E0-001-001056650-4
http://api.evdb.com/yaml/events/get?app_key=applicationkey&id=E0-001-001056650-4

(The YAML output is a little experimental, and we've been spending the last few days tweaking the output. Let us know if something breaks.)

Since Syck powers the parsing, the API#call method gives you back a normal Ruby hash instead of a REXML object. venue.root.elements['//name'] becomes venue['name']. You know you like it.

But since Nothing is Ever That Easy, we're going to pretend that the old library never existed and ignore the incompatibilities introduced by these changes. Hey, what's that behind you?

Oh, sorry. I thought I saw something. Where were we? Oh, right, Ruby. Well, what are you waiting for? Go grab an application key and start coding! Get the code here and read the docs here. Here's a little something to get you started:

#!/usr/bin/env ruby
# A quick script that finds events I've created and displays how many people 
# have said "I'm Going"

# Require the EVDB API Ruby library
require 'evdb/api'

# These are the tokens needed to use the API
user = 'XXXXXX'
password = 'XXXXXX'
app_key = 'XXXXXX'

# Login as me
evdb = EVDB::API.new app_key,
                     'user' => user,
                     'password' => password

# Search for events that I've created
my_events = evdb.call 'events/search',
                      'q' => "user:#{user}"

# Check each event to see if people are going
my_events['events']['event'].each do |event|
  next unless event['going']

  # How many people are going?
  print people_going = event['going']['user'].size
  print (people_going == 1 ? " person is " : " people are ")
  print "going to your event #{event['title']} "
  print "on #{event['start_time']}\n"
end

Posted by paul at 02:54 PM | Comments (0)

June 13, 2006

Spotted in the Wild: Music Arsenal

Well, not so much spotted in the wild as "enthusiastically anticipated", but I'm stickin' to my metaphor. Jimmy Winter proudly announced that Music Arsenal's tour management module now integrates with Eventful, and through us to Podbop.

When entering a tour date into Music Arsenal the data is automatically sent to Eventful which PodBop then accesses and uses on their website.

(It might be the first example of mashup-to-mashup communication via an API.)

This is great for bands and labels (easier promotion to a wider fanbase) as well as for us; now Eventful gets to know about up-and-coming acts sooner and from authoritative sources. Definitely something cool!

Posted by chris at 09:53 AM | Comments (0)

June 05, 2006

Mashpit 3: This Time It's Personal

...and this time I'll be there with Chris Bennett, Eventful intern extraodinaire.

Full event details are in the usual place.

Posted by chris at 05:36 PM | Comments (0)

Javascript library now available

If AJAX makes you tingle or JSON makes you shiver with anticipation, check out our spanky new Javascript interface library, complete with callbacks and Prototype and other things I'm assured are the latest in development fashion.

Props to Brad for writing such elegant code.

Posted by chris at 10:39 AM | Comments (0)