(BEGINNER) Automated Website Text Search

Looking for a few pointers with a simple program.

Page 1 of 1

2 Replies - 477 Views - Last Post: 09 December 2009 - 03:21 AM Rate Topic: -----

#1 ala_heu  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 08-December 09

(BEGINNER) Automated Website Text Search

Post icon  Posted 08 December 2009 - 09:08 PM

For starters, I am a beginner programmer. I have only taken one programming course in college (C++), but it was substantial enough to help make up my mind about jumping into software engineering...oh, and it was a year ago. Without any practice, I'm a tad rusty, but I want to fully submerge myself back into the content I learned. At this point, I can only make basic DOS-based programs with C++ (typically through Microsoft Visual Studio 2005), but that is all I currently require. So far, I feel that I grasp all the main concepts pretty well, I am just hoping for some guidance on the following program description:

I am waiting for a seat to open in a class that I want to take next semester. I want to write a program that will check the school's website periodically (say once every half hour) to see if the class seat status has gone from "0 of 30" to "x of 30" (0<x<31). If it comes up with a value of x>0, I want some kind of notification (anything simple, like a pop-up dialog box). The site is coded in XHTML. I'm not having any troubles figuring out where the "0" pops up:
(<td style="text-align:right;padding:0px;width:22px"></td> .... it's in a table)

I'm not entirely sure where to begin. One element that I desparately need, is a way to download the source code of a webpage. Without that, I can't really get started (I can manually save the source code as a text file and try some things, but that defeats the purpose of keeping it "automated"). Also, what's a commonly used method of notifying the user that the desired status currently realized? Lastly, does anyone have any pointers on the text search portion? Also, where would I learn how to set the program up to run periodically?

I understand that this is a pretty simple program, conceptually...but as I said, I'm fairly new to this. And I'm not trying to get someone to give me a full code, just looking for helpful resources and pointers. Thanks :)

(Any terminology for any of this would be helpful too. I'm interested in actually learning from this, not just creating the code and walking away...)

This post has been edited by ala_heu: 08 December 2009 - 09:18 PM


Is This A Good Question/Topic? 0
  • +

Replies To: (BEGINNER) Automated Website Text Search

#2 IngeniousHax  Icon User is offline

  • |>|20-514<|{3|2

Reputation: 78
  • View blog
  • Posts: 1,358
  • Joined: 28-March 09

Re: (BEGINNER) Automated Website Text Search

Posted 08 December 2009 - 10:32 PM

You could always have the program do a system call to telnet on port 80 and do a GET request, store the GET request in a file, and than have it run through the file searching for whatever it is you want it to do.

Using argv[] you could do this.

./WebSearch <Website for GET> <file to store in> <string to search for>




EDIT:: Another neat thing you could do, is search the file for '\n' the new line operator, and that way, you could see how many line there are in the XHTML source, and go right to that line after you run through your code...

If you could always just have it save that line number in an array, or something, that way you could save the program a lot of repetition.

This post has been edited by IngeniousHax: 09 December 2009 - 02:57 PM

Was This Post Helpful? 0
  • +
  • -

#3 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 855
  • View blog
  • Posts: 2,338
  • Joined: 20-August 07

Re: (BEGINNER) Automated Website Text Search

Posted 09 December 2009 - 03:21 AM

View Postala_heu, on 9 Dec, 2009 - 04:08 AM, said:

Also, where would I learn how to set the program up to run periodically?
Sometimes the best solution to a problem is in something which you already have; Your OS probably has a task scheduler which should let you run a program every N minutes/hours/days.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1