hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Web Hosting Talk Tutorials : Programming Tutorials : RSS Feeds HOW-TO??
Reply

Forum Jump

RSS Feeds HOW-TO??

Reply Post New Thread In Programming Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 11-15-2005, 03:54 AM
Ekhwan Ekhwan is offline
Junior Guru Wannabe
 
Join Date: Dec 2004
Location: United Arab Emirates
Posts: 92

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.



Sponsored Links
  #2  
Old 11-20-2005, 06:40 PM
Barti1987 Barti1987 is offline
Web Hosting Master
 
Join Date: Mar 2004
Location: USA
Posts: 4,342
Arrow

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,

__________________
Testing 1.. Testing 1..2.. Testing 1..2..3...

  #3  
Old 11-22-2005, 05:41 AM
tmesolutions tmesolutions is offline
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

__________________
TME Solutions - eCommerce Web Designers - Visit our Web Design Portfolio

Sponsored Links
  #4  
Old 11-22-2005, 10:32 AM
Ekhwan Ekhwan is offline
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.

  #5  
Old 11-22-2005, 10:37 AM
tmesolutions tmesolutions is offline
Junior Guru Wannabe
 
Join Date: Nov 2005
Location: Maidstone, Kent
Posts: 92
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

  #6  
Old 01-04-2006, 01:10 PM
$_patch $_patch is offline
Junior Guru Wannabe
 
Join Date: Jan 2006
Posts: 31
I also want to know RSS, do you have some tutorials about it?

__________________



  #7  
Old 01-04-2006, 02:52 PM
Ekhwan Ekhwan is offline
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

  #8  
Old 01-14-2006, 11:11 PM
Larry Kubin Larry Kubin is offline
New Member
 
Join Date: Jan 2006
Posts: 2
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') ?>

  #9  
Old 01-29-2006, 05:58 PM
STORMPAYUSER STORMPAYUSER is offline
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?

  #10  
Old 04-05-2006, 10:51 AM
Cormac Moylan Cormac Moylan is offline
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

  #11  
Old 04-28-2006, 06:32 PM
CableGuy CableGuy is offline
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

  #12  
Old 04-29-2006, 07:19 AM
Cormac Moylan Cormac Moylan is offline
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) {


$filefopen('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("<", "&lt", $row['text']);
//$row ['description'] = str_replace(">", "&gt", $row['text']);
//$row ['description'] = str_replace("\"", "&quote", $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.
  #13  
Old 04-29-2006, 07:30 AM
Cormac Moylan Cormac Moylan is offline
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

Reply

Related posts from TheWhir.com
Title Type Date Posted
HP to Launch Freemium Cloud-based IT Delivery Solution in January 2014 Web Hosting News 2013-12-05 12:20:45
DreamHost Taps DudaMobile for Mobile Website Builder Web Hosting News 2013-09-24 11:23:14
Digital Realty Trust Completes 130,000 Square Foot Data Center in Massachusetts Web Hosting News 2013-07-22 13:56:54
Domain Registrar Domain.com Launches goMobi Mobile Web Solution Web Hosting News 2012-08-24 17:32:25
Colocation Firm Open Data Centers Opens First Data Center in New Jersey Web Hosting News 2012-06-21 16:17:12


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?