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
| select | |
| month, | |
| origin, | |
| avg(depdelay) | |
| from flights | |
| where origin in ('JFK', 'ORD', 'PHL') | |
| group by month, origin; |
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
| redirect_to "http://foursquare.com/oauth2/authenticate?client_id=#{Rails.application.config.FOURSQUARE_CLIENT_ID}&response_type=code&redirect_uri=#{redirect_uri}/" | |
| def redirect_uri() | |
| Rails.application.config.CALLBACK_PATH | |
| end |
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
| access_token = client.get_token( "code" => params[:code], "grant_type" => "authorization_code", "redirect_uri" => redirect_uri, :client_id => Rails.application.config.FOURSQUARE_CLIENT_ID, :client_secret => Rails.application.config.FOURSQUARE_CLIENT_SECRET) | |
| user = User.find(session[:user_id]) | |
| user.foursquare_access_token = access_token.token | |
| client = user.get_foursquare_client | |
| foursquare_user = client.user(:self) |
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
| https://api.hyperpublic.com/api/v1/places?phone_number=2122292217&client_id=8UufhI6bCKQXKMBn7AUWO67Yq6C8RkfD0BGouTke&client_secret=zdoROY5XRN0clIWsEJyKzHedSK4irYee8jpnOXaP |
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
| from hyperpublic import * | |
| ... | |
| for zip in zipcodes: | |
| inserted = 0 | |
| notinserted = 0 | |
| for p in range(1,rounds + 1): | |
| try: | |
| items = hp.places.find(location=str(zip),q="pizza", page = p, page_size = 50) | |
| except: | |
| break |