The Changelog

Open Source moves fast. Keep up.

Rails::API – Lightweight Rails stack for headless API apps #

“Rails is just an API,” say Alex (featured on Episode 0.7.1) and others. Rails core team member Santiago Pastorino might not endorse the “just” part, but his Rails::API aims to provide a slimmer stack for those wanting to use Rails as an API backend for their client-side or mobile applications. The result is a fine-tuned subset of Rails, letting the developer opt-in to just the middleware needed. Rails::API requires a small change to your controllers:

# instead of
class ApplicationController < ActionController::Base

# do
class ApplicationController < ActionController::API

Check out the README for installation and advanced usage and Santiago’s blog post for more.

We’ll be covering a similar project, Lightrail, when we chat with Tony Arcieri about Celluloid next week.

MBRequest – Easier API wrappers in iOS and OSX #

A good API wrapper should handle network transport, payload serialization/deserialization, and authentication, abstracting these details away in order to let the developer deal with the business domain of the API. Projects like Faraday, Requests, and others have made creating higher level wrappers much easier.

MBRequest from Mobiata does the same for iOS and OSX:

NSURL *url = [NSURL URLWithString:@""];
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url];
[urlRequest setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"];
MBJSONRequest *jsonRequest = [[[MBJSONRequest alloc] init] autorelease];
[jsonRequest performJSONRequest:urlRequest completionHandler:^(id responseJSON, NSError *error) {
    if (error != nil)
        NSLog(@"Error requesting top-rated videos: %@", error);
        NSArray *videos = [[responseJSON objectForKey:@"feed"] objectForKey:@"entry"];
        for (NSDictionary *videoInfo in videos)
            NSString *title = [[videoInfo objectForKey:@"title"] objectForKey:@"$t"];
            NSString *author = [[[[videoInfo objectForKey:@"author"] objectAtIndex:0] objectForKey:@"name"] objectForKey:@"$t"];
            NSLog(@"'%@' by %@", title, author);

Check out the examples folder in the project source for implementation ideas.

GitHub Archive: API for GitHub’s historical timeline #

You folks create a lot of events on GitHub. Trying to mine and report on that data is definitely a big data problem. Ilya Grigorik wants to help the community get a handle on the GitHub firehose with GitHub Archive. With an API call you can get a range of GitHub’s public timeline data for all seventeen event types:

require 'open-uri'
require 'zlib'
require 'yajl'

gz = open('')
js =

Yajl::Parser.parse(js) do |event|
  print event

The source is on GitHub. Be sure and listen to Ilya on Episode 0.5.5 talking about Goliah, EventMachine, and SPDY.

Usergrid – Turnkey social graph, activity streams for your application #

Almost every application has a social layer these days. If you have users, most likely you have relationships, roles, and activity streams. Usergrid, a Java project from Apigee aims to be a turn-key platform to add these features to your application. If the thought of setting up Cassandra is intimidating, you can use their hosted version, which will also give you some analytics:


For more info check out the project web site, API docs, or source on GitHub.

httpie – Python-powered HTTP CLI for humans #

Although cURL is great, we’re always looking for great console tools for working with HTTP. Jakub Roztocil has released HTTPie. Built on Requests, HTTPie provides a clean command line interface for HTTP requests:

http PATCH X-API-Token:123 name=John

PATCH /person/1 HTTP/1.1
User-Agent: HTTPie/0.1
X-API-Token: 123
Content-Type: application/json; charset=utf-8

{"name": "John", "email": ""}

I appreciate the colored terminal output:

HTTPie output

Source on GitHub.

Amon – Python-powered server monitoring, logging, and error reporting with JSON API #

Amon from Martin Rusev is a simple yet flexible way to add server monitoring, logging, and error tracking to your web stack. Amon consists of three parts: a collector daemon, a Python web app, and JSON API.

  • Collector daemon – Amon’s server and process monitoring is a thin wrapper on top of Unix tools to record metrics and store them in the MongoDB backend.
  • API – Shipping with language bindings for Python, Ruby, and JavaScript, Amon’s JSON API makes it easy to record your own application events.
  • Web interface – The web app provides a friendly user interface for viewing logs and visualizing data in charts.


The Amon documentation site is a great place to get started with installation and usage.

Renee – Sinatra-inspired Rack framework for über DRY routing #

Josh Hull knows Sinatra. As part of the Padrino, he also knows about creating new alternatives to popular frameworks. His latest effort is Renee, a web framework for Rack that aims to DRY up your routes.

We wondered though, as Sinatra fans, if we were to come up with a cleaner and more powerful DSL, what might that look like? Let’s consider an example from Sinatra to see where we can do better.

The result is a pivoted syntax that turns the routing DSL on its side:

path 'blog' do
  var do |id|
    @blog = Blog.get(id)
    get { halt @blog }
    put { @blog.update(request.params); halt :ok}

I can see how powerful this could be for creating complex REST APIs. Check out the nicely designed web site for more.

RestSharp: Simple REST and HTTP API Client for .NET #

I’m a big fan of making idiomatic language bindings for APIs. Making common tasks such as URI generation, transport, authentication, and payload parsing configurable options and providing a higher-level API lets application developers focus on the business domain instead of low-level networking.

.NET developers looking to write API wrappers without starting from
scratch should check out RestSharp from John Sheehan. Similar to Ruby’s HTTParty and others, RestSharp provides a number of features to make writing wrappers for REST web services a snap, including:

  • Automatic XML and JSON parsing including Fuzzy element name matching (“product_id” in XML/JSON will match C# property named ‘ProductId’)
  • oAuth 1, oAuth 2, Basic, NTLM and Parameter-based Authentication
  • Multi-part form/file uploads
  • Custom serialization and deserialization via ISerializer and
  • Both sync and async requests


Here’s a quick example of making a simple request for XML from an API using Basic Auth:

var client = new RestClient();
client.BaseUrl = "";
client.Authenticator = new HttpBasicAuthenticator("username", "password");

var request = new RestRequest();
request.Resource = "statuses/friends_timeline.xml";

RestResponse response = client.Execute(request);

In addition to using the built-in Authenticators,
you’re free to create your own:

var client = new RestClient("");
client.Authenticator = new SimpleAuthenticator("username", "foo", "password", "bar");

var request = new RestRequest("resource", Method.GET);

Perhaps most impressive is RestSharp’s support for a number of environments including .NET 3.5+, Silverlight 4, Windows Phone 7, Mono, and MonoTouch. Be sure and check out the project readme for advanced usage and tips on contributing.

[Source on GitHub]

Episode 0.6.0 – Fog and The Cloud with Wesley Beary

Wynn sat down with Wesley Beary from Engine Yard to talk about the Fog project and the Cloud, live from Red Dirt Ruby Conf. Items mentioned in the show: Wesley Beary aka @geemus The Fog project is the Ruby cloud services library By coincidence this interview was recorded the day the cloud went down Fog […]

#55: Goliath, Event Machine, and SPDY with Ilya Grigorik

Wynn caught up with Ilya Grigorik, Founder and CTO of PostRank to talk about Goliath, async Ruby web development, and Google’s SPDY. Download MP3 Items mentioned in the show: We’ll be doing a live show at Red Dirt Ruby Conf. Look for Steve at CodeConf. Ilya Grigorik founder and CTO of PostRank. PostRank taps into […]

Episode 0.4.7 – Open Government and the Citizen Coder with Carl Tashian

Adam and Wynn caught up with Carl Tashian from Open Government to talk about,, and the rise of the Citizen Coder. Items mentioned in the show: Carl Tashian is Director of Technology at Open Government OpenGovernment: Empower individuals and organizations to track government at every level – open source Rails app to […]

govkit: Open Government APIs in a box #

In the same way that Fog aims to be the “Ruby cloud services library” by providing an all-in-one bundle of wrappers for popular cloud services including Amazon, Rackspace, and others, GovKit from OpenGovernment is a Swiss Army Knife of government API wrappers. GovKit currently supports:

You’ll need to grab API keys for each service you want use. If you’re running Rails, GovKit includes a handy generator for creating an initializer to hold your config info in config/initializers/govkit.rb:

rails generate govkit

[Source on GitHub]

jquery-facebook-multi-friend-selector: A jQuery Facebook Multi-Friend Selector using the Graph API #

jQuery Facebook Multi-Friend Selector is a jQuery plugin created by Mike Brevoort that stands as an alternative for Facebook Multi-Friend Selection user interface that uses the Facebook Graph API. No server side component is necessary which makes it really easy to adapt and use.


This plugin depends on the new Facebook Javascript API, and inside the project there’s a jQuery plugin and accompanying CSS file to get you started.

You should be able to customize the look of this plugin quite a bit via CSS. For example, check out this stripped down demo to see a stacked list type selector vs the later demo we’ll mention.


Add this selector #jfmfs-container to your document and include the Facebook JavaScript API. Log in your user (FB.init and FB.login) and you will be able to load the friend selector. Check out the video below for a word from Mike on how things work.

For example:


This will pull back the current user’s friends and create the interface to select friends. When you’re ready to move on, there is a function you’ll need to call to return an array of the Facebook IDs of the selected friends.

var friendSelector = $("#jfmfs-container").data('jfmfs');
var selectedFriends = friendSelector.getSelectedIds();


If you want to get right to it and see a live demo, check out this demo of the jQuery Facebook Multi-Friend Selector plugin. Click “login” and then login to your Facebook account. You will then be able to see your list of friends in the friend selector.


For more details, check out this blog post and screencast.

[Source on GitHub] [Demo] [Discuss on Hacker News]

jsondns: DNS JSON API #

If you’re building a cool domain name service or DNS-related mashup, be sure and check out JSON DNS from Joël Franusic. JSON DNS aims to create a standard for DNS info in JSON, and the project includes a small Rack app for serving that data over HTTP.

// curl
  "header": {
    "aa": false,
    "ra": true,
    "cd": false,
    "opcode": "Query",
    "qr": true,
    "arcount": 0,
    "rcode": "NOERROR",
    "tc": false,
    "qdcount": 1,
    "nscount": 0,
    "ad": false,
    "ancount": 1,
    "id": 30523,
    "rd": true
  "answer": [
      "type": "A",
      "class": "IN",
      "ttl": 3600,
      "name": "",
      "rdata": ""
  "question": [
      "qname": "",
      "qtype": "A",
      "qclass": "IN"
  "additional": [

  "authority": [


JSON DNS supports lookups for A, NS, and MX records and even supports JSONP to allow cross domain access.

[Source on GitHub] [Demo] [Discuss on Hacker News]

webdis: HTTP + JSON API for Redis #

HTTP is the dial tone of the web. Apps that speak HTTP tend to grow in popularity, such as CouchDB whose built-in HTTP-based RESTful API makes it super easy to store and retrieve JSON data.

Nicolas Favre-Felix gives some web love to Redis fans with Webdis, an HTTP interface for Redis that serves up JSON. Built in C, Webdis aims to be fast like Redis itself. The URL structure takes the pattern of:[VALUE]

Let’s look at some concrete examples:

→ {"SET":[true,"OK"]}

→ {"GET":"world"}

curl -d "GET/hello"
→ {"GET":"world"}

While still early in development, the feature set is impressive. Webdis currently offers:

  • Support for GET and POST
  • JSON and JSONP parameter (?jsonp=myFunction).
  • Raw Redis 2.0 protocol output with .raw suffix
  • HTTP 1.1 pipelining
  • TCP or UNIX socket Redis connections
  • CIDR or HTTP Basic Auth security
  • Pub/Sub using Transfer-Encoding: chunked. Coupled with JSONP, Webdis can be used as a Comet server
  • Built-in support for json, txt, ‘html, xml, xhtml, png, and jpg
  • Custom Content-Type types based on file extension, or ?type=some/thing
  • Cross-origin XHR, if compiled with libevent2 (for OPTIONS support)
  • File upload with PUT, if compiled with libevent2 (for PUT support)

Check the README for the complete list. If you’d like to contribute, Nicolas is thinking about how to add other HTTP verb support like PUT and DELETE, Websockets, and Etags.

Also, if you missed it, be sure and catch Episode 0.4.5 with @antirez, the creator of Redis.

[Source on GitHub] [Comment on Hacker News]

apiary: Event Machine API in a box for your Ruby classes #

If you need to stand up an API for your Ruby web application, you’ve got a lot of choices including Rails, Sinatra, even close-to-the-metal Rack, or Grape.

But, if you’ve got some simple Ruby classes that you’d like to expose directly as a web-based API take a look at Joshua Hull’s Apiary.

Apiary uses Thin and some Event Machine goodness to let you declare methods in your Ruby classes as API methods:

class Temperature
  include Apiary              # Include Apiary as a module in your class

  version '1.0'               # Specifies a version prefix for your api

  get                         # Marks this method as accessible from GET
  def c2f(val)                # This is now available at /1.0/c2f/:val
    Float(val) * 9 / 5 + 32

You can start your Temperature API server with Apiary will crank up Thin and listen to requests on port 3000:

curl http://localhost:3000/1.0/c2f/23.45

Apiary is brand new and will likely change, but it looks promising.

[Source on GitHub]

node-o3-canvas: HTML5 Canvas API for NodeJS #

This isn’t the first time we’ve featured the work of our friends over at In the past we mentioned o3 and Cloud9 and even had them on the podcast, see episode 0.1.6.

Their project, node-o3-canvas, is an HTML5 Canvas implementation for NodeJS based on LibAGG and Freetype. It’s implemented using their previously mentioned O3 component system. The goal with node-o3-canvas is not only to create a Canvas-spec type API, but also to extend it to provide easy image resizing, and image processing API’s for server side image processing needs. makes use of node-o3-canvas as a way to render Canvas charts server-side to allow emailing or save-as-picture.

Example usage

How to use:

var createContext = require('path/to/node-o3-canvas/lib/o3-canvas');

Here’s a simple example usage:

var ctx = createContext(300,300, "argb");
ctx.fillStyle = "rgb(200,0,0)";
ctx.fillRect (10, 10, 55, 50);

var buf = ctx.pngBuffer();

[Source on GitHub] [Readme] [Blog Post]

WatchWednesday for 20101103

Our weekly list of projects you might have missed on GitHub: RestKit RestKit is a nice high-level library for consuming REST resources in Objective C. It runs on OS X and iOS and provides three major features: Network transport including GET, POST, PUT, and DELETE Object mapping between JSON responses and local domain types, in […]

scrobbyl: Automatically Scrobble your vinyl collection in real time #

When we find them, we like to cover niche projects that show off the homebrew spirit that has always been strong in open source communities.

Scrobbyl is a Python utility to sample what’s spinning on your turntable and scrobble it to your account.


How does it work?

First, authenticate Scrobbyl with your account:

python auth

Next, make sure ffmpeg is in your PATH, hook up your turntable to your audio line in and run scrobbyl


Scrobbyl will create an audio fingerprint of your track, query it via the Echo Nest API, and update your account.

The term scrobbyl is a mashup of scrobble and vinyl. Be sure and catch Episode 0.3.5 with Max Howell, formerly of, who built the original Scrobbler.

[Source on GitHub] [Home page]

resty: Piping hot REST client for bash or zsh #

I love REST APIs, so I’m always looking for new tools for the toolbox. Resty from Micha Niskin caught my eye because it can be loaded into your bash or zsh. To install, just download the script and source it.

$ curl > resty
$ . resty

Now your shell is loaded up with the Resty commands. First, set an API endpoint, like GitHub:

$ resty*

Now we can make any normal GET, POST, PUT, or DELETE as you would expect.

GET /pengwynn.json

For formatted output, pipe it to pretty print:

GET /pengwynn.json | pp

… or save to a file

GET /pengwynn.json > me.json

REST on the Couch

Resty is perfect for CouchDB. Just set your endpoint


… and you’re ready to create datbases

PUT /test '{}'

… and stash documents.

PUT /test/me < me.json


Since Resty sits on top cURL, any additional options after the required path will be passed along to cURL:

GET /repos/show/pengwynn -u pengwynn:0U812

Be sure to check out Jan-Piet Mens’ introductory screencast or the README for advanced usage.

[Source on GitHub] [Screencast] CLI for Joyent’s Node.js hosting #

Joyent’s sevice and its API look to be an exciting option to host Node.js projects. Jeremy Johnstone brings that API to your CLI with his wrapper. can be installed via npm:

npm install

Next, configure your API credentials:

$ config --api pengwynn S3CR3T
New config options for API have been saved!

Setting up a new instance requires an invite, or coupon. You can check if you’ve got any available with the coupons command.

$ coupons
You have no available coupons! Try requesting one maybe?

D’oh, no soup for us. Let’s request one, maybe we’ll get lucky:

$ coupons --request
You have already requested a coupon.

I got this message because I had already requested one by showing the API some love, literally:

$ curl -k -u pengwynn:S3CR3T♥ -X POST

Oh well, if someone at Joyent is reading this, I’d love a coupon.


Thanks so much to konobi for hooking me up!

[Source on GitHub] [Joyent’s]

htty: HTTP TTY, curl meets lynx in an HTTP console #

We’ve covered a number of web console tools like Webshell, a nifty HTTP console for Node.js, and Twurl, the Twitter-specific tool for Ruby.

But when Nils Jonsson created an incredibly useful HTTP console with some old-school flair, we took notice. HTTY brings HTTP to a handy terminal shell in what Nils describes as a combination of curl and lynx.

HTTY is installed as a gem:

sudo gem install htty

You can then fire up the console with your API or web site endpoint:

$ htty
*** Welcome to  htty , the HTTP TTY. Heck To The Yeah!>

To make a request, just use the get command

*** Type cookies-u[se] to use cookies offered in the response
 200  OK -- 10 headers* -- 27206-character body>

To see what we got back from the server, just use body:

$ body
[{"repository":{"description":"(Mac OS) TVShows 2 "Phoenix" is the next iteration of the easiest way to download your favorite TV shows automatically.","has_issues":false,"homepage":"","fork":false,"has_downloads":true,"watchers":78,"pushed_at":"2010/08/16 14:39:36 -0700","url":"","private":false,"name":"TVShows","owner":"mattprice","forks":10,"has_wiki":false,"created_at":"2009/09/15 17:44:46 -0700","open_issues":7},"created_at":"2010/09/05 21:04:43 -0700","sha":null,"public":true,"actor":"pengwynn"

HTTY is incredibly well documented, and the help command lists the full power of the console:

$ help


  a[ddress] address            Changes the address of the request
  cd path                      Alias for pa[th-set]
  fol[low]                     Changes the address of the request to the value
                               of the response's 'Location' header
  fragment-c[lear]             Alias for fragment-u[nset]
  fragment-s[et] fragment      Sets the fragment of the request's address
  fragment-u[nset]             Removes the fragment from the request's address
  history                      Displays previous request-response activity in
                               this session
  history-[verbose]            Displays the details of previous request-response
                               activity in this session
  ho[st-set] host              Changes the host of the request's address
  pa[th-set] path              Changes the path of the request's address
  por[t-set] port              Changes the TCP port of the request's address
  query-c[lear]                Alias for query-unset-[all]
  query-s[et] name value       Sets a query string parameter in the request's
  query-unset name             Removes a query string parameter from the
                               request's address
  query-unset-[all]            Clears the query string of the request's address
  r[euse] index                Copies a previous request by the index number
                               shown in history
  sc[heme-set] scheme          Changes the scheme (protocol identifier) of the
                               request's address
  userinfo-c[lear]             Alias for userinfo-u[nset]
  userinfo-s[et] userinfo      Sets the userinfo of the request's address
  userinfo-u[nset]             Removes the userinfo from the request's address

                               Building Requests

  body-c[lear]                 Alias for body-u[nset]
  body-req[uest]               Displays the body of the request
  body-s[et]                   Sets the body of the request
  body-u[nset]                 Clears the body of the request
  cookie-a[dd] name [value]    Alias for cookies-a[dd]
  cookie-r[emove] name         Alias for cookies-remove
  cookies                      Displays the cookies of the request
  cookies-a[dd] name [value]   Adds a cookie to the request
  cookies-c[lear]              Alias for cookies-remove-[all]
  cookies-remove name          Removes from the request the last cookie having a
                               particular name
  cookies-remove-[all]         Removes all cookies from the request
  cookies-u[se]                Uses cookies offered in the response
  header-s[et] name value      Alias for headers-s[et]
  header-u[nset] name          Alias for headers-unset
  headers-c[lear]              Alias for headers-unset-[all]
  headers-req[uest]            Displays the headers of the request
  headers-s[et] name value     Sets a header of the request
  headers-unset name           Removes a header of the request
  headers-unset-[all]          Removes all headers from the request

                              Inspecting Responses

  body[-response]              Displays the body of the response
  headers[-response]           Displays the headers of the response
  st[atus]                     Displays the status of the response


  e[xit]                       Alias for qui[t]
  hel[p] [command]             Displays this help table, or help on the
                               specified command
  qui[t]                       Quits htty

As many readers know, I’m a sucker for embedded humor, so I also got a chuckle from the exit message:

$ quit
*** Happy Trails To You!

[Source on GitHub]

facebook-ios-sdk: Drop Facebook into your iOS application #

Facebook loves iOS developers. First, they gave us Three20, a nice iOS app framework extracted from their popular native app. Now they’ve released the Facebook iOS SDK which lets you easily add authorization, API calls, and Facebook dialogs to your iOS apps.


To authorize a user using OAuth2 you can simply create the Facebook client and call authorize

facebook = [[Facebook alloc] init];
[facebook authorize:apiKey permissions:permissions delegate:self];

Making API calls

Now you can do things like getting info for the authenticating user:

[facebook requestWithGraphPath:@"me" andDelegate:self];

or get that users’s friends

[facebook requestWithGraphPath:@"me/friends" andDelegate:self];

[Source on GitHub]

webshell: A console-based JavaScripty web client utility (using node.js) #

If you’re like me, you probably spend a good deal of time using cURL from the console or Hurl on the web to test/inspect/debug HTTP stuffs. Wanting something a bit more robust and console-friendly Evan Haas and Sean Coates have created Webshell.

Webshell is built on Node.js (of which we’re big fans), and gives you a simple console to load and debug HTTP calls, follow 302 redirects, store history, process JSON, and more:

To run, clone the project and then fire up the shell with Node:

node shell.js 

Then you’re all set to start making HTTP requests:

webshell> GET
HTTP 301
webshell> $_.headers
{ location: ''
, 'content-type': 'text/html; charset=UTF-8'
, date: 'Sun, 08 Aug 2010 22:38:23 GMT'
, expires: 'Tue, 07 Sep 2010 22:38:23 GMT'
, 'cache-control': 'public, max-age=2592000'
, server: 'gws'
, 'content-length': '219'
, 'x-xss-protection': '1; mode=block'
, connection: 'close'
webshell> $_.headers.location
webshell> $_.follow()
HTTP 302
webshell> $_.headers.location
webshell> $_.follow()
HTTP 200
webshell> $_.raw.substring(0, 50)
'<!doctype html><html><head><meta http-equiv="conte'
webshell> ^D

The built-in JSON processing is slick:

webshell> GET
HTTP 200
webshell> $
'Sean Coates'
webshell> ^D

[Source on GitHub]

Open Graph – Ruby library for Facebook’s new API #

[Updated]: Thanks to Michael’s correction in the comments below and more caffeine it’s apparent that Michael released two entirely unrelated Facebook gems yesterday. Also, as Mike points out, the example in this case is hypothetical since IMDb does not yet support OpenGraph.

OpenGraph is a way to let web publishers turn ordinary web pages into rich objects in a user’s social graph just by embedding some meta tags on the page:

<html xmlns:og="">
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="movie" />
<meta property="og:url" content="" />
<meta property="og:image" content="" />

With Michael’s gem, you can now query a site and get this information back:

require 'opengraph'

movie = OpenGraph.fetch(')

movie.title # => 'The Rock' # => true
movie.image # => ''


[Source on GitHub] [OpenGraph protocol] [Facebook API docs]