FaceBook Graph API - api

When I use FaceBook API for retrieving posts information, I found that the returned information are changing all the time.
for e.g., when I retrieved information 2 times with 1mins interval, one record appears in the 1st time, and disapeared in the 2nd time.
https://graph.facebook.com/search?q=baby&type=post&limit=100&since=2010-05-19&until=2010-05-21
Does anyone know what happen?
Cheers,
LingChen

Searches of large datasets are (in general) nondeterministic.

Related

What is the difference between parsing betting website for live scores vs official website API?

I want to monitor some live scores on soccer matches. I have 2 ways to do this:
official api from the website(free)
parse websites source code myself and get data from it( need to do it every second)
What is the difference? Is calling API faster?
This can depend on quite a lot external to this specific scenario, but given the context, yes the API's would much faster. The difference is in what data is being sent/received/parsed.
In either scenario you'd need some timer to tick and parse the results (website or API) so there's no performance difference in the "wait code", but the big difference will be in the data itself that is parsed. When you call the API, chances are more likely that you will send a specific parameter or call a specific function that indicates what you're looking for, pseudo-code example:
SoccerSiteApi.GetValue(SCORE, team1, team2);
Or
SoccerSiteApi.GetCurrentScores(team1, team2);
By calling the API, you are only sending and receiving a few hundred bytes (or more depending on data) and getting back exactly what you want, that is, you don't need to parse the scores out of the values sent back since they are the scores, so no processing time is spent doing anything additional with the data itself.
If, however, you were to parse the entire web site, you would need to make an HTTP GET request (and all that entails) to get the entire page (which could be a couple hundred KB or MB depending on content) and then spend processing time extracting the exact data you were looking for, and then doing this every second.
So the biggest difference is amount of data and time spent processing it.
Hope that can help

Getting tweets from a certain period where user was mentioned

I'm using the twitter API and would like to get all tweets from a given time period where a given user was mentioned.
I tried the search API with the until parameter where I could get the tweets for the previous 7 days from the date which is not the best, but fine. However, in this case the API only returns the number of tweets without the details.
Any ideas how to do it or what I'm doing wrong?
Thanks!
Strange, https://dev.twitter.com/rest/reference/get/search/tweets says it should return tweet objects. Are you sure you implemented it correctly? Which library are you using? Maybe there is a fault in its implementation. Another library could therefore be the solution.
Don't know whether this satisfies your needs, but you could also try to use the GET statuses/mentions_timeline API . This API returns up to 800 tweets in which the user was mentioned.
EDIT, based on the comments on this post:
You are doing 2 things wrong, namely:
As stated in the documentation the until parameter has a 7 day limit. So you can only retrieve up to 7 days of tweets.
Furthermore, you are making incorrect use of the since parameter. The since parameter specifies since this tweet (so the id of the tweet), not since this date.
Please read the documentation carefully. It is written very precisely and contains all the answers you probably need.

get +1 date timestamp or for google plus activities/posts

I am trying to get some information about the post people do in google plus. In particular I am interested in the "+1"'s.
Either from the google api or directly from the google plus web site you can get the total count and name of the people who did "+1". But, I would be interested in getting the time or timestamp of the "+1"'s. Does anyone knows if it is possible or how can I do that?
Help is always appreciated
Thanks to all,
As you can see at https://developers.google.com/+/api/latest/activities, the only data we return for a +1 is a list of the +1-ers, as well as the total number of people who +1'ed the item you are looking at.
If you would like to request additional data, please file a feature request in our Issue Tracker: https://code.google.com/p/google-plus-platform/issues/list. It would really help if you could be as detailed as possible in the type of data you would like to see and how you would ideally use that data.
If you're dealing with your own website and only care about +1s for pages on your own domain, you could use Google Analytic's social information to see how +1s change over time. You wouldn't get information about who did the +1ing.

Twitter REST API - Number of Tweets

I wrote a little Script using Python and Tweepy to save the tweets for a list of users and also to get some basic properties for those accounts.
Somehow the number of tweets stated in the user profile under statuses_count
(for an example of the json description of an account:
https://api.twitter.com/1/users/show.json?screen_name=TwitterAPI&include_entities=true )
does not match the number of tweets i get when iterating through the tweets of the same users profile.
I am aware of the fact, that twitter limits the number of tweets per user available through the API to 3200 and even does not guarantee this number, but this behavior does even occur with users who have well less than 3200 tweets
My question is, whether this difference is common and why this happens?
Is this just an issue of the twitter API, is it caused by deleted tweets (maybe they still count for statuses_count but can not be fetched anymore?), ...?
Thanks!
Thomas
I haven't messed with the Twitter API in several months, but I remember back when I was working with it I found inconsistencies due to retweets not showing up when iterating tweets, but getting counted in the number of Tweets. This seems to corroborate that, but its several months old and things may have changed since then.
Make sure include_rts is set to true, t, or 1 (in addition to specifying the same for include_entities, which you have done). When these aren't included by default (e.g. user lists) then you can get fewer tweets than what you specified with count.
The Twitter API documentation isn't clear on what the defaults are so it's safer to explicitly specify these optional parameters. And since you're specifically working with the user timeline you might also want exclude_replies turned off.

Can you get the exact date a user started following another using the twitter API?

Let's say user A follows user B, and B follows A. I want to know the exact date A started following B and viceversa.
Is this information stored on twitter? Can I retrieve it using the API?
To clear out: The point of this question is finding a way to know who followed who first.
(I'm assuming both A and B deleted the notification e-mails)
No Ignacio, you can't. You just can know who follows who but not the date the follow started.
Looking at the API, there's is no way, there are two calls to get the followers:
User Methods/statuses/followers
and
Social Graph Methods/followers/ids
Neither of them returns dates or even a serial that would let you see who started following first. Really, there's no indication that twitter is internally storing this information, neither in the API nor Twitter's web interface.
This is a very old question, but perhaps some might be interested to know that while you cannot get the date at which someone started following, you can at least infer an "earliest possible following date" from the fact that the list of followers is ordered according to date, and the fact that follower objects come with a created_at timestamp.
Here's a Python function for calculating an "earliest possible following date": https://github.com/BernhardClemm/twitter-follow-dates
Of course Twitter stores it, because Twitter sorts followers and following lists by the date ;)
It is possible to do this, but impractical. When you call the followers API you can page the results. Each returned object contains next_cursor and prev_cursor items. These refer to the first and last records in the next and previous pages. These values are time based and can be used to calculate the time that the respective users followed you.
It follows that, if you set the page size to 1, you can walk through the list of follower IDs one at a time and the next_cursor value will allow you to derive the follow time for the next record.
This is reasonably simple to implement, however, in practice, you'll very quickly hit Twitter's API rate limit.