With the geocoder gem, if I wanted to find pictures nearby one particular picture by a mile I could do pictures.nearby(1) but what if I had a user with a location and wanted to find pictures nearby my user, how would I do that
Instead of nearby() you can use
Pictures.near([u.lat, u.lon], 1) # venues within 1 miles of a user
See GitHub/geocoder
Related
i`m using this link to get my followers list usernames
https://api.instagram.com/v1/users/self/followed-by?access_token=XXXXXX
it returns 50 users with a pagination url for the next 50
the problem is the pagination url will stop showing after i reach 245 users, i do have more than 300.
when i tried to get a list os followers of another user thats not mine and its a public user with more than 600 followers i managed to get al the list
https://api.instagram.com/v1/users/{user-id}/followed-by?access_token=XXXXXX
so i said maybe i should change the request link and replace self with my userid because thats the only different between the two requests BUT still getting the same result, only 245.
https://api.instagram.com/v1/users/{my-user-id}/followed-by?access_token=XXXXXX
so is there another way to get all my followers usernames ? or Instagram is limiting this endpoint ?
thanks in advance :)
UPDATE
I even tried to add &count=-1 and it does not work
Tried &count=100 , &count=300 and still showing only to 245 users
I'm using the REST API (venues platform) to get a list of the top 5 venues per destination and category, like they are listed in the search results on the foursquare website.
For example i do the following request using the explore api endpoint:
https://api.foursquare.com/v2/venues/explore?near=zurich,CH&query=College %26 University
I'm using the apias a not authenticated. I do not pass a radius, to get the default radius.
Now the results from the api is as follows:
1. ETH Hönggerberg HIL
2. Technopark
3. Kantonsschule Stadelhofen
4. Zürcher Hochschule der Künste, Departement Musik
5. Klubschule Migros
When i search on the Foursquare Website as follow (not logged in!):
https://foursquare.com/explore?near=Zurich%2C%20CH&q=College%20%26%20University
I get the following results listed on the website:
1. SBB Digital
2. Technopark
3. ETH Hönggerberg HIL
4. EF Education First
5. Klubschule Migros
Is it possible to get the same list, as shown on the website (in the same order) also from the api? If yes? how can i do that? how do i call the api or how do i have to sort the results from the api to get the same list?
First i tried to sort the api results by the rating field, but that doesn't do the trick at all. Because in this example no one of the first 30 results does have any rating.
Thank you in advance for your help!
Greets
Tom
Make sure you are making the explore request with the same user account as on the web. Also, it looks like your queries do not match up exactly. One is "College & University and the other is "college" - try matching up the queries and seeing if the results change.
Well meanwhile i got the answer from foursquare.
The trick is very simple: just have to add the following parameters to the api call: time=any and day=any.
Then you get the results ordered exactly the same way as on the foursquare webpage (when not authenticated).
Thank you david from foursquare! :-)
I'm trying to filter a single SoundCloud user's tracks with a query (or even a tags/genre filter). I can get a user's tracks, but as soon as I add a query parameter, it returns all sound cloud users tracks.
This doesn't work:
SC.get('/users/00001/tracks', {q: 'Black Night'}, function(tracks) {
// returns tracks from all soundcloud users which contain 'Black Night'
// rather than the single user
});
Nor does this:
SC.get('/tracks', {user_id: '00001', q: 'Black Night'}, function(tracks) {
// returns tracks from all soundcloud users which contain 'Black Night'
// rather than the single user
});
You would first get all the songs by that specific user, for that you can use the code you used.
After that, you need to loop through all the songs you just retrieved and assign tracks[i].genre to a variable (let's say var track_genre)
Next, check if track_genre === myGenre (a parameter you give the function, which the user can choose)
If it's the case, go ahead and oEmbed the widget
I guess the main takeaway would be that you CAN access the genre of the songs you retrieved with 'SC.get' and filter on that, but you CANNOT SC.get specific genres FROM a specific user.
Anyway, that's how I just gotten around this particular problem; I'm sure there'd be better solutions, but this one works so... ;-)
soundcloud api does not work that way.
you can search All tracks by term, genre, bpm, date etc
or you can get user resources (tracks, favorites, groups, followers etc)
the best way to search inside tracks or any other user resource, is to get all results, and do the search inside the results.
Here under Subresources you can find /users/{id}/tracks - list of tracks of the user
How can I use Twitter Search API (or other) to get a list of tweets which have the "geo" param?
--EDIT--
By example: I wont get list of geotagged tweets, by #apple tag. Without location filter, worldwide.
Looks like the latest API supports that; simply use a large enough geo region for your query:
-180,-90,180,90
See more from the API link for filter and location
The streaming API allowed you to filter by a location and the search API allows you to search by geocode. You can find more information on these services on our developer resources site.
Streaming API: http://dev.twitter.com/pages/streaming_api
Example: Create a file called ‘locations’ that
contains, excluding the quotation
marks, the phrase:
“locations=-122.75,36.8,-121.75,37.8,-74,40,-73,41” then execute:
curl -d #locations
http://stream.twitter.com/1/statuses/filter.json
-uAnyTwitterUser:Password.
You will receive all geo tagged tweets
from the San Francisco and New York
City area.
Search API: http://dev.twitter.com/doc/get/search
Example: http://search.twitter.com/search.json?geocode=37.781157,-122.398720,1mi
From the Twitter API Documentation, this should be the format of your search query:
http://search.twitter.com/search.json?geocode=37.781157,-122.398720,1mi
Where 37.781157 is the latitude, -122.398720 is the longitude and 1mi is the radius to search within.
You can look for every tweet but save only the geotaged ones.
I know it dont make a lot of sense, but works quite well.
if you call you search results, you can state
for result in results:
if result.geo != None:
print result.text.encode('utf-8', errors='ignore') # or do anything you want with the tweets
Use -180,-90,180,90 to get any geotagged tweet.
Is there any way of accessing the data on Flixster? Specifically, I'd like to retrieve a list of all of my movie ratings. I know you can get an rss feed of these, but it only appears to return a subset of all of the ratings.
View your Rotten Tomatoes / Flixster movie ratings by accessing this URL, first replacing USERIDHERE in the URL.
http://community.flixster.com/api/v1/users/USERIDHERE/ratings.rss
You can find out your user id by clicking to view your Profile, which will contain your unique id in the URL, such as:
http://www.flixster.com/user/USERIDHERE/
Yes, there is a new-ish Rotten-Tomatoes API at http://developer.rottentomatoes.com/docs/read/json/v10/Movie_Reviews
Here's a simple program, using the API, that I've found:
https://github.com/mmihaljevic/flixter
...and you can read her blog post for more information.
Just tested both fetching and parsing, and it still appears to work.