iMacros scripting help for changing value in url

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
imacros_newbie
Posts: 4
Joined: Mon May 16, 2011 6:11 am

iMacros scripting help for changing value in url

Post by imacros_newbie » Mon May 16, 2011 6:20 am

I am trying to automate a few phpbb admin keystrokes to delete spammers.

Specifically, I am
1. banning the specified user by email address
2. banning the specified user by IP address
3. banning the specified user by forum username
4. deleting all posts by the spammer

This works immediately after I record the macro and specify a variable for the user name. However, with each login, a session key is generated and passed through the URL for every request, so once the session key expires, my macro fails.

Any suggestions on how to store the session key (after an imacro login) and then pass that key with every subsequent request? I have reviewed the web extraction macros but couldn't find one to extract the session key from the url.

Thanks in advance for your help.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: iMacros scripting help for changing value in url

Post by MattBell7 » Mon May 16, 2011 12:41 pm

does it actually need the session key? depending which part of the macro code its used it depends on the answer.

post a couple of the lines that use it as i suspect all you need to do is wildcard it.
imacros_newbie
Posts: 4
Joined: Mon May 16, 2011 6:11 am

Re: iMacros scripting help for changing value in url

Post by imacros_newbie » Mon May 16, 2011 3:04 pm

Matt, what you see as the sid is the session key. I did try putting the * instead of the sid but that didn't seem to work as the sid is generated with every login and has a certain period of validity (30 minutes?)

Code: Select all

POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://forums.company.fi/adm/index.php?i=users&sid=cb9e7dd3d7adcb2a084db4484c9d0751&mode=overview ATTR=ID:username CONTENT=MARTIN<SP>STORE
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:select_user ATTR=NAME:submituser&&VALUE:Submit
TAG POS=1 TYPE=FIELDSET ATTR=TXT:Overview<SP>Username:Length<SP>must<SP>be<SP>between<SP>3<SP>and<SP>20<SP>characters.<SP>[<SP>Test<SP>out<SP>user’s<SP>permissions<SP>]<SP>Registered:<SP>Tue<SP>May<SP>10,<SP>2011<SP>1:04<SP>am<SP>Registered<SP>from<SP>IP:<SP>82.128.0.157<SP>[<SP>Whois<SP>]<SP>Last<SP>active:<SP>Wed<SP>May<SP>11,<SP>2011<SP>6:30<SP>am<SP>Posts:<SP>8<SP>Warnings:<SP>0<SP>Founder:Founders<SP>have<SP>all<SP>administrative<SP>permissions<SP>and<SP>can<SP>never<SP>be<SP>banned,<SP>deleted<SP>or<SP>altered<SP>by<SP>non-founder<SP>members.<SP>Yes<SP>No<SP>E-mail:<SP>Confirm<SP>e-mail<SP>address:You<SP>only<SP>need<SP>to<SP>specify<SP>this<SP>if<SP>you<SP>are<SP>changing<SP>the<SP>users<SP>e-mail<SP>address.<SP>New<SP>password:Must<SP>be<SP>between<SP>6<SP>and<SP>30<SP>characters.<SP>Confirm<SP>password:You<SP>only<SP>need<SP>to<SP>confirm<SP>your<SP>password<SP>if<SP>you<SP>changed<SP>it<SP>above.
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:user_quick_tools ATTR=NAME:update&&VALUE:Submit
TAG POS=1 TYPE=A ATTR=TXT:«<SP>Back<SP>to<SP>previous<SP>page
TAG POS=1 TYPE=SELECT FORM=ACTION:http://forums.company.fi/adm/index.php?i=users&sid=cb9e7dd3d7adcb2a084db4484c9d0751&mode=overview&u=7832 ATTR=ID:delete_type CONTENT=%remove
TAG P
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: iMacros scripting help for changing value in url

Post by MattBell7 » Mon May 16, 2011 4:06 pm

you'll need to escape every dynamic piece of data, looking at whats provided below, that is:
cb9e7dd3d7adcb2a084db4484c9d0751 and 7832

also, unless it actually does something (i doubt it does) but you should take out this whole line: 'TAG POS=1 TYPE=FIELDSET ATTR=TXT:Overview<SP>Username:Length<SP>must...' as again, it has dynamic values (date/time/ip etc) and is probably just you accidently clicking the block of text on screen.

with the full script available i could probably correct it all for you, but failing that i suspect the iopus guys have probably already got a script for it, as i know they use a lot of automated scheduled tasks on the forum (backups etc).
Post Reply