Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

The Times newsfeed

Code Wizard, 12-30-2006

This must be the simplest code ever for getting news headlines onto your site. The headlines are in English from the British newspaper, "The Times".

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>The Times News Headlines</title>
</head>
<body>
<?php
// The Times News Headlines
// This works as at 15-Aug-2000
// It may fail at any time if The Times changes its site layout!
//
$file = "http://www.the-times.com//message.txt";
$fd = @fopen($file, "r") or die ($file." cannot be accessed");
while (!feof($fd)) {
$buffer = fgets($fd, 4096);
strtr($buffer,"
","");
if (substr($buffer,0,6)<>"NOLINK")
{ echo $buffer."<br>
"; }
}
fclose($fd);
?>
<a href="http://www.the-times.co.uk/news/pages/resources/update1.n.html">
Click here</a>
</body>
</html>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions