I want to fetch only the post and display it as my requirement? How to do it using twitter api.? Any help is accepted.Please provide code the documentation is not upto mark.
As per the documentation:
To retrieve a user's posts, you need to make a call to
https://api.twitter.com/1.1/statuses/user_timeline.json
If you only want the latest post, you need to add count=1
So, to get the latest post from my account, use
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=edent&count=1
You will need to sign the request with OAuth.
Related
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
Can any one explain how to send a Twitter request to get the latest tweets for a hashtag using Twitter API V1.1 using OAuth settings ? I have searched for documentation in Twitter site, but I am incomplete.
Can any one give the sample request & response through RestClient or Advanced Rest Client ?
Thanks in advance.
You have multiple questions here, so I'll answer them one by one.
The search/tweets method
You can search tweets using this method in the 1.1 API. According to those docs, you can pass a q parameter which is "a UTF-8 encoded query of 1000 characters maximum".
The query for your specific requirements
Scroll down on this page and you'll see that you can search for a specific hashtag using #hashtag. Yes, that's it.
How can I make V1.1 requests using OAuth?
Follow the detailed step-by-step post here, using this library to make authenticated requests.
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.
I'm having trouble pulling tweets onto my site. I just want to put my latest tweets on there so don't think I need a token but am not sure.
No, you don't need OAuth - check out Twitter's documentation for putting a widget on your site.
No, you can just fetch it by querying the twitter API. For example to fetch all tweets from Twitter support, visit http://api.twitter.com/1/statuses/user_timeline.json?screen_name=support
For more details, see the documentation
You can also pull the data in via RSS. Click the "RSS" link from your browser to get the URL, it's your numeric twitter id which is not posted elsewhere.
For statuses/mentions, I need to authenticate as a user. I want to see the user's mentions without asking him/her to authenticate. If the tweets are public, what are the mentions not public ?
I'm writing to do this
Check the Twitter search API
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
To find all user mentions: just use #username as search term.
I would like to add that Twitter's Search API returns only tweets from past 7 days. So if you want to retrieve ALL tweets mentioning an arbitrary user, you can't.If anyone finds a way to do this, please mention.
There is no way to get a user's mentions using the statuses/mentions endpoint because this is possible using the search api.
http://dev.twitter.com/doc/get/search