Results 1 to 13 of 13
Thread: RSS Feeds HOW-TO??
-
11-15-2005, 03:54 AM #1WHT Addict
- Join Date
- Dec 2004
- Location
- United Arab Emirates
- Posts
- 113
RSS Feeds HOW-TO??
Hello,
Can anyone explain to me how RSS feeds such as these http://www.caip.rutgers.edu/~taher/dbnet-rss.xml can be generated?? The original website mumineen.org doesnt provide such feeds and these are generated externally. I would be grateful if anyone can help.
PS. I am a novice on this.[URL=http://www.ekhwan.com/]Ekhwan Web Solutions - Brotherhood Beyond Boundries.
Affordable online solutions and applications for your business.
-
11-20-2005, 06:40 PM #2Web Hosting Master
- Join Date
- Mar 2004
- Location
- USA
- Posts
- 4,345
Originally Posted by Ekhwan
a day ago, I read that you have to have xml combiled with PHP and then use its library to generate it, I didnt go through that..
I just outputed the XML header and just the text...
Peace,Testing 1.. Testing 1..2.. Testing 1..2..3...
-
11-22-2005, 05:41 AM #3Junior Guru Wannabe
- Join Date
- Nov 2005
- Location
- Maidstone, Kent
- Posts
- 94
header u want to output is:
header('Content-type: text/xml');
Then just use php to output the xml codeTME Solutions - eCommerce Web Designers - Visit our Web Design Portfolio
-
11-22-2005, 10:32 AM #4WHT Addict
- Join Date
- Dec 2004
- Location
- United Arab Emirates
- Posts
- 113
As I said I am a novice, please explain how to fetch rss feeds or xml feeds from this site http://mumineen.org so that I can display it on my own domain same as here http://www.caip.rutgers.edu/~taher/dbnet-rss.xml
I cannot understand your response kindly explain.
Thanks a lot.[URL=http://www.ekhwan.com/]Ekhwan Web Solutions - Brotherhood Beyond Boundries.
Affordable online solutions and applications for your business.
-
11-22-2005, 10:37 AM #5Junior Guru Wannabe
- Join Date
- Nov 2005
- Location
- Maidstone, Kent
- Posts
- 94
To read an RSS feed I would suggest getting the PEAR class XML_RSS http://pear.php.net/package/XML_RSS/redirected
TME Solutions - eCommerce Web Designers - Visit our Web Design Portfolio
-
01-04-2006, 01:10 PM #6Junior Guru Wannabe
- Join Date
- Jan 2006
- Posts
- 34
-
01-04-2006, 02:52 PM #7WHT Addict
- Join Date
- Dec 2004
- Location
- United Arab Emirates
- Posts
- 113
I guess you are not getting my question. I do not want to know about or need an RSS reader or parser. Rather I want to know how to create RSS feeds that can be rendered in a RSS reader.
Here is the xml file I want to create or publish an RSS feed for. http://akhbar.mumineen.org/headlines.xml[URL=http://www.ekhwan.com/]Ekhwan Web Solutions - Brotherhood Beyond Boundries.
Affordable online solutions and applications for your business.
-
01-14-2006, 11:11 PM #8New Member
- Join Date
- Jan 2006
- Posts
- 3
Outputting an RSS Feed
To do this, you must first fetch the source XML file and capture its contents into a variable. You can do this by using the fopen() function. Once you have the contents of the XML file, you need to output the contents in the RSS feed format. To do this, you can either transform the XML file using XSLT, or you can parse the source XML using the DOM XML functions and output the resulting data structure in RSS format. As said earlier, you will also need to send the appropriate header using the header function:
<? header('Content-type: text/xml') ?>
-
01-29-2006, 05:58 PM #9Newbie
- Join Date
- Jan 2006
- Posts
- 9
I too would like to learn more about this - I have heard great things in terms of SEO and RSS feeds...I'm not too savvy on the subject and woule love to hear any suggestions on great and perhaps free or affordable readers that I can add to my sites that you may have used in the past.....
Is it really a good idea to add an RSS feed to your site from SEO point of view?
-
04-05-2006, 10:51 AM #10Newbie
- Join Date
- Apr 2006
- Location
- Ireland
- Posts
- 15
i have a php script which automatically generates an xml file based on the fields in a mysql database. I will post up a link to the completed file later this evening when i'm infront of my pc. If i forget send me a PM (i'm only new here...and my ability to send pm's is disabled, how do i enable them)
Cormac
-
04-28-2006, 06:32 PM #11New Member
- Join Date
- Dec 2005
- Location
- Nescopeck, PA
- Posts
- 3
Any chance of getting a peek at that php file Cormac. Perhaps you are still subscribed to this.
Mark
-
04-29-2006, 07:19 AM #12Newbie
- Join Date
- Apr 2006
- Location
- Ireland
- Posts
- 15
i did indeed subscribe...
call this file rss.php or whatever, chmod it to 777 as it generates a xml file called rss.xml . The file queries the database for the fields 'title', 'user', 'description', 'message' from the table mynews where RSS='YES'. It then outputs the values in the db to the xml file. For RSS files you need to follow a strict formatting style which i'm sure you are aware off.
PHP Code:<?
$host = "localhost";
$user = "********";
$pass = "********";
$database = "********";
$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");
$query = "SELECT id, title, user, link, content, message FROM mynews WHERE RSS='yes' ORDER BY id DESC";
$result = mysql_query($query, $linkID) or die("Data not found.");
$num = mysql_num_rows($result);
if ($num != 2) {
$file= fopen('rss.xml' , 'w');
$xml_output = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n";
$xml_output .= "<rss version=\"2.0\">\n";
$xml_output .= "<channel>\n";
for ($x = 0; $x < mysql_num_rows($result) ; $x++){
$row = mysql_fetch_assoc($result);
$xml_output .= "\t<item>\n";
$xml_output .= "\t\t<title>" . $row['title'] . "</title>\n";
$xml_output .= "\t\t<author>" . $row['user'] . "</author>\n";
$xml_output .= "\t\t<link>" . $row['link'] . "</link>\n";
$xml_output .= "\t\t<category>" . $row['content'] . "</category>\n";
$xml_output .= "\t\t<description>" . $row['message'] . "</description>\n";
//Escaping illegal charcters
// $row ['description'] = str_replace("&", "&", $row['text']);
//$row ['description'] = str_replace("<", "<", $row['text']);
//$row ['description'] = str_replace(">", ">", $row['text']);
//$row ['description'] = str_replace("\"", ""e", $row['text']);
$xml_output .= "\t</item>\n";
}
$xml_output .= "</channel>";
$xml_output .= "</rss>";
fputs($file, $xml_output);
fclose($file);
echo "<a href= rss.xml>MY RSS FEED</a>";
}
else {
echo "No Records found";
}
?>
CormacLast edited by Cormac Moylan; 04-29-2006 at 07:31 AM.
-
04-29-2006, 07:30 AM #13Newbie
- Join Date
- Apr 2006
- Location
- Ireland
- Posts
- 15
Originally Posted by STORMPAYUSER
If you have rss content on your site from another site you will also improve your SEO as you will have fresh content on your site from other sites. I would recommend magpieRSS as the tool to setup RSS feeds to your site. Its a fantastic application