1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

Web page automation/scheduler?


Last Updated:

  1. Mr. Incredible

    Mr. Incredible Well-Known Member This Topic's Starter

    Joined:
    Jun 4, 2010
    Messages:
    113
    Likes Received:
    11
    I commute daily by train, so I have to check the train status through a website. The form POSTs data after you fill in 3 or 4 fields and hit the submit button, and then it returns a status webpage.

    Are there any apps to automate this so I don't have to type all of that in everyday.

    I use iMacros + task scheduler on my PC.
     

    Advertisement
  2. UncleMike

    UncleMike Well-Known Member

    Joined:
    Nov 15, 2009
    Messages:
    2,319
    Likes Received:
    482
    I've done things like this before on my PC, but always have to figure it out as I go because I do it so infrequently that I don't retain much of what I learned from the previous time.

    Bookmarking the page you end up at hasn't worked for you?

    A link to the web page and an example of some valid data for the fields would be a good place to start.
     
  3. Mr. Incredible

    Mr. Incredible Well-Known Member This Topic's Starter

    Joined:
    Jun 4, 2010
    Messages:
    113
    Likes Received:
    11
    amtrak.com
    Click the "Status" tab
    fill in "From" and "To" (ie LAX to SAN for LA to San Diego)
    Click the "Check Status" button

    It's a form script result, so bookmarking won't work.
     
  4. UncleMike

    UncleMike Well-Known Member

    Joined:
    Nov 15, 2009
    Messages:
    2,319
    Likes Received:
    482
    I took a look at the page, and stripped out what I thought was unnecessary, pre-populated the TO and FROM fields, and added the code necessary to auto-submit the form, and it appears to work. The only problem I'm running into is being able to pre-populate the date field. But if you copy the following code and save it as an HTML file, just opening it should get you the page you ultimately want, but only for the date hardcoded into the file.

    Hopefully someone mode knowledgeable than me can tweak it, after they stop shaking their head and laughing at the mess I made.

    Code (Text):
    1.  
    2. <html><head><title></title></head>
    3. <body onload="ff_status_form.submit()">
    4. <script type="text/javascript">
    5.  
    6. </script>
    7.  
    8. <form action="http://tickets.amtrak.com/itd/amtrak" name="ff_status_form" method="post"><input type="hidden" name="requestor" value="amtrak.presentation.handler.page.AmtrakCMSNavigationTabPageHandler" />
    9. <div id="ff_status_step_1" class="subdiv1">
    10. <div class="form_line_wrapper first">
    11. <span class="form_entry">
    12. <input value="Fri, Aug 20, 2010" maxlength="22" type="text" id="wdfdate10" readonly="readonly" size="22" name="/sessionWorkflow/productWorkflow[@product='Rail']/tripRequirements/journeyRequirements[1]/departDate.date"  /><script language="JavaScript" type="text/javascript">
    13. <!--
    14. document.write('<a class="calLink noloading" id="calLink10">&nbsp;</a>');//-->
    15. </script>
    16. <br />
    17. </span>
    18. </div>
    19. <div class="form_line_wrapper">
    20. <span class="form_entry">
    21. <input type="hidden" name="xwdf_trainNumber" value="/sessionWorkflow/productWorkflow[@product='Rail']/tripRequirements/journeyRequirements[1]/segmentRequirements[1]/serviceCode" /><input value="optional" maxlength="8" type="text" id="status_train_num" onfocus="if (this.value=='optional') { this.value=''; updateMaxLength(); };" size="4" name="wdf_trainNumber" />
    22. </span>
    23. </div>
    24. <br class="clear_both" />
    25. </div>
    26. <div id="ff_status_step_2" class="subdiv">
    27. <div id="ff_status_footnote_submit_wrapper">
    28. <p>One city is required if train number is used.</p>
    29. </div>
    30. <div id="status_dep_city" class="ff_city_wrapper">
    31. <!-- itd:locationinput id="status_dep" wdfxpath="travelSelection/journeySelection[1]/departLocation" wdfhtmlname="wdf_origin" wdflimitedlocations="resource:TRAVEL_USE_LIMITED_LOCATIONS" size="25" / -->
    32. <input type="hidden" name="xwdf_origin" value="/sessionWorkflow/productWorkflow[@product='Rail']/travelSelection/journeySelection[1]/departLocation/search" /><input autocomplete="off" maxlength="150" type="text" id="status_from" name="wdf_origin" value="LAX" />
    33. <p><span class="find_a_station">
    34. <a href="javascript:fieldName='status_from'; openStationList();" title="Click for a list of stations.">Find a Station</a>
    35. </span></p>
    36. </div>
    37. <div id="status_arr_city" class="ff_city_wrapper">
    38. <!-- itd:locationinput id="status_to" wdfxpath="travelSelection/journeySelection[1]/arriveLocation" wdfhtmlname="wdf_destination" wdflimitedlocations="resource:TRAVEL_USE_LIMITED_LOCATIONS" size="25" / -->
    39. <input type="hidden" name="xwdf_destination" value="/sessionWorkflow/productWorkflow[@product='Rail']/travelSelection/journeySelection[1]/arriveLocation/search" /><input autocomplete="off" maxlength="150" type="text" id="status_to" name="wdf_destination" value="SAN" />
    40. <p><span class="find_a_station">
    41. <a href="javascript:fieldName='status_to'; openStationList();" title="Click for a list of stations.">Find a Station</a>
    42. </span></p>
    43. </div>
    44. </div>
    45. </div>
    46. <div id="ff_status_submit_wrapper" class="subdiv">
    47. <input type="hidden" name="_handler=amtrak.presentation.handler.request.rail.AmtrakRailTrainStatusSearchRequestHandler/_xpath=/sessionWorkflow/productWorkflow[@product='Rail']" />
    48. <input type="image" src="/images/en/btn_checkStatus.gif" alt="Check Train Status" border="0" name="_handler=amtrak.presentation.handler.request.rail.AmtrakRailTrainStatusSearchRequestHandler/_xpath=/sessionWorkflow/productWorkflow[@product='Rail']" />
    49. </div>
    50. </form>
    51. </body>
    52. </html>
    53.  
    Good luck! :)
     
  5. Mr. Incredible

    Mr. Incredible Well-Known Member This Topic's Starter

    Joined:
    Jun 4, 2010
    Messages:
    113
    Likes Received:
    11
    Cool! This is a long way towards what I need. Thanks.
     

Share This Page

Loading...