Can't access twitter profile URL - using STTwitter Wrapper - ios

I'm using the STTwitter wrapper to connect with Twitter and I'm running AppOnly and I'm able to retrieve the tweet text with no problems. I'm using the getStatusesUserTimelineForUserID method for that.
The problem is that I can't access "twitter_profile_url" or "profile_banner_url" but I can access text and tweet time and tweet ID perfectly fine.
I did however manage to get the twitter_profile_url by using the getUsersShowForUserID method.
My question is that am I doing something wrong when trying to access twitter_profile_url with getStatusesUserTimelineForUserID? I looked over Twitter's documents and I think the reason why getUsersShowForUserID works is because of the includeEntities property. I'm not 100% sure on that so I was wondering if someone could clarify that for me?

The endpoint statuses/user_timeline.json returns a list of tweets.
Each of these tweets has a user dictionary, and this dictionary should have keys such as profile_image_url, profile_image_url_https, profile_banner_url, profile_background_image_url or profile_background_image_url_https.
So yes, it should be working, and if not then please open an issue on STTwitter project and post the exact code you're using.

Related

Using Twitter API to embed tweets with URL

I'm trying to embed tweets in my app by passing in a tweets URL. I'm completely inexperienced with APIs and need a bit of guidance to set it up. Twitter has some documentation here and here on how to do it using Oembed. The part I'm unclear on is how to make a request:
"Make a request to the following URL for each Tweet ID, where {tweet_id} represents the value changing in a programmatic loop:"
https://api.twitter.com/1.1/statuses/oembed.{format}
Also unsure on where to add the API keys Twitter gives me. Sorry for the broad question, very new at this.

How should I get all the tweets of an specific hashtag?

I'm trying to develop some code in order to get all the tweets that were generated with certain hashtags, then parse them and finally analyse them. I believe I've already thought and solve the last two parts of this but I'm having some trouble with the first one. I've already read the Twitter Search API documentation but I haven't realised yet how to do this. Can anyone help me?
If you want to retrieve the tweets sent recently, you should use the search/tweets endpoint of twitter' REST API, and mention the hashtag inside q parameter
In case you want to listen to tweets containing the hashtag and receive them in real time, then twitter's streaming API is what you should use (statuses/filter endPoint).
Have a look at the documentation on twitter's website, there's also plenty of information on how to do this all around the web.

How do I get the retweet_count of a given tweet WITHOUT user interaction?

I have a list of tweets that are using a hashtag I made. I'm getting these tweets using the search api. All I want is to get the number of retweets. I DO NOT need to post on their behalf. It seams ridiculous that I would need to have every single user login to my site, login to twitter and approve my application via OAUTH for EVERY TWEET IN MY LIST. There's gotta be a way to get that number without the need for oauth.
I tried getting it directly from the search api, but that's not consistently there. I've tried https://api.twitter.com/1/statuses/show/275729088709283840.json but that doesn't work, for some reason. Is there anyway to do this extremely simple task without going down the asinine road of user-interaction?
You have to create a background-process that uses the stream API. Phirehose is a php library that is set up to do this: https://github.com/fennb/phirehose

Has Twitter removed the unauthenticated user RSS timeline feeds?

I have previously used the following URL to access my tweets and embed them on a website:
http://twitter.com/statuses/user_timeline/my_username.rss
It seems that just this morning though, I'm getting the following error:
Sorry, that page does not exist
Does anyone know what might have happened to this service, and what an alternative might be?
Try http://api.twitter.com/1/statuses/user_timeline.rss?screen_name=USERNAME
It appears that this is a permanent change made by Twitter (see Twitter API's tweet)
Instead they're moving to a versioning system like below:
https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=twitter_username
By changing the user_timeline file extention you're able to receive the feed in different formats, IE:
https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=twitter_username
https://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitter_username

How to automatically post a tweet on twitter

I am working on a site where users can submit data. Is it possible to set up an automated system such that a tweet goes out every time a new data set is received?
I believe it's possible through their own API: http://apiwiki.twitter.com/w/page/22554648/FrontPage
A good place to start is the Twitter API.
Using Abraham's Oauth library in your application and once you have verified/cleaned user import use the variables in an if statement and then call the library and post a tweet. i have a similar set up for adding films i've seen into a database and it tweets a rating everytime.
I can provide coding example (PHP) later if you need further help.

Resources