Find the answer to your Linux question:
Results 1 to 4 of 4
Hi guys, I am extremely new to linux, in fact i'm a total noob. I have a problem and i'm hoping someone here can help me. I am a member ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    2

    Script to monitor web page and submit a form when it appears


    Hi guys,

    I am extremely new to linux, in fact i'm a total noob.

    I have a problem and i'm hoping someone here can help me.

    I am a member of a meetup group on meetup[dot]com. On this site a new event is posted at a certain time in the week and everyone must click a 'RSVP' button to commit to the event. Only a limited number of places exist on an event.

    However since I have no access to the site while in work I want to create an automatic signup script.

    can this be done?

    Basically here's an example of how the script would run;

    1. Login in to the meetup and download the html of the event page
    2. Search the code for the presence of the 'RSVP' button
      Code:
      <div class="rsvp-box-section"><input id="rsvpSubmit" class="button primary" type="submit" value="RSVP"></input></div>
    3. if 'RSVP button is present the submit the button and stop script
    4. if 'RSVP' button is not present repeat the script in 5 minutes


    I hope this makes sense.

    I would love is this could happen - one thing that could stop things woul dbe the login

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Hi,

    The downloading part could be done with a quick wget command.

    as to submitting a form via a script, you can use one of the many command line browser tools, like curl, that supports passing of authentication. or you could roll your own solution using any language that supports GET/POST http methods. However, if that authentication is javascript-based (or some other fancy method) then you are probably out of luck.

    if you can get those pieces working manually, then create an infinite bash while loop that does the RSVP check, and either does an exit, or does a sleep for 5 seconds.

  3. #3
    Linux Newbie nplusplus's Avatar
    Join Date
    Apr 2010
    Location
    Charlotte, NC, USA
    Posts
    106
    Quote Originally Posted by bazpaul View Post
    Hi guys,

    I am extremely new to linux, in fact i'm a total noob.

    I have a problem and i'm hoping someone here can help me.

    I am a member of a meetup group on meetup[dot]com. On this site a new event is posted at a certain time in the week and everyone must click a 'RSVP' button to commit to the event. Only a limited number of places exist on an event.

    However since I have no access to the site while in work I want to create an automatic signup script.

    can this be done?

    Basically here's an example of how the script would run;

    1. Login in to the meetup and download the html of the event page
    2. Search the code for the presence of the 'RSVP' button
      Code:
      <div class="rsvp-box-section"><input id="rsvpSubmit" class="button primary" type="submit" value="RSVP"></input></div>
    3. if 'RSVP button is present the submit the button and stop script
    4. if 'RSVP' button is not present repeat the script in 5 minutes


    I hope this makes sense.

    I would love is this could happen - one thing that could stop things woul dbe the login
    I'm not making any promises, but I'll see if I can find some of the stuff I used in another life to login and scrape pages as part of a hosting service migration. Anyway, I used Perl (perlperlperlperlperlperl...oh, sorry). So, while you are definitely not holding your breath waiting on my examples (right?), this link might get you started. perl - tiny runable www::Mechanize examples for the beginner - Stack Overflow

    Have fun!

    perlperlperlperlperlperlperlperlperlperlperl...oh, sorry again

    N

    Oh, and you should probably get a browser extension or use the chrome developer console to have a look at the web requests (GET's and POST's) that get generated whenever you manually interact with the site to do what you are trying to automate. It will give a lot of insight into what URLs you will output from whatever tool you use.
    Last edited by nplusplus; 04-19-2013 at 01:55 AM. Reason: added advice

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    30
    I'd also suggest a randomized wait time as there are scripts on hosting sites that monitor for constant interval access and automatically inject source IP's in firewall rules. I know as I am a firewall and webserver admin who is tasked with doing just this!

    Cheers,
    tkb.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •