Created
September 30, 2012 07:37
-
-
Save ryngonzalez/3806173 to your computer and use it in GitHub Desktop.
Foursquare ruby implementations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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