Home General Discussion

Looking for a script...

ShadoKat
polycounter lvl 18
Offline / Send Message
ShadoKat polycounter lvl 18
For some reason, I always tend to want to do things that are... how shall we say... unorthodox. So, here's the deal. Say there's this web page that I'm looking at. There is a number on the page that very rarely changes, but when it does, I want to know about it immediately. So, I'm looking for a script or a program or SOMETHING that will refresh the page every five minutes and alert me, somehow (preferably by e-mail, IM, or text message on my phone) when it does.

There are two ways I was considering going about this. The best way, I think, is to leave it running on my computer at home, then have it e-mail me at work when the number changes. I was also considering keeping the browser window hidden, then popping up when the change occurs, but I like the first way better.

So, any ideas for how one might go about doing this? I've been looking through Firefox extensions for the last two days, and haven't found anything useful. Thanks much!!

Replies

  • Downsizer
    Offline / Send Message
    Downsizer polycounter lvl 18
    I'm an ASP.net with VB.net web developer, could you perhaps be more specific?

    From what I gather, this webpage is'nt owned or maintained by you? You would need something less then basic implemented.

    The web host will have to be running an smtp accesable service, or CDONTS mail service, to be able to send an email to yourself. You can get around that, but it would expose the code to the casual 'view source' visitor.

    You can email me if you want, or discuss it here.

    mattcrawford AT comcast.net
  • ShadoKat
    Offline / Send Message
    ShadoKat polycounter lvl 18
    Hi, thanks for the reply. No, you're right, I don't own the website. This is more shell or batch scripting than web programming. It would most likely have to be a script or a program that runs on my local machine, and would most likely have to use my default e-mail client to send the notification. What I want it to do is, at refresh time, compare the current number with the last refresh, and only notify me if the number is different.

    To illustrate, I'll use this board as an example. Say this thread currently has three replies. The number "3" is clearly displayed next to the thread on the main forum page. The script/program would periodically (every fifteen minutes, say) refresh that main forum page. When the 3 next to this particular thread changes to a 4 (or a 2 if someone deletes a post), the script generates an e-mail using my default mail client or some other small mail handler (I used to use one in NT, but I don't remember what it was).

    More clear? Thanks!!
  • Illusions
    Offline / Send Message
    Illusions polycounter lvl 18
    Why not have the script get the source code of the page, and use the particular line of code that generates that number. Then have it take another copy later on, and compare the first with the second.
  • ShadoKat
    Offline / Send Message
    ShadoKat polycounter lvl 18
    Because I'm not sure how the server is doing what it does. It's querying a database using specific search terms and displaying the number of returned results. A refresh will re-initiate the query. I did view the source, but couldn't make sense of it.

    /me = code-incompentent
  • Downsizer
    Offline / Send Message
    Downsizer polycounter lvl 18
    Sigh, I had this big thing written up for you. Did'nt post for some reason...

    It can be done is the short answer, but it would be dependant on what site your getting the data from, and if the data would always be located in the same exact place. If I get bored I'll see if I can throw something together for you in vbscript. I'll make it easy to edit, so you can alter it as you wish. Don't expect it in a day, but maybe on monday.

    If it's a messageboard site, my warning is that, when a new post is made the whole topic moves to the top. That would break the script, as the location of the item would change. Also looking at these boards, you can go directly to a topic, but total posts does'nt seem to be listed.

    It would help if you sent me the page and data you wanted.
Sign In or Register to comment.