3
$\begingroup$

Years ago there was discussion on StackExchange of how to access various parts of the Twitter API via Mathematica. The proposed solutions seem to be obsolete, given changes in the API and/or Mathematica itself. Anyway, I get nothing but reams of errors when I try them. I would like to access the Twitter search API (https://dev.twitter.com/rest/public/search). Has anybody had any success reaching it from Mathematica 10?

The social media functions in Mathematica 10 make it easy to search for users with a specified string in their usernames

samplesearch = 
  ServiceExecute[twitter, "SearchNetwork", "q" -> "puppy"];
vertices = VertexList[samplesearch];
Map[ServiceExecute[twitter, "UserData", "UserID" -> #] &, vertices]

But I see no similar way to search for specified text in Tweets.

$\endgroup$

1 Answer 1

3
$\begingroup$

You can do tweet search using "TweetSearch" command(though it is not documented)

enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ How did you find this? $\endgroup$ Apr 13, 2016 at 16:06
  • $\begingroup$ Also, any way to have it show when each tweet was posted? $\endgroup$ Apr 13, 2016 at 16:11
  • $\begingroup$ And another question (sorry, I would have combined these but Stackexchange won't let me) -- Is there any way to restrict responses to a specified language? ("Language"-> and "language"-> don't seem to work) $\endgroup$ Apr 13, 2016 at 16:21
  • $\begingroup$ Not sure about language but the plan is to document this feature in next version. $\endgroup$
    – dsingh
    Apr 13, 2016 at 16:34
  • $\begingroup$ TweetSearch is finally documented in v11, but it's missing some of the old possible query parameters (e.g. SinceID). This change broke an old program and it's a headache to fix. Such is the life of the undocumented-function-user. $\endgroup$ Sep 11, 2016 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.