Home General Chat
If you need urgent support, call 999 or go to your nearest A&E. To contact our Crisis Messenger (open 24/7) text THEMIX to 85258.
Read the community guidelines before posting ✨
Aged 16-25? Share your experience of using the discussion boards and receive a £25 voucher! Take part via text-chat, video or phone. Click here to find out more and to take part.
Options

Running a script to automatically save new content

Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
Hi

How easy is it to develop a script that will automatically follow a domain for new content (it wouldn't necessarily need to capture *all* content), so every 15s or so it takes the newest content, saves it in a folder, and so on.

Just entertaining an idea I have, but not really sure the best way to go about it.

Comments

  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    It would be fairly easy to set up something like that, but a bit invasive if it's not your site that you are tracking.

    Most sites these days that have regularly updated content produce RSS feeds, your best bet would be to collect the info from that.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Some websites are noobs and don't have RSS feeds :grump:

    Basically I just want to fill up a folder with pics as and when they're posted lol.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    i.e. with php on your own website:
    $data = file_get_contents("http://www.finalwebsites.com");
    $pattern = "/src=[\\"']?([^\\"']?.*(png|jpg|gif))[\\"']?/i";
    preg_match_all($pattern, $data, $images);

    example from:
    http://www.web-development-blog.com/archives/parse-html-with-preg_match_all/

    that's just an example with server side scripting. If you're to run it on your own computer as a more classic program, then you'd need to parse the raw html output in a loop structure in your favourite language and look for image references. for example.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    ShyBoy wrote: »
    Some websites are noobs and don't have RSS feeds :grump:

    Basically I just want to fill up a folder with pics as and when they're posted lol.
    lol = pr0n? :D
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    Maybe you want something like this?

    http://www.chaoticsoftware.com/ProductPages/WebWatcher.html

    We use this at work and works fine. It checks many thousands of web pages per day.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    lol = pr0n? :D

    Haha very nearly.
  • Options
    Former MemberFormer Member Posts: 1,876,323 The Mix Honorary Guru
    The only problem with a check limit of 15s is that you might alert the websites firewall, into thinking you're trying to cause a DDoS attack.
Sign In or Register to comment.