tumblr get list users by hashtag - tumblr

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.

Related

Get share/like count for different url/bogposts/articles

I am looking for a method to get share/like count for each of the blogposts/articles which I create on my website. Interested in Facebook, LinkedIn and Twitter but Facebook is the most important right now.
Lets take this website as an example: https://googleblog.blogspot.com/
I have found a method to find this out for each url, but that will make it a lot harder for me as I would need to do it manually for each URL.
This is the query I used to get data for a specific URL:
https://graph.facebook.com/v2.7/?id=https://googleblog.blogspot.no/
Is there any method to get data for each and every url which contains: "company name" or something like this?
Will appriciate all the help I can get here.
No, there is no “wildcard” for Open Graph object URLs.
You can however request data for multiple URLs in one go, using the ?ids=foo,bar syntax – https://developers.facebook.com/docs/graph-api/using-graph-api/#multiidlookup
This theoretically works for up to 50 ids in one request (although with the ids being URLs in this case, you might only be able to request less, due to URL length limitations.)

How to get responses and comment attachments with Graph API

I am working on capturing Facebook page, event and group feeds with the Graph API. It's for a research project for my master studies. With these lines in the Graph API Explorer
{page-id}/feed?fields=from,message,likes,comments,attachments
I can capture the most I need. But the responses on comments and the attachments in comments (like when someone uses images in his or her comment) are still missing. How can I get them with the Graph API Explorer? It would be greet if I can get them within the whole context of the feed, not just when typing in the specific comment-id in the Graph API Explorer. Is there any way to get the needed data?
As https://developers.facebook.com/docs/graph-api/reference/v2.7/object/comments#read explains, it depends on the filter modifier whether you only get the top-level comments (toplevel, default), or all comments including replies (stream)
So if you modify your request as follows, you will get comments and replies on them in one go:
{page-id}/feed?fields=from,message,likes,comments.filter(stream),attachments
^^^^^^^^^^^^^^^
But that will give you all comments on the same level in the data structure, so you won’t know which are replies – so you might want to request the parent property as well; for replies that holds the id of the parent comment. With
comments.filter(stream){parent,from,message,created_time}
you will also get the parent for comments that have one. (Once you’re asking for a specific field, you need to ask for the rest of the fields you want as well.)

Query near public events via Facebook API v2.2

I want to retrieve a list of upcoming public events in my hometown from the Facebook Graph API.
I already know that FQL is deprecated and that I can query by keywords using a statement similar to
/v2.2/search?type=event&q=Berlin&since=2015-01-27
However, this list is not enough because there are lots of events which do not contain the City Name either in the event title, description or Location name.
On the other hand I can retrieve a list of places within the same City by using
/v2.2/search?type=place&since=2015-01-27&center=52.52,13.41&distance=10000
In my assumption I could retrieve a better event list if I create a query stating "give me all public events (eid) of all given places within this city in a specified distance".
Does anybody know if this is somehow possible to query?
I am unsure if batch processing is the right way to go, or if there is another possibility to Combine These two entities. My simple Approach would be to query each given Place again by requesting
/v2.2/{placeid}/events
but I also know that Facebook has a rate Limit of 50 requests in this case.
Right now Facebook doesn't have a way to do what you want or at least not documented.
The only way I think you could it is:
1- Find with the facebook API the pages in one city. (You can do do this manually or search for places near the city and then use the places that also ara pages)
2- Get the events of the pages (if exists) and save this in a db also with the location of the place/page.
3- Show all the events of the city.

How to get Likes Count with one graphi api call /home with all default fields for each post

The solution at https://stackoverflow.com/a/18351526/465974
makes use of fields keyword
Is there a way to get the the likes count via likes.summary(true) or some other way with graphi api call /me/home
but without restricting it to fields
seen in https://stackoverflow.com/a/18351526/337227 solution ?
It's not possible by design as fields need to be specified for summary info as mentioned in comments to the question above

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?