jQuery

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
jason_marcus
Posts: 2
Joined: Sun Dec 23, 2012 3:54 am

Re: jQuery

Post by jason_marcus » Mon Dec 24, 2012 9:25 am

Thanks Daniel.

Unfortunately, I'm getting this error: RuntimeError: Can not locate element specified by selector "#ui-id-1>LI", line: 15 (Error code: -1001).

I also think that the script needs to be slowed down after searching for a name in the AJAX type ahead searcj/

I also tried simulating DS in Firefox, but got this error: SyntaxError: can not parse macro line: iimSet("_DS_ObjectId","friendsform"); (Error code: -910).

Here's my script on the site; any suggestions?

'Prepare CSV spreadsheet that has FB friend names:
SET !DATASOURCE /Users/jasonlangheier/Google<SP>Drive/Contacts/testlangheierfbfriends.csv
'Only need data from the first column (first and last name):
SET !DATASOURCE_COLUMNS 1
'Start the loop to start are row 1 of this data set (not using column headers since 1 column):
SET !LOOP 1
'Set the loop to pull data from the CSV file
SET !DATASOURCE_LINE {{!LOOP}}
'Go to the website of the card you want (each card has a unique ID- this is Reindeer Poop):
URL GOTO=http://www.zipongo.com/gift-a-meal/sent ... 51efeb611a
'Put a name from column 1 of the CSV file into the first empty field under "Send this ecard to more friends":
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:friendsform ATTR=* CONTENT={{!COL1}}
'Click on the first result of the type ahead search
iimSet("_DS_ObjectId","friendsform");
iimSet("_DS_Command","CLICK");
iimPlay("DS_Mouse.iim");
TAG POS=1 TYPE=LI ATTR=TXT:*
'Click Send eCard to build the ecard and popup FB share box:
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:friendsform ATTR=VALUE:send<SP>ecard
'Share the post on the user's FB wall
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:uiserver_form ATTR=ID:*
'now the loop will restart, reloading the website with the next name

'backup. DS commands only work on Windows iMacros browser or IE
''Set variables so you can do a click on the result of the jQuery AJAX type ahead drop down
'SET !VAR1 {{!TAGX}}
'SET !VAR2 {{!TAGY}}
'ADD !VAR1 5
'ADD !VAR2 5
''Click on the first result of the type ahead search
'DS CMD=CLICK X={{!VAR1}} Y={{!VAR2}}



THANKS!
Daniel, Tech Support
Posts: 1483
Joined: Tue Jan 26, 2010 11:35 am

Re: jQuery

Post by Daniel, Tech Support » Mon Dec 24, 2012 12:22 pm

Hi Jason,

DS won't work in FireFox yet, but the tool I mentioned can almost do what DS does. Could you please post what you've recorded with that tool and what didn't work?

Thanks,
Daniel, iOpus Support
Colibry
Posts: 48
Joined: Sun Sep 25, 2011 6:47 pm
Contact:

Re: jQuery

Post by Colibry » Tue Dec 25, 2012 3:14 am

Daniel, iOpus wrote:Hi Jason,

This request comes just in time! :)

Please have a look at our experimental EVENT command and let us know what you think:
http://forum.imacros.net/viewtopic.php?f=20&t=19665

Best regards,
Hi this task interests me to and since I have experience I will come up with something.

Now I want to ask why is not latest addon available on addons.mozilla.org ? I still see there 7.6 version.

Any way here is the code for our little problem.

Code: Select all

'Prepare CSV spreadsheet that has FB friend names:
SET !DATASOURCE /Users/jasonlangheier/Google<SP>Drive/Contacts/testlangheierfbfriends.csv  
'Only need data from the first column (first and last name):
SET !DATASOURCE_COLUMNS 1
'Start the loop to start are row 1 of this data set (not using column headers since 1 column):
'SET !LOOP 1
'Set the loop to pull data from the CSV file
SET !DATASOURCE_LINE {{!LOOP}} 
'Go to the website of the card you want (each card has a unique ID- this is Reindeer Poop):
URL GOTO=http://www.zipongo.com/gift-a-meal/sent/a5dce957-329f-4042-8d26-f851efeb611a
'Put a name from column 1 of the CSV file into the first empty field under "Send this ecard to more friends":

SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 3

EVENTS TYPE=KEYPRESS SELECTOR="#friendsform>DIV>INPUT" CHARS={{!COL1}}
EVENT TYPE=CLICK SELECTOR="#ui-id-5" BUTTON=0

'this is the old way
'TAG POS=1 TYPE=INPUT:TEXT FORM=ID:friendsform ATTR=* CONTENT="{{!COL1}}"


'Click on the first result of the type ahead search
TAG POS=1 TYPE=LI ATTR=TXT:*
WAIT SECONDS=1
'Click Send eCard to build the ecard and popup FB share box:
TAG POS=1 TYPE=INPUT:BUTTON FORM=ID:friendsform ATTR=VALUE:send<SP>ecard
'Share the post on the user's FB wall
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:uiserver_form ATTR=ID:*
'now the loop will restart, reloading the website with the next name

'in case there is no share press close
TAG POS=1 TYPE=A ATTR=CLASS:fb_dialog_close_icon&&TXT:


TAG POS=1 TYPE=A ATTR=TXT:Add<SP>more


'backup. DS commands only work on Windows iMacros browser or IE
''Set variables so you can do a click on the result of the jQuery AJAX type ahead drop down
'SET !VAR1 {{!TAGX}}
'SET !VAR2 {{!TAGY}}
'ADD !VAR1 5
'ADD !VAR2 5
''Click on the first result of the type ahead search
'DS CMD=CLICK X={{!VAR1}} Y={{!VAR2}}

The only thing left undone is this.

Code: Select all

TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:uiserver_form ATTR=ID:*
I am not sure will this work and on my profile I couldn't share any of the shares. How ever I suggest this command line since it's standard for FB .

Code: Select all

TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:uiserver_form ATTR=VALUE:Share
Cya.
Post Reply