No results for a specific user in Twitter search API - api

For some reason, when searching on one specific Twitter user, the search API return nothing. (ie http://search.twitter.com/search.atom?q=+from%3ATWITTERHANDLE_A) TWITTERHANDLE_A here is the Twitter account name. This user has been active for over a month, has had many RTs, #s and has sent such tweets out as well.
Meanwhile, I created a new Twitter account - we will call it TWITTERHANDLE_B. Immediately after I created the account, I sent 1 tweet and performed the same search as above (http://search.twitter.com/search.atom?q=+from%3ATWITTERHANDLE_B)
The tweet was returned.
Is there ANYWAY to find out if and/or why a particular user would be blocked from search results? Thanks so much for any help... I'm going crazy here. Twitter's documentation just says sometimes a user's tweets won't be searched!

The documentation you refer to has a link to this page:
http://support.twitter.com/forums/10713/entries/42646
The bottom entry addresses your issue, hopefully you can fix it that way.
Bear in mind the search API only grabs results from the last couple of weeks, so if the user hasn't tweeted in a while then there won't be any results.

You could try not using the Search API and grab the results directly:
http://twitter.com/statuses/user_timeline/-username-.json
Works fine for http requests at least... >_<

Related

Twitter API - Recognize Threads

I am trying to understand if there is an option to find out through the API if a tweet is a thread or not, it doesn't matter which API, search for tweets, get tweets, get bookmarks, any of them.
After searching through the API for hours all I see is there is a conversation ID but without getting for each tweet all the replies there is no way to know if it's a thread or not. I also tried to use edit_controls but that also led me no where.
Did someone find a way? Am I missing something? I noticed some people were able to do it so I am guessing it's possible.
Thanks.
Unfortunately, such a feature is not available at the moment and you have a dilemma, the first way is to get the last tweet of a string of tweets using API, which will chain to the main tweet, like the following output (lines 24 to 28):
But the second way is to check the comments of a tweet, and if the user-id of the commenting user is the author of the tweet, it means that you can use this code to receive the comments of a tweet:
for tweet in tweepy.Cursor(
api.search_tweets,
q="to:ZarchiMohammad",
result_type="recent").items(200):
if hasattr(tweet, "in_reply_to_status_id_str"):
if tweet.in_reply_to_status_id_str == tweet_id:
print(f"https://twitter.com/{tweet.user.screen_name}/status/{tweet.id}")

DISQUS: Is it possible to get a particular user's posts in a given forum?

I am running a website, whose community is powered by Disqus. I would like to create user profile pages, where the page would display the particular user's most recent activity, but only for my particular site (forum, in Disqus' terminology).
I ran through the entire API documentation, but I could not find a way that would allow me to filter by both user, and forum. I would be able to grab either the entire list of posts for a given forum, or the one from a particular user.
In every API call, there is a mysterious query paramater, where I tried to plug a series of filters, but none of them worked.
Is there something that I could be missing?
It's not that obvious, but you can use the query param as a filter for users. Try something like this:
https://disqus.com/api/3.0/forums/listPosts.json?forum={SHORTNAME}&query=user:{USERNAME}&api_key={YOUR_API_KEY}

How to find the LIST_ID of user created list on Foursquare

If you look on this page https://foursquare.com/griekenlandnet you will see there are 55 tips in total, but there are also some user created lists. I can get everything at once through the api explorer on the foursquare site, but I would also like to be able to just get the content for 1 specific list.
According the docs at https://developer.foursquare.com/docs/lists/lists you can request them through this foursquare domain v2/lists/LIST_ID, the problem is that I can't find a way to get the LIST_ID.
Any tips on how to find the list_id? I can get the user_id, but not sure how that helps to get the list_id?
(I would have loved to include more urls, but not allowed to)
Once you have the userId, you can find the user's lists (and their IDs) via /users/USER_ID/lists
the matter is that you need to be authenticated to get results from /users/USER_ID/lists...

Twitter Equivalent to Facebook Comments?

My site needs the Twitter equivalent of the Facebook Comments plugin... You may be aware of the fact that Twitter only searches back about a week, so comments would be lost just a few days after being made! Is there a service that would allow me to show the tweets that contain the given page's unique #hashtag? I'm looking to put together a system that searches for the hashtag and puts those tweets up for display, even if the tweets are old. Does anyone know how to make this possible? I'm not that good of a programmer, FYI...
No. The Twitter Search API will not let you search that far back.
The Search API is not complete index of all Tweets, but instead an index of recent Tweets. At the moment that index includes between 6-9 days of Tweets.
You cannot use the Search API to find Tweets older than about a week.
From https://dev.twitter.com/docs/using-search

Get A Users Over All Retweet and Mention Counts using Twitter API

We are working on some analytics using the amount a user is retweeted or mentioned... I can't seem to find a way to get these numbers using the apis does anyone have any ideas?
https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name={screen_name}&count={count}
it's important to include the line include_entities=true to the request. This will give you an expanded response including re-tweet and mention counts.
Get Status / User Timeline
Twitter API Console
Update:
to get tweets from the last 90 days, there is a Node.js library you can use called Snapbird
https://github.com/remy/snapbird
.. and here is another resource covering the same topic.
http://blog.tweetsmarter.com/twitter-search/10-ways-and-20-features-for-searching-old-tweets/