static-gmaps: Google Static Maps API Interface 5

Posted by John Wulff Mon, 25 Feb 2008 21:32:00 GMT

I’ve written my first gem: static-gmaps. It provides a simple interface to the Google Static Maps API.

Usage

map = StaticGmaps::Map.new :center   => [ 40.714728, -73.998672 ],
                           :zoom     => 5,
                           :size     => [ 500, 100 ],
                           :map_type => :roadmap,
                           :key      => 'ABQIAAAA3HdfrnxFAPWyY-aiJUxmqRROGu07ZpoXmWqnENIWDDAF-b-TwhQ4JdQya7b6I5CihUtHtwmmBzWc0Q'
map.markers << StaticGmaps::Marker.new(:latitude => 40,
                                       :longitude => -73,
                                       :color => :blue,
                                       :alpha_character => :b)
map.url => 'http://maps.google.com/staticmap?center=40.714728,-73.998672&key=ABQIAAAA3HdfrnxFAPWyY-aiJUxmqRROGu07ZpoXmWqnENIWDDAF-b-TwhQ4JdQya7b6I5CihUtHtwmmBzWc0Q&map_type=roadmap&markers=40,-73,blueb&size=500x100&zoom=5'

Installation

sudo gem install static-gmaps

Documentation

http://static-gmaps.rubyforge.org

Update February 27, 2007: Added markers.

DiggRuby 2

Posted by John Wulff Mon, 07 May 2007 05:50:00 GMT

DiggRuby is a Ruby implementation of the Digg API. It provides an object-oriented interface to all of the available endpoints of the API. It is offered under the MIT License.

The code is hosted in a Google Project.

You can either download v0.1 or get the latest from SVN:
svn checkout http://digg-ruby.googlecode.com/svn/trunk/ digg-ruby
A simple example:
require 'digg'
digg = Digg.new               # create a digg client
digg.stories.each do |story|  # fetch and print titles of stories
  puts story.title
end

Mark Nutter has written about his experience with DiggRuby and how he created Diggraphy.

Also, there is a thread discussing DiggRuby in the official Digg API Google Group.

Enjoy.