Add value to extracted URL

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
kuntu
Posts: 2
Joined: Tue May 24, 2011 6:27 am

Add value to extracted URL

Post by kuntu » Tue May 24, 2011 6:45 am

What i wanna do is first extract a url and then add a value to it and go to the new url.. Bt i want to add it somewhere between the extracted url....
For ex: if the url extracted is www.google.com/search/indian/242425

The value "delete" needs to be added and the new url should be like
http://www.google.com/search/delete/indian/242425

So i wanna know how to position the value that needs to be added. I'm using firefox 4 on win 7 and the latest version of imacros.

I'm a complete noob and all the programing i know is from imacros :oops: .
siniy
Posts: 118
Joined: Sat Nov 07, 2009 7:44 pm

Re: Add value to extracted URL

Post by siniy » Tue May 24, 2011 9:34 pm

I believe without JavaScript interface and knowledge you won't be able to solve this task.
kuntu
Posts: 2
Joined: Tue May 24, 2011 6:27 am

Re: Add value to extracted URL

Post by kuntu » Wed May 25, 2011 7:33 am

I believe i have the interface and do not have the knowledge...that is y i made this post :!: :?: :!: :?:
So if anyone can post the coding over here..then i can modify it to my requirements.
Tom, Tech Support
Posts: 3613
Joined: Mon May 31, 2010 4:59 pm

Re: Add value to extracted URL

Post by Tom, Tech Support » Wed May 25, 2011 10:35 pm

This is just an example and not meant to be used as-is:

Code: Select all

var macroExtractURL;
macroExtractURL =  "CODE:";
macroExtractURL +=  "ADD !EXTRACT http://www.google.com/search/indian/242425" + "\n"; 

iimPlay(macroExtractURL)

var leftURL = "http://www.google.com/search/";
var extractedURL = iimGetLastExtract(1);
var rightURL = extractedURL.substr(leftURL.length, extractedURL.length - leftURL.length);
var newURL = leftURL + "delete/" + rightURL;

alert(newURL);
Regards,

Tom, iMacros Support
Post Reply