iOS upgrade to twitter api 1.1 - ios

I currently have a bunch of apps that go and make simple anonymous calls to the twitter API, and grab several differing timelines. Obviously, twitter is changing things up with 1.1, and is demanding authenticated calls using oauth. Does that mean each of my users need a token (their own account) to do call, or do I need one app token for all of them? Should I be using the twitter api included with iOS 5? Note: These are not the user's timeline...just several news feeds on twitter. Am a bit confused. Any pointers would be appreciated.

This is a good question, I struggled with this myself.
You can use Twitter API client via PHP and then json_encode the user timeline you want and parse it. This is not the best practice, but is a work around I had to do for an app on which I wanted to only display tweets no other action was need, like getting links, retweets, etc.
hope this serves.

Related

Display a tweet one at a time?

Most plugins I see says I can't use their service anymore because Twitter changed their unauthenticated API. Can someone guide me on how to get around it? We already have an embedded twitter feed, but we wanted the tweets to display one at a time, instead of the box being filled up (with a scrollbar)
Any references or guidance will be much appreciated. Thanks.
Twitter have introduced a system of "Application-only authentication" based on OAuth 2. You can use it to authenticate your app for API endpoints which do not require user related informations (basically the former endpoints which do not require authentication). With this "Application-only authentication" you should be able to use the methods that plugins do not handle any longer (likely because they did not code this feature). For further informations, have a look at the corresponding page on Twitter Developers.
The rest of your question is just about using the Twitter API endpoints. The available endpoints you can use (i.e. the ones that Twitter Inc. does not keep for itself only) are listed here.

IOS twitter feed tutorial

I am currently building an app where they require all their users to be able to view their feeds only.
I looked at a lot of tutorials online which talk about the new api v1.1 of twitter and now authentication is required at all times.
I see a lot of examples and even successfully followed several of them like
http://www.appcoda.com/ios-programming-101-integrate-twitter-and-facebook-sharing-in-ios-6/
I even saw a tutorial posted on the twitter dev page.Following all of these focused on a few key elements
Using ACAccount to retrieve the account settings of the current user
Using the SLRequest to encapsulate the HTTP request made to the twitter api
Retrieving the data in JSON format, parsing it and presenting it to the user
Well my question is, I do not want user specific feeds. It's like a company updates their twitter regularly, users using the app should get feeds regarding the company. So I was wondering if there was a way, the app provides some default or hard coded authentication information ?
Is there some sort of tutorial, library or anything out there to help me move in the correct direction ?
Thank You for your time and help.
Your going to want to implement the following API call to get that information:
https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline
Once your application is authorized you can make a call to,
https://dev.twitter.com/docs/api/1.1/get/statuses/MorleyGaelsGAA.json
That should give you the information you're looking for.

Twitter iOS image search by hashtag

I need to search images from a certain hashtag in twitter to my iOS 6 app. I am trying to code a query that retrieves a minimal size possible response.
So, I tried to use Twitpic, but the response is not good. it's outdated and incomplete. So, I went to the Twitter 1.0 API. The 1.1 is not good because it require user account in Twitter and a lot of my users don´t have it.
http://search.twitter.com/search.json?q=%23hashtag%20pic.twitter.com&rpp=100&include_entities=true&result_type=recent
Does have a better way to query images from twitter api? I only need the image urls, not the entire entities.
As Twitter and Instagram respond a big JSON, I decided to implement the logic in a server using PHP. My client send the hashtag and the server retrieve the image´s urls and send them this parameters and the next "page_id" from twitter and facebook.
It made the operation faster and more future friendly to my apps, besides avoid some "bad images".

Twitter Application using php?

I need to develope a Twitter application in php,
Requirements are that that my application should get access token from user and then using that access token, my application should be able to get backup of the twitter user tweets, followers list, timeline, messages etc.
I created an application on twitter and got the consumer key and secret.
Please tell me how i start now, and what is the best php library that will be enough for my requirements.
Thanks
The best place to start is http://dev.twitter.com
If you want to really jump into things, check out the listing of PHP libraries that you can use: http://dev.twitter.com/pages/libraries#php
Edit: I also suggest you read everything under Guidelines and Terms, Authentication, and REST API & General on this page: http://dev.twitter.com/doc

Twitter feed on corporate site

I have a corporate website that I want to pull in tweets to, but i'm getting a rate limit using the http feed. So, I want to use an authenticated method to get the tweets.
Do I really have to register an application to do this, even though it's not really an application and my users will never be entering or changing the twitter account info.
Also, my corporate site doesn't have a public address, and registering an application through twitter appears to require a public url. So how can I get around this? Do I have to create a "fake" application with a public url, just to generate my keys?
Thanks for any help on this.
If your site is behind a proxy server along with all your users, using Javascript/jQuery won't help. All the requests will still be coming from the same IP and will hit a rate limit, as you're doing now.
The other issue is that you don't need to register an app to request a feed. Apps are only needed for Oauth, and getting a feed doesn't need that.
The best way to deal with this is to get the feed with a server script, store it on the server, and then deliver the server copy to the web pages. If you request the feed less than 150 times per hour, you won't have a limit problem.
If you want more than a single feed, you can use the streaming API to get all the tweets for up to 400 keywords or from up to 5,000 users. This still doesn't need a registered app, since the streaming API still allows Basic Auth.
Just wanted to post this for future reference and in case anyone else has the same question. The solution to my problem, was to register an application on twitter. But since I'm just using a single user, you don't have to do the regular OAuth steps of generating a request for a key, getting the response etc. Every app you register in twitter get's its own "Access Token" that you can use to retrieve tweets etc. So, this is what I ended up doing to solve the problem I was having.
Additional details: My main concern was having to do the OAuth steps of requesting an access code etc... Since my application is only a single user implementaion (just pulling in our company related tweets from company held twitter accounts), it just seemed unneccesary to have to do all of that. But what I found was that when you register an app on twitter, you get a private access token for each app. You can view a little information about that here: https://dev.twitter.com/pages/oauth_single_token.
It sounds like you are pulling the feed down over http on the server? You could just limit the updates so you don't hit the rate limit.
I would recommend instead doing this on the client side. There are a lot of very easy to use embeddable java script twitter clients out there. The rate limiting problem would dissapear as the feed would be coming from the desktop and not the server (unless they just kept refreshing it).
The Twitter developer wiki lists a few.
JQuery plugin for Twitter
Tweet (another JQuery plugin)

Resources