2
$\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$
3
$\begingroup$

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

enter image description here

$\endgroup$
  • 1
    $\begingroup$ How did you find this? $\endgroup$ – Michael Stern Apr 13 '16 at 16:06
  • $\begingroup$ Also, any way to have it show when each tweet was posted? $\endgroup$ – Michael Stern Apr 13 '16 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$ – Michael Stern Apr 13 '16 at 16:21
  • $\begingroup$ Not sure about language but the plan is to document this feature in next version. $\endgroup$ – dsingh Apr 13 '16 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$ – hYPotenuser Sep 11 '16 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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