how to find people via Twitter API? - ruby-on-rails

I'm developing a network that people can add friends to and I want to give them an option to fine their friends via Twitter.
I'm trying to find that feature in the Twitter API.
How can this be done?

here you can find the API for what you're asking:
http://dev.twitter.com/doc/get/friends/ids
as you can see, you have to make an HTTP GET request using this URL:
http://api.twitter.com/version/friends/ids.format ("format" could be xml or json)
you must specify user_id and username to avoid ambiguities.

Related

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

How to integrate TripAdvisor with IOS APP?

In my app i need to integrate it with TripAdvisor API.
i searched a lot about it, i found this in there website:
https://developer-tripadvisor.com/content-api/
it's actually un useful!.
I didn't find any example or demo for this integration!
Anyone knows how to integrate with TripAdvisor in IOS? Or have any example about it?
thanks
Well, just like most APIs, you first have to get your API key from TripAdvisor. So go to the Request API Access form and fill that out (You have to sign up for Trip Advisor first, or sign in with a Facebook or Google account). They will then contact you with your API key and info.
Now that you have the key, the more interesting part takes place. You can use the app in HTTP requests in your app (Example Here) with the URL of the request you want to make. For example, if I wanted to get results for hotels with my coordinates, I would use this URL:
http://api.tripadvisor.com/api/partner/2.0/map/42.33141,-71.099396/hotels?key=<YOUR KEY HERE>
The response would be some JSON code which you can parse with Swift's built-in JSON parser, NSJSONSerialization. With this data, you can now store and make use of what you needed from their API.
To see the full API documentation of all the requests you can do and their details, just visit the TripAdvisor API Documentation.
Hope this helps,
Gabriel

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".

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.

How to download Facebook page posts

I am an iOS developer and I am writing an app which needs to take statuses from my Facebook page and and display them in my app.
Does the Facebook API support that?
If it does, can anyone give a link for some tutorials or explain how can I make this?
I know that API supports an RSS feed but i don't found how to feed my statuses.
If you're using a Facebook page, you can easily use the graph API to query for posts made by that page. For example, for Starbucks:
http://graph.facebook.com/Starbucks/posts
You can simply load this in your browser to see the format the data comes back in, and all that's needed to access this data is a simple HTTP request. You can replace Starbucks with your Page's ID or username to get your Page's posts. These come back in JSON, which should be fairly easy to handle on your end.
Yes, the Facebook Graph API allows you to access your profile and extract any information you'd like from it.

Resources