Retrieve complete Twitter timeline - php

we are working on a PHP webservice which is intended to retrieve a user's twitter timeline.
Now comes the problem, this is the URL we use: "http://api.twitter.com/1/statuses/user_timeline/$user.json?count=$num&include_rts=1 where $user is the user (^_^) and count the number of tweets to retrieve but it only shows me the tweets generated by the user or the ones reteeted by him.
I need ALL tweets that appear on his timeline, means the one he tweets and the ones people he is following tweets.
Is there any parametermissing in the URL above or do I have to use another method instead?
Thanks in adavance.

I answered a very similar question, it would apply in your case too..
use Twitter Counter as Twitter only supplies you with numbered I.D's rather then detailed info about followers.
Counting a Group of Twitter Users' Followers
MyAccount > MyFollowersAccount > followers_count
What I would do is this,
run the Twitter API method GET followers/ids
https://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=twitterapi
to get the ID's of the followers of screenname X
and then switch over to Twitter Counter which will give you a more
detailed list and information about the followers, followers
specifically. Also, this could be a way to split up the two calls so
you won't be blocked by a rate limit problem on one end.
http://twittercounter.com/pages/api?ref=footer

Related

Is this possible to get info about followers of instagram users?

I want to do simple dashboard for all my IG accounts.
I need to get all followers (usernames or id) who follow a certain user.
For example all followers of user foo.
I tried to do this with PHP and scraper but I can't do that. List of followers is generated dynamically via AJAX or something like that and we got only small amount of followers using this method.
Is this possible to do that? I've searched for PHP Instagram scrapers, there's 2 really good but I can't find something with that option. I want to do this without registering Instagram client because I need to get that information without credentials of a certain user.
Using the Instagram API, you can only access the followers and following list of a logged in user(using access_token) , you cannot just any users followers, only the account you have access to.
Long time ago it was possible to access any user's followers, as of June 1st 2016, you can only access your followers and following (i.e the user you have login access to)

Get my posts on facebook manage page

I need get ME posts in one of my manage pages, with the new version of facebook sdk.
Example:
I'm manage on Page A, and add a post in my name Adexe Rivera, and in this page there are a lot of posts. So I want to filter only posts by Adexe Rivera.
I know for get posts on pages it's necesary /page/feed, but I need add the filter from user.
I tried with Graph Api Explorer, with this FQL:
SELECT source_id, actor_id, post_id, target_id, message FROM stream WHERE source_id = "PAGE_ID" AND actor_id = "MY_ID"
and get the information that I'm searching.
But I know that since v2.0 FQL not works for sdk, so that I need it's make the same like FQL works in this version of graph
I already tried what documentation said, but not get my posts.
A user access token is required to retrieve posts visible to that person.
Thanks in advance
Filtering is not possible, you can only use the existing endpoints and filter on your own after getting the entries. There are several different endpoints, make sure you are using the correct one. They are all documented very well: https://developers.facebook.com/docs/graph-api/reference/v2.4/page/feed
Also, an App Access Token should be enough to get access to the endpoints if it´s a public post on a non-restricted Page:
An access token is required to view publicly shared posts.
If you don´t know about Access Tokens, read those articles:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Finally, it is not possible to use FQL giving me the expected result, so getting the "from" field in the /PAGEID/feed endpoint, and filtering the results, I get what I wanted.
Thanks for your answers and for their penalties, I have spent several days trying to maximize the performance of the SDK facebook.
Cheers

Monitor retweets with PHP

I have a website Foo.com that creates a tweet for the user #FooWebsite.
Users on the website can retweet it and users directly on Twitter too.
I would like to monitor in real-time (< 10min) the retweets of all the tweets created by #FooWebsite.
For the moment, I think of using a cronjob that requests Twitter every minute to get info (number of retweets) about those tweets as I have their IDs.
Is there no subscription/callbacks like on Facebook API ?
I'm using PHP5.5 on Unix/Apache.
If you want to count Retweets as they happen in real time, the recommended way is to use the Streaming APIs.
In particular, the statuses/filter endpoint and its follow parameter will contain Retweets of any Tweet created by the user.
In order to distinguish these Retweets from the other Tweets streamed by the endpoint, you can rely on the presence of a retweeted_status nested object which will embed the original Tweet, allowing you to identify and focus exclusively on Retweets and count the ones you are interested in.
Please also note a retweet_count attribute value is attached to that node and represents, roughly, the number of times that original Tweet has been retweeted as of some time near when you were streamed the Tweet.

get recent tweets from twitter using API 1.1

I want to get recent tweets from twitter using API 1.1 .
I just don't want to get it only for current user or user's followers. I want to get all the tweets from all the users.
Is there a way by which I can get all user's tweets.
Is there any limit for this type of API call?
I want to fetch all the tweets at the application level, that means I won't be having any user token. How I can do this?
EDIT:
I found that we can use SEARCH API to search recent tweets using this
https://dev.twitter.com/docs/api/1.1/get/search/tweets
But In this API we have to pass the q parameter to search. But what if I don't want search based on specific parameter. I just want all the tweets from last 24 hours.
Is there way where I don't have to pass q in search API?
You want to call
https://stream.twitter.com/1.1/statuses/sample.json
This will allow you to get a random sample of the most recent tweets made by all users.
I am pretty sure there isn't any way to get all the tweets from all users at an application level. What you want to do is have your application store a version of each users tweet in a DB and then query the DB for that information. This approach also doesn't come with any call limits.
You look at a list of the available Twitter API v1.1 calls available in its REST API at:
https://dev.twitter.com/docs/api/1.1
The only application level call is:
GET application/rate_limit_status

Get number of twitter shares by url

I have a question about twitter counting. Everything is so blury about this.
Simply:
I have website with dynamic pages, button for tweet, people go to page, press tweet, it shows on they twitter, count on my page increase. but I need also on my backend to call to twitter and ask them how many shares i have already and count with that.
It is concept for voting. People by sharing to facebook and twitter are voting for the website, so i need to take those votes and count them together. Please dont recommend me scripts like "sharecount" i tried and it has a lot of issues, and its not reliable.
I can get easily likes from facebook but i dont seems to get how to get the number of shares from twitter.
Also if anyone can help me, is there a way to get shares from unique users ? I noticed that if i tweet the site 50 times, the counter is 50. I would like it to count 50 tweets from 1 user as 1.
Thanks for help!
See the private API method http://urls.api.twitter.com/1/urls/count.json?url=

Categories