Monday, November 10, 2008

iMacro script to swap between Flickr albums

The following handy iMacro script logs you from one Flickr account to another. I currently have six of these, one for each separate free Flickr album/account I have on the go (there's a maximum of 200 photos you can share for free in each account). All you have to do is install the iMacro plugin into your browser and save the following script not forgetting to add your login and password in the "User set variables" section.

Obviously if Flickr change their main site layout then this may break the script and it would have to be tweaked.

Script Starts

' Last Edit: 13 Nov 2008

' User set variables
' !VAR1 = your login ID, !VAR2 = your password

SET !VAR1 yourlogin@yahoo.com
SET !VAR2 password

' This script is intended to toggle you out of your
' current Flickr account and into one set by the
' variables above so you can easily swap between
' several albums

' Assumptions
' - A Sign Out link is on every Flickr page
' - You are currently logged into Flickr

' Main script

TAB T=1
FILTER TYPE=IMAGES STATUS=ON
SET !ERRORIGNORE YES
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>Out
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>in*
WAIT SECONDS=2
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>in<SP>as<SP>a*
SET !ERRORIGNORE NO
WAIT SECONDS=2
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:login_form ATTR=NAME:login CONTENT={{!VAR1}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD ATTR=ID:passwd CONTENT={{!VAR2}}
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=VALUE:Sign<SP>In
FILTER TYPE=IMAGES STATUS=OFF
URL GOTO=http://www.flickr.com/activity
TAG POS=1 TYPE=SELECT FORM=* ATTR=ID:act-since CONTENT=%lastlogin


Script Ends

Latest changes:
  1. I added the 2 second wait times as Sxipper (a password plugin) seemed to be causing 'focus' problems.
  2. ErrorIgnore is used so that the script still works (though slower) if you have logged off but are still on the Flickr site.

No comments: