Loading...
Logo
Processing Forum
Hello!

I am very close to my new Processing book ( http://natureofcode.com) being available to purchase in print.  Because the book was funded via Kickstarter I have to fulfill about 800 pre-orders of the book. To do this, I have to individually hand enter each address into CreateSpace's online book ordering system.  I am looking for help with this asap.  It's probably a horribly menial and boring job but I would be forever grateful.  Will pay an hourly rate plus offer a few free copies of the text.

Contact me via e-mail daniel@shiffman.net if interested.

Dan

Replies(6)

A Web automation script, like Greasemonkey or other testing framework, can help in making the task faster and more reliable...
(Well, sometime coding time exceeds typing time, but if used another time, it can pay itself easily. And it is more fun to code this than to type lists...)
Yes indeed!  I'd be thrilled if someone wanted to help concoct an automated solution and would also pay for the time required.  I just am in the middle of the end of the semester and don't have time to do either myself!
Looks it can be done with Selenium, among others:
https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/FNKOJzCYvqA

Since I find the topic interesting, I will dig a bit more and will come back if I find a usable solution.
Will have to experiment on a random or self-made site, and to adapt to the real case later.
I found out it was very easy to do with the iMacros extension for Firefox (and other browsers), reading a CSV file to feed the form data.
I will contact you privately for details.
OK, in case some of the following can be useful to somebody, here is my testing procedure:
- I made a single page simple form in PHP, saving the data so I can check the result:
Copy code
  1. <body>
  2.  
  3. <h1>Filling Form Fields</h1>
  4.  
  5. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
  6.     <fieldset><legend>User Input</legend>
  7.         <label for="firstName">First Name:</label><input type="text" name="firstName" id="firstName" size="50"/><br/>
  8.         <label for="lastName">Last Name:</label><input type="text" name="lastName" id="lastName" size="50"/><br/>
  9.         <label for="address1">Address 1:</label><input type="text" name="address1" id="address1" size="100"/><br/>
  10.         <label for="address2">Address 2:</label><input type="text" name="address2" id="address2" size="100"/><br/>
  11.         <label for="city">City:</label><input type="text" name="city" id="city" size="50"/><br/>
  12.         <label for="postalCode">Postal Code:</label><input type="text" name="postalCode" id="postalCode" size="7"/><br/>
  13.         <label for="email">E-mail:</label><input type="text" name="email" id="email" size="50"/><br/>
  14.         <input type="submit"/>
  15.     </fieldset>
  16. </form>
  17.  
  18. </body>
  19. </html>
  20.  
  21. <?php
  22. if (!isset($_POST['firstName']))
  23.     return; // Just display the page
  24. $firstName = htmlspecialchars(@$_POST['firstName']);
  25. $lastName = htmlspecialchars(@$_POST['lastName']);
  26. $address1 = htmlspecialchars(@$_POST['address1']);
  27. $address2 = htmlspecialchars(@$_POST['address2']);
  28. $city = htmlspecialchars(@$_POST['city']);
  29. $postalCode = htmlspecialchars(@$_POST['postalCode']);
  30. $email = htmlspecialchars(@$_POST['email']);
  31. addData($firstName, $lastName, $address1, $address2, $city, $postalCode, $email);
  32. ?>
  33.  
  34. <?php
  35. function addData($firstName, $lastName, $address1, $address2, $city, $postalCode, $email)
  36. {
  37.     $data = <<<DATA
  38. ### $firstName $lastName ###
  39. $address1
  40. $address2
  41. $city, $postalCode
  42. $email
  43.  
  44. DATA;
  45.     $fileName = "DataBase.txt";
  46.     $fh = fopen($fileName, 'a') or die("Cannot open for write " . $fileName);
  47.     fwrite($fh, $data);
  48.     fclose($fh);
  49. }
  50. ?>
(header part omitted for brevity)
The script was on my local www folder, so it was reachable via localhost URL.
- I recorded a iMacros script filling in this form and submitting it. The result was looking like:
Copy code
  1. VERSION BUILD=7601105 RECORDER=FX
  2. TAB T=1
  3. URL GOTO=http://localhost/Tests/TestIMacros.php
  4. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:firstName CONTENT=a
  5. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:lastName CONTENT=b
  6. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:address1 CONTENT=c
  7. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:address2 CONTENT=d
  8. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:city CONTENT=e
  9. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:postalCode CONTENT=f
  10. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:email CONTENT=g
  11. TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/Tests/TestIMacros.php ATTR=*
- I went to IdentityGenerator and generated a CSV file of 100 random entries. I used the | separator because there can be commas in the addresses and IG doesn't quote its fields... I then used search / replace in my editor to replace | with "," and to add " to the beginning and end of the lines.
- I changed the above script to use the CSV file, following the instructions on the site:
Copy code
  1. VERSION BUILD=7601105 RECORDER=FX
  2. TAB T=1
  3. SET !DATASOURCE C:\www\Tests\randomdata.csv
  4. SET !DATASOURCE_COLUMNS 7
  5. SET !LOOP 2
  6. SET !DATASOURCE_LINE {{!LOOP}}
  7. URL GOTO=http://localhost/Tests/TestIMacros.php
  8. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:firstName CONTENT={{!COL1}}
  9. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:lastName CONTENT={{!COL2}}
  10. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:address1 CONTENT={{!COL3}}
  11. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:address2 CONTENT={{!COL4}}
  12. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:city CONTENT={{!COL5}}
  13. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:postalCode CONTENT={{!COL6}}
  14. TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Tests/TestIMacros.php ATTR=ID:email CONTENT={{!COL7}}
  15. TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/Tests/TestIMacros.php ATTR=*
- I ran the script, telling to loop 100 times.
In less than a minute, with browser minimized, it filled in the form 100 times.

I think iMacros is able to fill in a multi-page form as well. Maybe some delays must be inserted between submits.
It is a valuable tool where such repetitive task is needed.
Awesome, fantastic!!!!