Search code examples
twittertweets

collecting random twitter conversations with criteria


I need to collect "sets" of tweets, i.e., twitter conversations for my research;

The sets also need to satisfy the criteria of

  • the number of tweets in it, and
  • the number of participants in it.

I've looked at Twitter Streaming API, twitter-stream gem, but I found none of them fitting for my purpose.

Is there any easy way to achieve this goal?


Solution

  • What's your starting point? How will you tell if a tweet matches your criteria?

    Once you've done that, it's fairly simple.

    • Get the tweet that is the starting point for the conversation.
    • Search for replies to that tweet.
      • Twitter won't let you search "in_reply_to" but you can search for everyone mentioning "@user" and filter by "in_reply_to"
    • Repeat recursively.

    You'll end up with a tree with the starting tweet as the root node. You should be able to traverse the tree to see how many unique users there are and how many tweets there are.