Subscribe Bookmark RSS Feed

JMP/SAS Programmers: Can JMP Access Twitter's API?

mcstagger

Community Trekker

Joined:

Oct 6, 2014

Hello All!

I am curious if any experienced JMP/SAS scripters/programmers have any experience using JMP or SAS to access Twitter's API to look for and download Tweets around particular topics on particular dates and in certain countries?

If so, can you point me to your information resource, assuming you are able to share?

We've found an R solution but would love to consolidate this to JMP if possible.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

It was a fun project.  This post has the JSL and other information to stream live tweets into a data table.  Which is not the same as looking up historical data.

7 things to know about Twitter

Craige
5 REPLIES
Craige_Hales

Staff

Joined:

Mar 21, 2013

The twitter API docs suggest you'll have to be authenticated (password, etc) and using https, not http.  You'll need something other than the JSL sockets.  Here are two sites I found for curl-based and python-based twitter api access:

How to access Twitter REST API v1.1 using curl? - Stack Overflow

python-twitter - A python wrapper around the Twitter API - Google Project Hosting

I can't tell you anything about them, but, if they work, you should be able to drive them from JMP using the RunProgram function.  RunProgram is designed to run an external command-line program, such as curl or the python interpreter.  RunProgram allows reading from and writing to the external program's stdin and stdout via JSL callback functions.  See the scripting index for RunProgram examples.  Curl and python have to be downloaded...they are not built in to windows.

Sounds like a fun project.

Craige
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

It was a fun project.  This post has the JSL and other information to stream live tweets into a data table.  Which is not the same as looking up historical data.

7 things to know about Twitter

Craige
mcstagger

Community Trekker

Joined:

Oct 6, 2014

Craige, thanks for posting this; I will definitely be checking this out.

uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

@Craige_Hales : 
   If I do have an API for which I have the token , can I use JSL Sockets to stream data from the API ? If yes, can you post some sample code ? Let us say using google finance / yahoo finance as an example . 

 

Best
Uday
Craige_Hales

Staff

Joined:

Mar 21, 2013

JSL Sockets work with http:// but not https://

Chances are you'll need the SSL support which is why I used the curl program.

But if you don't need the SSL support, sockets can create a streaming connection.

JMP 13 has a much improved examples for Listen and Connect in the scripting index for the socket object.

The Listen example makes JMP serve a web page to your browser. The Connect example is perhaps what you are looking for; it shows how to stream a resource from a remote server into JMP.

 

Craige