Skip to content

Instantly share code, notes, and snippets.

@ryngonzalez
Created September 30, 2012 07:37
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 ryngonzalez/3806173 to your computer and use it in GitHub Desktop.
Save ryngonzalez/3806173 to your computer and use it in GitHub Desktop.
Foursquare ruby implementations
client = Foursquare.new(:oauthToken => "", :oauthSecret => "")
categories = client.categories()
goodCategories = []
categories.each do |category|
if category.name != "food" || category.name != "nightlife"
goodCategories.push(categoryId)
end
end
slider = getSlider()
venues = client.explore(:ll => "", :limit => 10, :intent => "browse", :radius => (48280 * slider), :section => "topPicks")
threshold = getThreshold()
venues = venues.map do |venue|
value = tanh((venue.stats.checkinsCount/venue.stats.checkinsCount) * likes)
return venue if value > threshold
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment