Skip to content

Instantly share code, notes, and snippets.

@weatheredwatcher
Created December 5, 2013 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weatheredwatcher/7799939 to your computer and use it in GitHub Desktop.
Save weatheredwatcher/7799939 to your computer and use it in GitHub Desktop.
This is a ruby snippet I use in a TextMate Bundle for Hipster Ipsum
#!/usr/bin/ruby
require 'open-uri'
require 'json'
url = 'http://hipsterjesus.com/api?paras=1'
buffer = open(url, "UserAgent" => "Ruby-Wget").read
# convert JSON data into a hash
result = JSON.parse(buffer)
hipster = result['text']
puts hipster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment