def determine_congrats x
client = SODA::Client.new({:domain => 'explore.data.gov', :app_token => '1ItWOJ1oGYyvN9Ajo5UvHCSaa'})
output = client.get("https://data.sfgov.org/resource/wwmu-gmzc.json", {"$where" => "title like '#{x}%'"})
if output == []
""
else
titles = []
output.each do |row|
if row["title"]
titles.push(row["title"])
end
end
titles = titles.uniq
if titles.length == 1
"Bingo! "
else
""
end
end
end
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .