May 21, 2007

Ruby API Updated to Version 2.2.0

The Eventful Ruby API library has been updated. Version 2.2.0 is spiffier than ever, and I'm starting to think I'm going to have to add darksunglasses.gem as a dependency for safety.

First, you can use Symbols or Strings for the parameter hashes.

event = eventful.call 'events/get',
                      :id => 'E0-001-003684357-3'

We cleaned up the paramter names ("server_port" renamed to :port, for example) and included a new example. But don't worry, version 2.2.0 is compatible with any code written against the eventfulapi library.

Pop open a terminal and run gem update eventfulapi, or if you're just starting out for the first time, gem install eventfulapi --remote. Check the library documentation and API documentation for more.

Join the developer mailing list and get in touch if you make something cool or have any problems or ideas. Now go and code!

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

July 03, 2006

New: Python API client library

We've just released a Python client library for our API. Here's how to use it:

import evdb

api = evdb.API('your API key here')

# If you need to log in:
# api.login('username', 'password')

events = api.call('/events/search', q='music', l='San Diego')

for event in events['events']['event']:
    print "%s at %s" % (event['title'], event['venue_name'])

evdb.py requires simplejson and httplib2. If you have them installed, a simple python setup.py install should do the trick.

Share and Enjoy!

Posted by ted at 02:10 PM | Comments (0)

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 05, 2006

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)

January 24, 2006

New: EVDB::API Ruby module

Just in time for Mashup Camp, we're proud to announce the availability of the EVDB::API module for Ruby. To install it with RubyGems, type:

gem install http://api.evdb.com/libs/evdb-current.gem

Note that this is what we call "Level 0" support for the API, which means it can call the REST methods and return parsed XML. More importantly, it lets you use our most secure form of user authentication without the hassle of mucking about with MD5 hashes yourself.

If Ruby is your thing, please give the new module a whirl and let us know what you think.

Posted by chris at 12:23 PM | Comments (0)