Display twitter feed of arbitrary user - ruby-on-rails

I am working on a project now where I am trying to display twitter widgets. I have the twitter names for the users, and would like to display their tweets. I am able to display it with my own css etc., but not as a twitter widget.
Is it at all possible to make an actual twitter widget for an arbitrary user, or do we need to manually make a new widget in twitter for every user we want? I have been pulling my hair for hours or even days now, but have not been able to figure this out.
I am using Rails and the twitter gem.
If I had #twitterapi as a twitter name in my database I would like to be able to display a widget that looks like this, without having to manually make one in my twitter account.
Is this possible? Should I go with faking the styling and make it from the twitter data I have? Anyone have any good tips?

Check out the Twitter's gem API here: http://sferik.github.io/twitter/
In short, it is possible. You would just have to include Twitter in your app and then call:
Twitter.user_timeline("username")
Just beware that Twitter limits the amount of anonymous requests. So, it would be better if you set up your Twitter dev account and get your credentials.
Source: Display a Twitter feed from a Rails app

http://railscasts.com/episodes/359-twitter-integration?view=asciicast
It's outdated but you can use it as a reference.

Related

Use Twitter API to display users Tweets

Question, I haven't worked with API's too much but I'm building an app and I was curious to know if this idea would be possible. Would it be possible for a user to sign up on my site and pull that user's tweet's as a way to display the tweet on my website? Thanks in Advance.

Search any twitter users feed

Its been a while since i last used the twitter api, Using Javscript, I would like to be able to search any random twitter users feed.
On the page I would enter there Twitter username and the app would go and find the users data returned as JSON.
I'm not after the code, I would just like to know what is the best API to use for this?
Do I just need the REST API, I assume this:
https://dev.twitter.com/rest/public/search
Also, authentication do I need to authenticate my app? how should I do that if its needed?
thanks.
If you want all of my tweets (#edent) you will need to use the User Timeline API
For example:
https://dev.twitter.com/rest/reference/get/statuses/user_timeline?screen_name=edent
Yes, you will need your app to be authenticated. You will need to use OAuth

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.

iOS upgrade to twitter api 1.1

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.

Using oAuth to retrieve tweets of a particular ID (equivalent to a page in facebook)

I need to know as to how to implement oAuth in an iphone application.
I have already gone through lot many posts but none of them shows as to How to retrieve tweets from a user profile (like we access facebook wallposts). I tried using an example named bengottlieb/Twitter-OAuth-iPhone but all it does is show the Login prompt and posts a sample Twit at my Twitter profile.
I need to make an application where
the user can view twits for a particular page (same as accessing the wall post for a Page)
Post tweets that will appear on his profile or if possible then also at the profile page for given ID
I was able to fetch the tweets for a particular id using http://search.twitter.com/search.json?ID but may be due to closing of Basic authentication it does not return to me tweets older than a specific time period.
The Twitter search API is not meant to retrieve the tweets from one particular user, even though it does seem to work (up to a certain point back in time). As far as I know the search API does not need authentication, so you're not in trouble regarding the deprecation of Basic authentication there.
To retrieve the tweets for a user, you need to retrieve their timeline. Be sure to use OAuth authentication, as indeed Basic authentication no longer works now.
Check out http://dev.twitter.com/ for more information. The API is documented quite well. You mention basic authentication, so perhaps you could start with http://dev.twitter.com/pages/basic_to_oauth to get you going?

Resources