public
Description: A ruby library based on Blather for working with the Collecta XMPP api.
Homepage:
Clone URL: git://github.com/sprsquish/collecta-rb.git
sprsquish (author)
Wed Nov 04 18:48:27 -0800 2009
commit  4351abdc6efda3a3216251a6e531dbb1cefa0da4
tree    199c055d2daccd6c848c65d419d613d7edb4a044
parent  68506e5e21f25903534c8e7a5147a0bdc937901d
name age message
file .gitignore Loading commit data...
file LICENSE
file README.md
file Rakefile
file VERSION
directory examples/
directory lib/
directory spec/
README.md

Collecta.rb

A ruby library based on Blather for working with the Collecta XMPP api.

Install

Gem is hosted on Gemcutter

sudo gem install collecta-rb

Example

require 'rubygems'
require 'collecta-rb'
require 'pp'

client = Collecta::Client.setup '[api-key]'

client.subscribe('earthquake') do |result|
  pp({
    :query => result.query,
    :title => result.title,
    :category => result.category,
    :abstract => result.abstract,
  })
end

client.notifications('earthquake') do |notification|
  pp notification
end

client.archive('earthquake') do |result|
  pp result
end

EM.run { client.connect }

Copyright

Copyright (c) 2009 Jeff Smick. See LICENSE for details.