Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rtanglao
Created May 3, 2011 19:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtanglao/954003 to your computer and use it in GitHub Desktop.
Save rtanglao/954003 to your computer and use it in GitHub Desktop.
How to find Get Satisfaction topics by tag e.g. find all mozilla messaging topics tagged android
# irb session follows:
require 'json'
require 'net/http'
require 'pp'
require 'Time'
def getResponse(url)
http = Net::HTTP.new("api.getsatisfaction.com",80)
url = "/" + url
resp, data = http.get(url, nil)
if resp.code != "200"
printf(STDERR,"Error:%d\n", resp.code)
return ""
end
result = JSON.parse(data)
return result
end
u="companies/mozilla_messaging/tags/android/topics.json"
r = getResponse(u)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment