Twython : cursor on statuses/get_user_timeline returns my tweets instead of screen_name passed - twython

I started using Twython recently and was impressed by the simplicity. Thanks for the developing and maintaining the library.
However, when I tried running a cursor on get_user_timeline() endpoint, I got my timeline instead of the user specified in the 'screen_name' parameter. I ran the following with App auth.
twitter = Twython(APP_KEY, access_token=self.ACCESS_TOKEN)
tweets = twitter.request("https://api.twitter.com/1.1/statuses/user_timeline.json", "GET", {'screen_name': '<some screen name>'})
that worked just fine for 20 tweets or 1 page worth of tweets.
I am wondering then why my below stated code did not work?
twitter = Twython(APP_KEY, access_token=self.ACCESS_TOKEN)
tweets = twitter.cursor(twitter.get_user_timeline, {"screen_name":"narendramodi"})
Am I using the cursor wrong? If so what would be an ideal way of using the endpoint in question.
Thanks for your answers in advance!
Thanks and Regards,
Atul.

This problem of getting the tweets from the authenticated user happened to me before. The reason was that I was giving as argument an non-existent user. Make sure you don't confuse the name with the screen-name.

Related

Is fb graph user search api not working anymore?

https://graph.facebook.com/search?q=sharma&fields=name&type=user&access_token=
I was this URL along with access token and it was giving me user name list that i was using in my project. Only names are my requirement but when today i started to use it i am not getting any data nor any error.
Its only returning this
{
"data": [
]
}
Recently a month ago it was working for me.
Can anyone tell me if they have the same issue or if something has changed?
Is there any other was of getting users name mainly first + last name from fb?
I have found answer of my question which is Fb is no more giving user results for graph search api.
https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#search-4-4
Search API
You can no longer use the /search endpoint with the following object types:
event
group
page
user
I dont know whether its a permanent revoke or temporary but it has something to do with Cambridge analytica data leak issue
https://www.google.co.in/search?biw=1360&bih=662&tbm=nws&ei=-iTXWrrkCYrxvgTTy5GgCw&q=cambridge+analytica+data+leak&oq=cambridge+analytica+data+leak
I hope it will help others to find out why their API is not working anymore.

Using Zend_Service_Twitter to fetch last tweets from a user without using OAuth?

As far as I know Twitter API is supposed to be available with smaller limit rate without API key and without being connected through OAuth.
Is there anyway to use that simply through Zend_Service_Twitter ? Or will I end parsing some kind of feed like that : https://twitter.com/statuses/user_timeline/12345.json?callback=twitterCallback2&count=1
Other question same answer :
$twitter_search = new Zend_Service_Twitter_Search('json');
$response = $twitter_search->search('from:twitter_handle');
print_r($response);die;

How I can Unlike Comments on the Rss Feed using Graph API.?

Hello Guys I am working on WPF app and I want to Unlike the Comments what I have been like so I am using like this.
Facebook.FacebookClient api = new FacebookClient(ExpandingNewsFeedList[0].AccessToken);
api.Delete(ID);
But it will give me error like this
.(OAuthException) (#100) Can only call this method on valid test users for your app.
so how I Can overcome this problem.?
Thank you.!!
To unlike, do an HTTP DELETE to the /objectid/likes.
Using C#, it's like this
facebookClient.Delete("/" + objectId + "/likes");
You can't delete content using an app except for some types of content which your App added (e.g. an app can delete its own posts)

/act_{account-id}/adcreatives creative_ids parameter is not working in the Facebook Ads Graph API

I have an application that uses the Facebook Ads OLD REST API and recently I heard that it will be deprecated in a month, so I'm working hard to migrate all my code to the new Graph API...
Unfortunately, nothing goes smoothly.
when calling to GET /act_{account-id}/adcreatives to get the AdCreatives for a specific campaign the parameter creative_ids is not working and always retrieving all the creative for the account!
This was working fine in the rest api... and no documentation changes were made in ads.getCreatives so I'm assuming creative_ids paramter is still there...
Any help will be appreciated!
thanks,
Yaniv Hakim
I found the _ids parameters to be finicky so I use the generic ids=comma-separated list parameter, without the act_{account-id}. Creative IDS are unique across accounts so there's no need to specify the account-id. If you want to use the specific parameters, have you tried creative_id, creativeids, creativeid and other permutations you can think of (with and without account-id)?

CakePHP and Facebook Plugin: read user checkins

I am using CakePHP and Nick Baker's Facebook Plugin, and I am trying to retrieve a certain user's checkins. The problem is that I have quite no idea on how to do this. There is nothing related to checkins in the plugin's documentation. All I have is the api() method which I don't know how to use.
I have this so far:
App::import('Lib', 'Facebook.FB');
$FB = new FB();
$this->set('checkins', $FB->api('https://graph.facebook.com/'.$this->Connect->user('id').'/checkins'));
but the checkins variable contains only this:
Array
(
[id] => https://graph.facebook.com/1000005215732xx/checkins
)
But have no idea on how to continue. Also, after I retrieve the checkins, I would like to search whether a user has checked in in a specified place.
I will be glad for any help you can give! Thank you!
The api() method only takes a URL relative to the API endpoint, so you should be calling:
$result = $FB->api('/<uid>/checkins');
Also, make sure you have the proper permissions, especially user_checkins.