Welcome to Geeklog Monday, July 22 2019 @ 10:14 am EDT

Geeklog Forums

RSS feed in static page


cjc1103

Anonymous
I was wondering of there was any way to add an external RSS feed to a static page in a center block.
Thanks, Chris

Status: offline

Dirk

Site Admin
Admin
Registered: 12/01/02
Posts: 13073
Location:Stuttgart, Germany
Try a search - this has been discussed before.

bye, Dirk

johnb

Anonymous
I found a way, but it was a version of the rss in a javascript format.
It actually comes up pretty nice.
It may not be available for what you are wanting.
There probably is a way to get the rss to show up but it's beyond me.

Status: offline

tmarquez

Forum User
Regular Poster
Registered: 17/06/03
Posts: 70
You will have to do some coding and do a static page excuting PHP. I use PEAR RSS Parser. You can find it here:

http://pear.php.net/package/XML_RSS/

Here is an example of what my Static Page Looks like:

PHP Formatted Code

require_once "/server/example/public_html/XML_RSS-0.9.2/RSS.php";

$rss =& new XML_RSS("http://www.mygeeksite.net/backend/example.rdf");
$rss->parse();

$display .= "Latest Example News<br>";

foreach ($rss->getItems() as $item) {
    $title = stripslashes ($item['title']);
    $display .= "<li><a href="" . $item['link'] . "">"  .$title . "</a><br>";
   
}

echo $display;

 


Hope this helps.
T.Marquez Jr. - Webmaster - www.indianapolisfilm.net - Geeklog 1.4.0sr5-1

Status: offline

mst3kroqs

Forum User
Regular Poster
Registered: 18/10/05
Posts: 78
Location:Cary, NC USA
Just thought I'd add -

Folks on hosting providers may be constrained to use the 'PEAR tree' that comes with GeekLog itself. It is located in ~public_htmlsystempear.

You use this 'local' PEAR distribution by setting the $_CONF['have_pear'] option to false in config.php.

What I ran into was that while my hosting provider had installed PEAR (it is commonly found in /usr/lib/php/pear), I was unable to download and install the XML_RSS package, and the XML_Parser package that it depends on.

What I was able to do is 'hack' these packages into the GL-provided PEAR tree, by doing the following:

1) Download the XML_RSS package from:

http://pear.php.net/package/XML_RSS

2) untar, and move RSS.php (only) to the ~/public_html/system/pear directory.

3) Download the XML_Parser package from:

http://pear.php.net/package/XML_Parser

4) Untar, and move 'Parser.php' to the ~/public_html/system/pear/XML directory.

5) Create a directory: ~/public_html/system/pear/XML/Parser

6) Move 'Simple.php' (from the 'Parser' subdirectory created when you unpacked the .tgz) to the ~/public_html/system/pear/XML/Parser directory you just created.

7) To use: require_once( $_CONF['path] . "/system/pear/RSS.php" ), and then follow the rest of tmarquez's instructions!

BTW - this is not at all how you should install PEAR packages, but these packages seemed simple enough to allow this sort of brute-force insertion method.

It would be very kewl if the GL folks included these packages in the local PEAR tree for the next version of GL.

All times are EDT. The time is now 10:14 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content