Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Script to monitor website and click button if it appears

    Hi!

    First of all - my experience with programming is at a minimum, so please stop me if I'm diving to deep here...

    I wanna make a script or program to monitor a certain http://bit.ly/1mSSoh5 and click a button if it appears.

    It a site for getting a student accommodation, and they have a "first who sees it gets it"-policy which means that a
    apartment could come up any time, and the fastest to click it, gets it.

    Is there a way to do this? The tricky part is that the program would have to scan for the word "tvistevägen" and when that comes up, click that word (which also is a link" and then click the button "anmäl intresse" which would register me for the apartment.

    Is this even doable?

    Otherwise I hope you realized it early, and hopefully you're not reading this, so I'm wasting your time...

    Best regards

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,461
    Thanks
    11
    Thanked 600 Times in 580 Posts
    very do-able, and not terribly complicated. look into greasemonkey and/or tampermonkey, and just userscripts in general for these sorts of things.

    i won't do it for you because it sound like it could likely be against the terms of the website (not that i can read them), and because being descriptive it more helpful to other trying to do the same thing.

    you need two userscripts, one for each page you need to perform actions on.
    you can google for info/code about how to accomplish each step, each should be no more than a line or two of js.

    on the main listing page user script
    -schedule a reload in 30 seconds
    -find the word "tvistevägen" in one of the document.links
    -if present, call .click() on the <A> tag that matched, taking you to the detail page


    on the detail page user script
    - .click() the link/button with the specific ID that performs the action you want (it should be the same id for each apartment page), registering the apartment.
    Last edited by rnd me; 05-13-2014 at 11:05 PM.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Posting Permissions

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