Reading tweets from twitter via SAS

0

So you want to grab tweets from twitter? There are several other blog posts to assist, including the SAS blog reference below.

Grab the status of one twitter account (changing USERNAME to the twitter handle) via: http://twitter.com/statuses/user_timeline.xml?screen_name=&USERNAME&count;=3200

Then to help folks get jumpstarted, use the XMLMAP that I created below for the SAS Libname Engine.

<?xml version="1.0" ?>
<SXLEMAP version="1.2">
<TABLE name="STATUS">
<TABLE-PATH syntax="XPATH">
/statuses/status
</TABLE-PATH>
<COLUMN name="created_at" retain="YES">
<PATH>/statuses/status/created_at</PATH>
<TYPE>character</TYPE>
<DATATYPE>STRING</DATATYPE>
<LENGTH>30</LENGTH>
</COLUMN>
<COLUMN name="text" retain="YES">
<PATH>/statuses/status/text</PATH>
<TYPE>character</TYPE>
<DATATYPE>STRING</DATATYPE>
<LENGTH>140</LENGTH>
</COLUMN>
<COLUMN name="twitter" retain="YES">
<PATH>/statuses/status/user/screen_name</PATH>
<TYPE>character</TYPE>
<DATATYPE>STRING</DATATYPE>
<LENGTH>15</LENGTH>
</COLUMN>
<COLUMN name="image" retain="YES">
<PATH>/statuses/status/user/profile_image_url</PATH>
<TYPE>character</TYPE>
<DATATYPE>STRING</DATATYPE>
<LENGTH>120</LENGTH>
</COLUMN>
</TABLE>
</SXLEMAP>
Reference - Using SAS to Call Twitter:  https://blogs.sas.com/supportnews/index.php?/archives/72-Using-SAS-to-call-Twitter.html

Share

About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Comments are closed.

Back to Top