I'm trying to build Disqus API request to find unanswered comments from users (with time frame, for example - last 5 days).
So, response should be a posts/list with time frame (since). Question is how can I put to this request two other conditions:
- post author is not a moderator
- post doesn't have answer (reply)
I would be very grateful for help
Related
While designing a new API I have come across this design issue.
When I have related resources how do I display that in the original resource?
Eg lets say i have a blog with a post resource and a comment resource. When fetching posts right now i would have to query the comment resource for a count for each post.
Is there a good RESTful way of displaying comment count in the post resource response?
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}")
I know I can get all the posts in a group using the Graph API endpoint /group-id/feed. And I know I can get all the comments of a single post too. But I want to know if it's possible to get the comments of each posts in a group in a single request.
Ideally, I would want something like "get the latest 10 posts of a group with their comments" in a single request.
Couldn't find anything in the docs so it's probably not possible.
you can use the fields parameter
/group-id/feed?fields=message,comments
in this way you are able to retrieve the message of the post and all the comments related to it
i'm wanting to run a contest on Instagram where the user enters by leaving a comment - how would I go about getting past the 150 api limit?
Any paid solutions out there? Anyway I can get the comments and add them to a spreadsheet in real time?
Thanks
The Instagram comments endpoint (https://api.instagram.com/v1/media/{media-id}}/comments?access_token=ACCESS-TOKEN) will only return you the most recent comments, so I would recommend setting up a cron job to request the comments for the media you are using. Every minute would probably be sufficient, but you can go faster if you think more than 150 comments will get added every minute. Since they return you the most recent comments with each request, you can cache everything if you start making requests as soon as your photo posts.
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... >_<