Home | Scripts | Tutorials | Books | Hosting | Forums | Links|

Navigation:

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

ADD TO Progged Progged
ADD TO DEL.ICIO.US Del.icio.
ADD TO DIGG Digg
ADD TO FURL Furl
ADD TO NEWSVINE Newsvine
ADD TO NETSCAPE Netscape
ADD TO REDDIT Reddit
ADD TO STUMBLEUPON StumbleUpon
ADD TO TECHNORATI FAVORITES Technorati
ADD TO SQUIDOO Squidoo
ADD TO WINDOWS LIVE Windows Live
ADD TO YAHOO MYWEB Yahoo MyWeb
ADD TO ASK Ask
ADD TO GOOGLE Google
ADD TO MAGNOLIA Magnolia
ADD TO SPURL Spurl



 
 

SPONSORS



 
 

Putting news from ABC on your site

This shows how to put various ABC headlines on your site .

Category XML link
ABC news http://abc.net.au/news/hlines.rss
Entertainment http://www.newsisfree.com/HPE/xml/feeds/37/1837.xml
Health http://www.newsisfree.com/HPE/xml/feeds/41/1841.xml
International http://www.newsisfree.com/HPE/xml/feeds/39/1839.xml
Science http://www.newsisfree.com/HPE/xml/feeds/40/1840.xml
US http://www.newsisfree.com/HPE/xml/feeds/38/1838.xml
   

This example will show the international news

Code :

<?php
$xmlfile = fopen("http://www.newsisfree.com/HPE/xml/feeds/39/1839.xml", "r");
if(!$xmlfile)die("cannot open the xml file");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
echo "<table border='1'>";
echo "<th colspan='3'>latest news</th>";
for($i=1 ; $i<=$count-1 ;$i++)
{
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
ereg("<description>(.*)</description",$filechunks[$i],$desc);
echo "<tr><td>";
echo $title[1];
echo "</td><td>";
echo "<a href ='$links[1]'\>$links[1]</a>";
echo "</td><td>";
echo $desc[1];
echo "</td></tr>";
}
echo "</table>";
?>

Example :

 

latest news