| Coding Forum Problems with your code? Let's hear about it. |
11-03-2004, 11:50 AM
|
#1 (permalink)
|
|
Inactive
Join Date: 10-26-03
Posts: 2,466
Latest Blog: None
|
Adding RSS feed to site
Apologies for the remedial question, but how do I add the RSS feed to display on a page on my website?
For example, I have RSS feeds for both a blog and forum on one site - I'd like to be able to display the actual contents of these feeds as active links on my site index page.
I presume this is possible? If so, what little piece of code do I need to use?
My pages are constructed as PHP includes, and an example RSS feed for my forum looks like this:
Code:
http://www.platinax.co.uk/community/external.php?forumids=13
Pointers much appreciated. 
|
|
|
11-03-2004, 02:01 PM
|
#2 (permalink)
|
|
Inactive
Join Date: 08-03-04
Location: Vancouver, BC, Canada
Posts: 55
Latest Blog: None
|
I've looked around for the very thing and have ended up using the free service from this site on my homepage:
http://jade.mcli.dist.maricopa.edu/feed/
Hope this helps. 
|
|
|
11-03-2004, 02:15 PM
|
#3 (permalink)
|
|
Inactive
Join Date: 10-26-03
Posts: 2,466
Latest Blog: None
|
I'm rather hoping for something other than a JS solution - ideally, I want search engines to be able to spider the links.
Is there a way to insert the feed using PHP?
|
|
|
11-03-2004, 04:56 PM
|
#4 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
http://www.beginnersphp.co.uk/newrss.php
It'll include just about any rss or xml feed you'll find. The links are structured however the xml/rss file structures them.
|
|
|
11-04-2004, 02:37 AM
|
#5 (permalink)
|
|
Inactive
Join Date: 10-26-03
Posts: 2,466
Latest Blog: None
|
Thanks for that hatchet - much appreciated.
The single reservation is that when I use it on my blog, I get entry titles, then the naked URLs. How difficult would it be to restructure links so that they appear simply as anchor text? Would anyone be up for the challenge?
|
|
|
11-04-2004, 08:41 PM
|
#6 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
That's no problem.
<?php
$xmlfile = fopen("http://www.mywebresources.co.uk/php/myscripting.rss", "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='2'>Latest News</th>";
for($i=1 ; $i<=$count-1 ;$i++)
{
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
echo "<tr><td>";
echo "<a href ='$links[1]'\>$title[1]</a>";
echo "</td></tr>";
}
echo "</table>";
?>
|
|
|
11-05-2004, 03:22 AM
|
#7 (permalink)
|
|
Inactive
Join Date: 10-26-03
Posts: 2,466
Latest Blog: None
|
Hatchet, you're a star. 
|
|
|
11-05-2004, 11:10 PM
|
#8 (permalink)
|
|
Inactive
Join Date: 08-07-04
Location: New Orleans, LA USA
Posts: 11
Latest Blog: None
|
Brian, I have been trying to do the same thing, but am much less experienced at it. I think that my web server has to be contacted before these scripts will work correctly. Did you ever figure out if the text can be spidered?
Best,
Mark
|
|
|
11-07-2004, 12:42 AM
|
#9 (permalink)
|
|
Inactive
Join Date: 05-05-04
Location: america
Posts: 653
Latest Blog: None
|
May I ask what a rss feed is?
|
|
|
11-07-2004, 08:34 AM
|
#10 (permalink)
|
|
Contributing Member
Join Date: 02-23-04
Location: midwest
Posts: 442
|
i've tried that script and it doesn't work. all it does is display, "latest news" and only the first headline formatted in 3 separate cells ... a friend of mine gave me a link to another that actually works ... lemme look for it and i'll post the url here
|
|
|
11-07-2004, 08:51 AM
|
#11 (permalink)
|
|
Contributing Member
Join Date: 02-23-04
Location: midwest
Posts: 442
|
here it is: http://www.rjk-hosting.co.uk/programs/prog.php?id=7
just download the script and insert it where you you need it. then replace the url with the feed you want. the bottom portion of the script controls how the feed is displayed, font sizes, color and so on ...
|
|
|
11-07-2004, 05:22 PM
|
#12 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
Huh - never had any problems with that script. Must've been installed incorrectly.
Is it working for you I,Brian?
|
|
|
11-07-2004, 05:28 PM
|
#13 (permalink)
|
|
Inactive
Join Date: 08-07-04
Location: New Orleans, LA USA
Posts: 11
Latest Blog: None
|
With (RSS), Really Simple Syndication feed, advanced users can have new headlines and article previews delivered in an RSS reader or aggregator. RSS offers a convenience because you can subscribe to feeds from several sources and automatically aggregate headlines from all the sources into one list. You can quickly browse the list of new content without visiting each site to search for new info of interest. By having these scripts fed directly to a location on a website you are adding to and changing page content automatically. I'm not sure that the spiderbots can read the script because no one answered my question either.
Best,
Mark
Last edited by thezman : 11-07-2004 at 05:31 PM.
|
|
|
11-08-2004, 08:22 AM
|
#14 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
The links can be spidered while it's there.. as you said it's continually updating. So what the bot sees one day may not be there the next. I suppose you could put a link to an archive of all the links - the rss feed would have to be modified I would think.
|
|
|
11-08-2004, 09:55 PM
|
#15 (permalink)
|
|
Inactive
Join Date: 08-07-04
Location: New Orleans, LA USA
Posts: 11
Latest Blog: None
|
Thank you, Hatchet.
|
|
|
11-08-2004, 11:27 PM
|
#16 (permalink)
|
|
Contributing Member
Join Date: 02-23-04
Location: midwest
Posts: 442
|
hatchet, it's quite odd though if my current php scripts work and this one doesn't ... but, if it works for i,brian, then no matter ... 
|
|
|
11-09-2004, 06:55 PM
|
#17 (permalink)
|
|
v7n Mentor
Join Date: 10-11-03
Posts: 1,137
Latest Blog: None
|
It could be that the particular rss feed just doesn't work with it.. who knows.. 
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
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
|
|
|
All times are GMT -7. The time now is 06:36 AM.
© Copyright 2008 V7 Inc
|