User:Fæ/catWatch.js

/* iMacro Script Grab currently visible category items and add them to the raw watchlist */ function catWatch{ iimPlay("CODE:\n\ ' Grab category members visible\n\ TAG POS=1 TYPE=DIV ATTR=ID:mw-pages EXTRACT=HTM"); var cats=iimGetLastExtract.split('(.*?)<.a>.*/,"$1"); } //alert(cats.join(' : '));

iimPlay("CODE:\n\ ' Grab watchlist\n\ URL GOTO=http://en.wikipedia.org/wiki/Special:Watchlist/raw\n\ TAG POS=1 TYPE=TEXTAREA FORM=* ATTR=ID:titles EXTRACT=TXT"); var result=cats.join(' ')+' '+iimGetLastExtract; result=result.replace(/ /g,"").replace(/\n/g," ");

iimPlay("CODE:\n\ ' Adding "+cats.length+" pages to watchlist\n\ TAG POS=1 TYPE=TEXTAREA FORM=* ATTR=ID:titles CONTENT="+result+"\n\ TAG POS=1 TYPE=INPUT:SUBMIT FORM=* ATTR=VALUE:Updatewatchlist\n\ "); }