1 May
This is a re-published (& slightly updated) article, orginaly published on my first blog The Journal (now offline, redirecting here)
*cue Tim Shaw voice-over* “Have you ever wanted to have the latest news on the persecution of Christians around the world on your website? Well now you can!“
ahem…
I’ve written a perl script to extract the RSS file from the Voice of the Martyrs website.
This takes the rss file and parses it using the XML::RSS module. So obviously you will need to be running a server that has both perl and the XML module installed. By default the script creates a div that looks like this (using the default css file), but it can be edited to change the HTML produced.
Anyway, here’s the code:
<?php require($CODE_INCLUDE_PATH."vomheadlines.txt"); ?>
or download the files [vomheadlines.pl] [vomheadlines.css]
When the script is run, it creates a file in the location specified by the $outputFile variable. If you put this into your includes directory and include it in your web pages, the headlines will appear. To make them regularly update, make a cron job for it. Once a day should be regularly enough.
Instructions:
$outputFile to wherever you keep your include files (or make a directory for it if you don’t have one)0 0 * * * /path/to/vomheadlines.pl)
Add New Comment
Viewing 2 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)