How to get your daily local newspaper with style!
Everybody likes waking up, having a cup of coffee and at the same time browsing the local newspaper. Even if there’s nothing interesting there, you still want to look at the headlines. Well, in my case where I’m staying abroad, getting the latest news from my country and especially from a local newspaper, is kind of a hustle. Thank God there is RSS though! Each morning the news headlines pop into my Google Reader account and I can get a glimpse of what’s going on back home! Well that was good for me for a week. I needed more headlines and basically more erm..actual news! So I did a little bit of ‘digging’ and found out that one of the biggest local newspaper agency (Phileleftheros) back home provides a PDF version of their latest issue for free! Well it’s free for a testing period as they say! I think it’s been over a year and still they are testing it. Anyhow, the challenge was to get the newspaper every morning ready to my desktop. So I come up with the idea of an automatic newspaper fetching script. After a couple of minutes i crafter this little PHP script that calculates the URL of the next issue and then downloads it automatically.
/* Author: Marios Tziortzis
/ Released on 12/12/2006
/ http://marios.tziortzis.com
*/
$id = 16901; // Issue on 1st of November of 2006
function days_since($d,$m,$y) {
$nd = mktime(0,0,0,$m,$d,$y);
return (int)((time(void)-$nd)/86400);
}
$newid = days_since(1,11,2006) + $id;
header('Location:http://pdf.phileleftheros.com/PdfEdition/Pdf.axd?i='.$newid);
Usually the newspaper agency releases the PDF file at 12:00 at noon. At that time you can set your cron job or something, to automatically retrieve the file. Just make sure your cron job says (time of execution) PHP -f file.php For example a daily fetch at 12:05 every day would be 05 12 * * * PHP -f file.phpThis can also be done through ‘wget‘ and a little bit of shell scripting. Anyway, I hope this helps.
2 Responses to “How to get your daily local newspaper with style!”
Leave a Reply
MaSOn: file poli kali doulia .Den ime sinithismenos na xrisimopio wp alla ta themes sou...
Expressed on 1st of Nov 2007
Manali: what new sowftware should be indroduced in the ipod?
Expressed on 7th of Mar 2007
Rebecca: Cool blog, interesting information... Keep it UP »
Expressed on 1st of Mar 2007
Daniel2: i meant 3.000
Expressed on 23rd of Feb 2007
Daniel2: DANG! you sure doing a good effort, bloody 30,000 pounds!? this i dont see...
Expressed on 23rd of Feb 2007

RSS works fine for me,,,,i get all the headlines and full article content from philelephtros etc. Too bad that others cyprus papers dont have this. (i haven’t checked lately though).
Andreas
February 23rd, 2007 at 4:39 pmwww.nueronic.com
www.information-communication-technology.blogspot.com
Well, I’m using the RSS from Phileleftheros too. Cyprus news agencies and services in general should start looking the ‘new’ technologies more frequent. They are designing and developing websites as if it’s 1997.
February 23rd, 2007 at 10:38 pm