DATA Step, Macro, Functions and more

Macro to Scrap Twitter - SAS Macro to read JSON formatted tweets

Reply
Occasional Contributor
Posts: 10

Macro to Scrap Twitter - SAS Macro to read JSON formatted tweets

I have a macro to scrap tweets on Twitter and return details of the tweet in columns.  The macro is using PROC HTTP.  When i run the macro i get the following error messages:

 

ERROR: Host name resolution failed

ERROR: Host name resolution failed

 

Does this mean i am failing to access the Twitter page through their API?

 

Does SAS University Edition able to write and read JSON files?

 

Regards.

Super User
Super User
Posts: 7,401

Re: Macro to Scrap Twitter - SAS Macro to read JSON formatted tweets

You would need to provide some code, how are you connecting, are you providing correct login details etc.  Proc http requires correct signin details, and connection.  You might want to set it up in conjunction with your IT group, and make sure passwords and such like are encrypted.

 

SAS UE is principally a learning edition, it doesn't have full functionality either, and as its installed on Linu image rather than your local machine this could also be a problem.

 

As for Json, there is no out of the box reader as far as I am aware.  However, it is plain text, so should be pretty easy to read in and parse, however as you are using a learning edition of SAS it sounds like your learning, so maybe not the best task to start with.

 

And the phrase is "scrape" the data, although I would quite happily scrap social media!

Occasional Contributor
Posts: 10

Re: MacSAS Macro to read JSON formatted tweets

Thank you very much for your response, most appreciated.

 

Please find attached the macro.

 

Regards.

Attachment
Occasional Contributor
Posts: 10

SAS Macro to read JSON formatted tweets

Further to my last post, i managed to find a solution with a simple code in R.  Once again thank you very much for your input

Ask a Question
Discussion stats
  • 3 replies
  • 262 views
  • 0 likes
  • 2 in conversation