Twitter API: Search keywords/hastags from users timeline - twitter

I want to use one of the twitter REST api feeds to search a keyword or hastag from their timeline.
Currently using
<script type="text/javascript" src="https://api.twitter.com/1/statuses/user_timeline/users_username.json?callback=twitterCallback2&count=4&q=keywordhere"></script>
This gets the 4 recent tweets, I added the q= to try filter keywords but it doesn't look like it supports that parameter.
Anyone know of a api call that can search a timeline AND hashtag?

Related

How to embed a Twitter Timeline filtered by a hash tag

I am trying to create a twitter timeline which includes tweets related to a specific hashtag.
Then I need to embed it to a website.
I tried https://tweetdeck.twitter.com/ but it informs me to go https://publish.twitter.com/
But it doesn't provide support to do the embed.
How can I proceed?
There's no support for embedded search timelines any more (as of July 2018). You'll need to build something that searches the API for the Tweets you want to include, and then use the oembed API to display the Tweets in your webpage.

Is there a 'filter:hashtags' in the Twitter Stream API?

I'd like to only retrieve tweets that contain any hashtag in the Twitter Stream API. In the Search API, this can be done using 'filter:hashtags'.
I am using the locations filter and would like to also get tweets that contain the '#' character. Currently I get all tweets and I'd like to filter out the ones that do not contain a '#'. The 'term=#' doesn't seem to work.
Found this stale thread on the twitter dev forums https://dev.twitter.com/discussions/18787.
At this point I'm assuming it can't be done through the Stream API.
No, there isn't such a feature in the Streaming API.
You can refer to the documentation for a complete list of the available request parameters.

How do you get the next page of twitter results using the Twitter OAuth API?

I am using the twitter oath API and I get the first page of results for my search query. But I want to get all pages, so how do I iterate using the API to get the next page?
Twitter has been removing support for pagination from their API, in favor of query params that specify search bounds. Here's the relevant snippet from their blog:
"All methods currently supporting cursoring or usage of since_id and max_id will remove support for "classic" pagination through the "page" parameters. See Working with Timelines for more information."
Source: https://dev.twitter.com/blog/api-housekeeping

how to find out when a link was first tweeted

http://isitold.com/ somehow determines when a link/url was first tweeted. I can't seem to figure out how to do this with the twitter api, does anybody know?
I'd like to use when a link was first tweeted in a time decay function in my app.
You can search tweets with this link using the Twitter Search API to retrieve the oldest tweet possible.
Seems like twitter does not provide historical tweets (search api will not work).
You can get access to historical tweet information with a service like Topsy http://www.topsy.com http://code.google.com/p/otterapi/ (api on topsy).
I have written Who Tweeted It First using YQL and JS to find the oldest tweet for any topic. It is essentially scraping data from the Twitter search page as the official API doesn't return the previous tweets.

why do i only see one tweet in the search from API Query?

I'm using the following query:
https://twitter.com/search.json?callback=?&q=from:_adeel&count=5&include_entities=true&include_rts=true
and I would like to see the last 5 tweets from this user. You can see that the user has many more than 2 tweets yet the query only returns 2 tweets. I'm following the twitter search API and I fail to see what I'm doing wrong. I prefer to use the twitter search API because I want to perform the search on the client side without authentication and rate limits.
Do you see what I am doing wrong?
As indicated here in the documentation, the search API is an index of recent tweets, between 6-9 days old. It looks like the other tweets from the user you linked to are just outside this window.
So to summarize - you are not doing anything wrong. This is simply a limitation of the Twitter API.

Resources