Parse Twitter Tweets

From iMacros
Jump to: navigation, search

We eat our own dogfood. The following iMacros macro helped us to create the Twitter testimonials page. The macro copies all information of a certain tweet to the clipboard, and then we could simply copy & paste it into our website.

VERSION BUILD=8920312 RECORDER=FX
TAB T=1
'No test dialog
SET !EXTRACT_TEST_POPUP NO
'Extract tweet link  
SET !EXTRACT {{!URLCURRENT}}
'extract profile image link
TAG POS=1 TYPE=IMG ATTR=SRC:https://pbs.twimg.com/profile_images* EXTRACT=HREF
'extract user name
TAG POS=1 TYPE=A ATTR=TXT:@* EXTRACT=TXT
'extract tweet text
TAG POS=1 TYPE=P ATTR=CLASS:ProfileTweet-text<SP>js-tweet-text<SP>u-dir EXTRACT=TXT
'done! - now copy to clipboard
SET !CLIPBOARD {{!EXTRACT}}

The macro in action:

Extract twitter tweet.png

The macro works in the iMacros Browser, Internet Explorer and Firefox!