Description Usage Arguments Value Examples
View source: R/YelpByLocation.R
Use Yelp's search API to search for a term by location.
1 | YelpByLocation(lon, lat, term, auth, limit)
|
lon |
Longitude to search from (can be text or numeric). |
lat |
Latitude to search from (can be text or number). |
term |
What to search for (e.g. restaurants, bars, etc). |
auth |
Authorization from |
limit |
Maximum number of search results. |
Returns a data.frame
with the search results.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
# Your credentials:
consumer.key <- "YOUR CONSUMER KEY"
consumer.secret <- "YOUR CONSUMER SECRET"
token <- "YOUR TOKEN"
token.secret <- "YOUR TOKEN SECRET"
app <- httr::oauth_app("YELP", key = consumer.key, secret = consumer.secret)
auth <- httr::sign_oauth1.0(app, token = token, token_secret = token.secret)
# Search for restaurants near Time Square, NYC:
YelpByLocation(lon = -73.9873197, lat = 40.758895, term = "Restaurants",
auth = auth, limit = 3)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.