Skip to content

Commit

Permalink
add Bitly example
Browse files Browse the repository at this point in the history
  • Loading branch information
mccoder committed Apr 23, 2010
1 parent 4f24fed commit 84e8e31
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Features:
* em-http-request: .get, etc are synchronous, while .aget, etc are async
* em-mysqlplus: .query is synchronous, while .aquery is async
* remcached: .get, etc, and .multi_* methods are synchronous
* bitly: api calls synchronous with HttpRequest.

## Example with async em-http client:

Expand Down Expand Up @@ -80,6 +81,18 @@ Features:

EventMachine.stop
end

## Example with sync Bitly client:

require 'em-synchrony'
require 'em-synchrony/em-bitly'

EM.synchrony{
bitly = Bitly.new('[INSERT_LOGIN]', '[INSERT_API_KEY]')
url='http://github.com/igrigorik/em-synchrony'
l=bitly.shorten(url)
p "Short #{url}=>#{l.jmp_url}"
}

# License

Expand Down

0 comments on commit 84e8e31

Please sign in to comment.