Filter not working on SoundCloud tracks search - soundcloud

According to the SoundCloud API documentation I should be able to specify filter=streamable on a search against tracks and (presumably) only get replies that are streamable. It's not working.
https://api.soundcloud.com/tracks.json?q=diddy&filter=streamable&client_id=<CLIENT_ID>
That returns some results that aren't streamable. Filtering the results myself is not desirable because I'm trying to fetch pages of a certain size.

Related

Algolia can't get all results

I am trying to fetch all records related to presto from Hacker News using their API that is built on top of Algolia Search API. And when I make this simple request
https://hn.algolia.com/api/v1/search?query=presto&hitsPerPage=1000
I get weird pagination results
values."nbHits":3977,"page":0,"nbPages":1,"hitsPerPage":1000,"exhaustiveNbHits":true,"exhaustiveTypo":true,"exhaustive":{"nbHits":true,"typo":true},"query":"presto","params":"advancedSyntax=true\u0026analytics=true\u0026analyticsTags=backend\u0026hitsPerPage=1000\u0026query=presto","processingTimeMS":73,"processingTimingsMS":{"afterFetch":{"format":{"highlighting":45,"total":54},"total":70},"fetch":{"total":3},"total":73}}
I see that number of hits is 3977, but that there is only 1 page with 1000 results. Not sure how to fetch all 3977 results, I tried setting page 2 but no results there.
What I am doing wrong?

tumblr get list users by hashtag

I can't find the way to look for users on tumblr with a specific hashtag.
Example with hashtag "garden". How can you get a list with all users who used this hashtag? And if possible within a certain timeframe?
I guess it's easy but I can't find it.
kind regards
You can't just fetch all users who have used a tag, but you can iterate through posts that have that tag. Use the /v2/tagged route in the Tumblr API.
GET /v2/tagged?tag=garden
Parse the response as json and fetch each response[i].blog_name to construct a list of blog names that have used the tag.
You can then fetch the next page by using the response[i].timestamp field of the last post in the array. Just pass it as a before query parameter in your next request.
GET /v2/tagged?tag=garden&before=1480712397
If you'd like to limit to a specific timeframe, you can just start with the most recent date in before, and proceed until you hit a post with a timestamp past your oldest date.

How to search Facebook's "invitable_friends" results

I have a Facebook app, and I'd like to allow my users to invite their Facebook friends to my app. The proper endpoint is /me/invitable_friends which is working well. But towards the bottom of that doc page, they recommend implementing a "search box" to filter the results, yet they don't offer any example of how to do this. I've searched around and haven't found anything.
It doesn't appear as though you can pass additional params for filtering the results. Obviously I can filter the results after the fact, but that's not scalable since the API only returns ~20 users at a time. That limit is modifiable (I believe), though it's of course not wise to bump it too high.
So how can I build a search box interface if I can't pass the search text to the endpoint? I must be missing something.
Thanks in advance.
PS - I'm using the JS SDK.
You should probably file a bug.
Based on the documentation the default size is 1000 records (average Facebook friend list size is 300-400)
If you don't see the next parameter at the end of the result under paging then there are no more results.

Filter YouTube Videos which can not be played on iphone device (yt:accessControl embed and syndicate) fields

I am using this api to fetch youtube videos
API that i am hitting is:
http://gdata.youtube.com/feeds/api/charts/movies/trending?v=2&paid-content=false&hl=en&alt=json&format=5
Can you please suggest some way so that i can send some parameters in this api that can filter the results on basis of yt:accsessControl embed and syndicate fields... so how to embed this fields in api to filter results
I have tried this :
http://gdata.youtube.com/feeds/api/charts/movies/trending?v=2&paid-content=false&hl=en&alt=json&format=5&embed='allowed'&syndicate='allowed'
This does not filter the video results.. so please suggest what should i do ?
format=5 effectively acts as a proxy to return only videos that are embeddable.
Similarly, you can use format=1 (which is one of the public RTSP streams) to return only videos that have syndication enabled, since only those videos will have that format available.
You can't combine the two to get back only videos that have both set, though. If you say format=1,5 you'll get back videos that have either set.

Facebook Graph API: Getting the total number of posts

I've been using the Facebook Graph API to display user posts. When I get the initial "page" of posts, the resulting data object has a paging property object with a previous and next URL property. I was hoping to generate navigation links based on this available paging information. However, sometimes these URLs point to an empty set of data, so I obviously don't want to navigate the user to an empty page.
Is there a way to find the total count of objects in a collection so that better navigation can be derived? Is there any way to get smarter paging data?
Update:
Sorry if my post isn't clear. To illustrate, look at the data at https://graph.facebook.com/7901103/posts and its paging property URLs. Then follow those URLs to see the issue: empty pages of data.
Since it pages the datas with date-time base. You can't get the knowledge of whether if there are datas or not before you actually send the request to it. But you can preload the data from previous url to determine is it suitable to dispaly a previous link in your web page.
Why be dependent of Facebook?
Why don't you preload all data for a user and save into a database. Then you fetch the posts from db and show to user. This way you have all the control on how many posts there are and how to manage next and prev.
I was going to try to post this as a comment to your question, but I can't seem to do so...
I know that the Graph API returns JSON, and while I've never come across a way to have the total number of posts returned, depending on what technology you are using to process the response, you might be able to capture the size of the JSON array containing the posts.
For example, if I were using a java application I could use the libraries available at json.org (or Google GSON, or XStream with the JSON driver) to populate an object and then simply use the JSONArray.length() method to check for the number of posts returned.
see:
http://www.json.org/javadoc/org/json/JSONArray.html
It might seem like a bit of a simplistic solution, but might be the type of work around you require if you can't find a way to have Facebook return that data.
Can you specify what technology your application is based in?