Discuss Where to put RSS XML Code on Website in the Blogs, Tagging, RSS Feeds forum on SEO Chat. Where to put RSS XML Code on Website Blogs, Tagging, RSS Feeds forum discussing current and emerging syndication and content building technologies, such as RSS, XML feeds, JSMsg, and others. Find help with syndicating blogs and dynamic content.
Our weekly Search Engine newsletter covers the constantly evolving world of search engine optimization like no one else. To stay abreast of all the latestest news, reviews, and how-to's, subscribe today!
BuySellLinks.com is a Text Link Advertising Brokerage by the founder of LinkAdage that specializes in high end quality text links and a controlled membership base. To quickly build inventory we are paying webmasters who add quality domains that we can accepted into our inventory. We also offer free installation.
Tired of dealing with shady text link buyers and/or sellers? Try BuySellLinks.
This month's featured article takes a peek at Google Adsense and teaches you everything you need to know to properly maintain your account and get the most bang for your buck.
Posts: 3
Time spent in forums: 57 m 56 sec
Reputation Power: 0
Where to put RSS XML Code on Website
I have my ownwebsite, and would like to fill some contents onto the website using RSS feeds from other websites. I know you need to use a RSS feed reader, but where do you put the XML codes? I tried to cut and paste the XML codes onto my webpage, it did not work. If that has to be on the webserver, what extension should I use? Newsgater says use the following to display, http://www.newsgator.com/ngs/subscr...px?url=feed_URL, it would then display Newsgator user login, how do I bypass that, so the readers who goto my webpage would just be able to read the news or the content?
Vivien
Last edited by noixglacee : July 15th, 2006 at 01:35 PM.
Posts: 1,919
Time spent in forums: 3 Weeks 23 h 43 m 29 sec
Reputation Power: 59
Here's a bit of code that will display the rss feed on a php page. (I got it originally from a member at dp). Just put the url of the actual feed into the script where it says FULL URL HERE
Code:
<?php
$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";
function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $title, $description, $link;
if ($insideitem) {
$tag = $name;
} elseif ($name == "ITEM") {
$insideitem = true;
}
}
function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link;
if ($name == "ITEM") {
printf("<dt><a href='%s'>%s</a></dt>",
trim($link),htmlspecialchars(trim($title)));
printf("<dt>%s</dt><br>",htmlspecialchars(trim($description)));
$title = "";
$description = "";
$link = "";
$insideitem = false;
}
}
function characterData($parser, $data) {
global $insideitem, $tag, $title, $description, $link;
if ($insideitem) {
switch ($tag) {
case "TITLE":
$title .= $data;
break;
case "LINK":
$link .= $data;
break;
}
}
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
$fp = fopen("FULL URL HERE","r")
or die("Error reading RSS data.");
while ($data = fread($fp, 4096))
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);
?>
__________________
My Favorite Tools: Web CEO - Ranking Reports, Keyword Research, Link Analysis | Hosting.com - U.S. Windows Hosting | ISAPI Rewrite - Rewrite & Redirect for Windows
Posts: 1,919
Time spent in forums: 3 Weeks 23 h 43 m 29 sec
Reputation Power: 59
Quote:
Originally Posted by noixglacee
Thanks for the codes, the php file displays as a separate webpage. How do you have the displays directly on intended webpage?
The php code is to be inserted into an existing page on your site and will display their feed on your page. The links to articles/info will be pointed to the pages on their site, hence the benefit of the rss feed to the originator.
Quote:
Originally Posted by Furniture_SEO
i still don't know how to create RSS feed for your site, is there a free software or online service i can use to generate rss for my webpage?
Most blog, forum , directory software has a function to generate the feed. Otherwise you may look here http://searchenginewatch.com/showPage.html?page=2175271
If that doesn't help, maybe be more specific on exactly what you're trying to do (db type, server, scripting language)
Last edited by FogHorn : August 28th, 2006 at 03:42 PM.