Can this technically be done ?

Discussion in 'PHP' started by flyingdutchmen, May 8, 2010.

  1. #1
    hello php pro's, i simply know some basic php not much more than using variables loops arrays etc.
    i have not yet worked with mysql other than reading bits of it.
    now i have an idea of something which i would like to create and would like your opinion on it
    if it can be done the way i would like it...

    lets say there is a website where in the content are dates, times and events (format would be for example 25.05.2010 8pm).
    now i would like to have an script which will crawl this particular site once a day and if today is listed on
    this site (as an event) it should save those times in a database and crawl 5 other sites to find url's.

    if first website did have an event at 25.05.10 8pm then those other 5 sites should be crawled every 5 minutes from 7:55pm to 10pm to find and save links that those sites hold and again save them in
    the database to be able to show those later on my website.

    i hope i am being clear enough, 1 site should be checked for an event only once a day,
    if succes (there is a event at a given time) it should start crawling 5 more sites and give me
    the links that are stated there. i do not need any content of those sites it should only grasp some links if there are any.

    can this be done or am i just full of it ?

    if it can be done and one of you guys would like to do this id be happy to recieve some offers also,
    but first i would like to know if this kind auf automatization is possible at all

    thank you
     
    flyingdutchmen, May 8, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yeah this should be possible to do
     
    JAY6390, May 8, 2010 IP
  3. live.co.uk

    live.co.uk Banned

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    do you mean cron jobs?
     
    live.co.uk, May 8, 2010 IP
  4. flyingdutchmen

    flyingdutchmen Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i am not sure if it should be cronjobs, i dont think so but than on the other hand i am not to familiar with it.

    the thing is this script should only start scraping if a result is found, not all the time.

    any other opinions ?
     
    flyingdutchmen, May 8, 2010 IP
  5. Qc4

    Qc4 Peon

    Messages:
    44
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you want it to run once a day, a cron job is exactly what you need. You can wrap the scraping code in an if block to only run if there is a result.
     
    Qc4, May 9, 2010 IP
  6. Nick_Mayhem

    Nick_Mayhem Notable Member

    Messages:
    3,486
    Likes Received:
    338
    Best Answers:
    0
    Trophy Points:
    290
    #6
    Yes it can be done.

    Store the date/timestamp in Database and run the cron jobs every minute. If that date/time is the current time then go and crawl the ones that are in que otherwise just skip and it runs again to check after 1 minute.

    24 hours cron job will not work as the time would have already be gone by the time that script is executed tomorrow.
     
    Nick_Mayhem, May 9, 2010 IP