Hello,
Here is a step by step explanation.
Hope this explains what type of script i am looking for:
- I have an rss feed that publishes torrents.
- And i want a script that finds/looks through this list to find the latest update then downloads the newest torrent.
- Each update sent/published on this torrent list has three parts:
[login to view URL] > holds the name of witch computer should recieve the update
[login to view URL] > holds a date in the format %year-month-day-hour-minute-second%
[login to view URL] > the actual update
- the *.id and *.mvg files are very small only a few kb.
- the script should first download/scan this xml list and download the 10 latest *.id files.
The 10 latest *.id files that has the latest filname.
Each filename always has the date as name, so from there you should know witch file is the 10 most newest files published.
I should be able to set in a config file how many *.id files it should check, but as default of 10 files is ok.
- once the 10 latest *.id files has been downloaded the script should look through all the *.id files and find a "keyword".
That keyword is something i should be able to enter in some config file, later i might want to increase that value to 100
For example a name/keyword it should look for could be "DMDS0001".
If that keyword exists in all or several *.id files it should select the newest one, and that i can decide/know from the file name.
- Then if that name exits the script should continue to download the matching *.mvg file (the matching filenmae and the newest)
- Then once the *.mvg file is downloaded the script should check inside this file.
Inside that file is a date in the format "year-month-day-hour-minute-second".
The script should should then compare that date with a file on the computer.
That file could be this: /DMDS/updates/previous-update/[login to view URL]
If the date in the downloaded *.mvg file is newer than the date inside the file /DMDS/updates/[login to view URL]
The script should continue to download the *.rar file.
- Once download of the *.rar file is complete i want it to place that *.rar file inside /DMDS/updates/final/
And create a trigger file so i know the update/download is complete /DMDS/updates/final/[login to view URL]
- then the downloaded *.mvg file should replace the file /DMDS/updates/[login to view URL]
this is so that file then holds the date of the last update.
This way i ensure no old updates can be downloaded.
Som rules:
* the script should check this rss feed for updates each 10 minutes. This time is also something i should be able to change.
* the script should not download the same files twice
* all ideas for improvment is much appreciated
* the rss feed i have is on a private vpn network, but the program i use to publish the torrents is Azuerus.
* this is a very simliar rss feed on this url: [login to view URL]
the only difference is the filenames/torrents published on that list.
* you can use any program language as long as it works php, perl.
* i can publish the torrent list i have on a public vpn network later so you can test with that.
Best regards,
Johan