This is fairly straight forward, just need to know how you want the final XML layout, should it be the same as the full article XML with only articles from ID's that are in the list.php file, or something custom/specific? If you can let me know the format I can finish this for you.
Excellent, good to hear this shouldn't be too bad.
@tripflex - unfortunately @avladev's answer created single XML files and an "all.xml" file that was the list.php feed but saved locally. This is a good start, but as I mentioned in my second bullet point above, what we need is a single XML file contains the full details of all the releases listed in list.php
If either of you can help from here, that would be great! Thanks in advanced.
My script does just what you asked. Check result.xml file created in current directory this is the result file when combining list.php and get.php results. You can also change $output variable to empty string (
$output = '';) to output the file in your browser window.
These files in cache/ folder. all.xml, N.xml are just cached results from concordiarx.mediaroom.com. This cache is used for test purposes to speed up the development. The actual result of the scripts is in result.xml in CWD (or depending on $output setting).
Sorry @avlavad, you are right, I didn't notice the path for result.xml. Thank you for your work so far, just the last part of my request we need to sort out now...
As noted in your script (which is well documented thank you!) I should set the $cache variable to false in production, which makes sense except then it really slows down whenever I run the script.
This leads to the last part of my initial question. I need to ensure this script only runs every 30 mins or so on this WordPress based website...is the best option for me to just setup a Cron job on my server?
It's slow because of the responses have a little bit delay and also I use
$pause_time variable to reduce the load on the server. If the target server is yours you can set
$pause_time = 0; this way it will speed up the script with 9 seconds if there are 8 releases.
Please get new version of the script from here: https://gist.github.com/avladev/239809280cf5b2dff0b7 I have a little bug when cache is off and no cache dir exists.
How to move to production:
$cache = false;
$output = '/path/to/your/wp-content/releases.xml';
Test the setup:
3. Then check if the file is generated in http://yoursite.com/wp-content/releases.xml
Create crontab job:
0,30 * * * * php /home/myuser/scripts/combine.php
If you need more information. Thanks