3

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.

Michael Stern
  • 4,695
  • 1
  • 21
  • 37

1 Answers1

3

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

enter image description here

dsingh
  • 669
  • 4
  • 9
  • 1
    How did you find this? – Michael Stern Apr 13 '16 at 16:06
  • Also, any way to have it show when each tweet was posted? – Michael Stern Apr 13 '16 at 16:11
  • 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) – Michael Stern Apr 13 '16 at 16:21
  • Not sure about language but the plan is to document this feature in next version. – dsingh Apr 13 '16 at 16:34
  • 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. – hYPotenuser Sep 11 '16 at 20:13
  • Afaik SinceID was never supported for TweetSearch, even if it is undocumented. Can you give me an example where it used to work and now it has stopped working? – dsingh Sep 11 '16 at 23:48