
11-15-2005, 03:54 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Dec 2004
Location: United Arab Emirates
Posts: 92
|
|
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.
|

11-20-2005, 06:40 PM
|
|
Web Hosting Master
|
|
Join Date: Mar 2004
Location: USA
Posts: 4,342
|
|
Quote:
|
Originally Posted by Ekhwan
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.
|
At first, I just copied google's style of xml (since I wanted it for a news website) and just implemented it...
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,
|

11-22-2005, 05:41 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Nov 2005
Location: Maidstone, Kent
Posts: 92
|
|
header u want to output is:
header('Content-type: text/xml');
Then just use php to output the xml code 
|

11-22-2005, 10:32 AM
|
|
Junior Guru Wannabe
|
|
Join Date: Dec 2004
Location: United Arab Emirates
Posts: 92
|
|
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.
|

01-04-2006, 01:10 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Jan 2006
Posts: 31
|
|
I also want to know RSS, do you have some tutorials about it?
|

01-04-2006, 02:52 PM
|
|
Junior Guru Wannabe
|
|
Join Date: Dec 2004
Location: United Arab Emirates
Posts: 92
|
|
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
|

01-14-2006, 11:11 PM
|
|
New Member
|
|
Join Date: Jan 2006
Posts: 2
|
|
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
|
|
Newbie
|
|
Join Date: Jan 2006
Posts: 8
|
|
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
|
|
Newbie
|
|
Join Date: Apr 2006
Location: Ireland
Posts: 12
|
|
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
|
|
New Member
|
|
Join Date: Dec 2005
Location: Nescopeck, PA
Posts: 2
|
|
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
|
|
Newbie
|
|
Join Date: Apr 2006
Location: Ireland
Posts: 12
|
|
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"; }
?>
Thats about it, if you have any probelms just reply, i'm subscribed to this topic. A friend emailed me a script he wrote which works a bit better than the one above. With the script above you need to click on the link MY RSS FEED to run the query which generates the rss file but with my friends it automatically generates the rss file which is handier.
Cormac
Last edited by Cormac Moylan; 04-29-2006 at 07:31 AM.
|

04-29-2006, 07:30 AM
|
|
Newbie
|
|
Join Date: Apr 2006
Location: Ireland
Posts: 12
|
|
Quote:
|
Originally Posted by STORMPAYUSER
Is it really a good idea to add an RSS feed to your site from SEO point of view?
|
yes it is. If you have a rss feed for your content you will get picked up more frequently by search bots and the like as your content is becoming more dynamic.
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|