Skip to content

Instantly share code, notes, and snippets.

@chsh
Created November 4, 2013 01:13
Show Gist options
  • Save chsh/7296709 to your computer and use it in GitHub Desktop.
Save chsh/7296709 to your computer and use it in GitHub Desktop.
Get URL Shorten service list from LongURL.
require 'open-uri'
require 'json'
url = 'http://api.longurl.org/v2/services?format=json'
r = open(url, 'User-Agent' => 'Your-Script-Name/1.0').read
j = JSON.parse r
puts j.values.map { |v| v['domain'] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment