DreamHost Web Hosting
Discussion Forum


Forums
   >> Programming
Flat Mode*

Subject Re: Dreamhost's policy on remote file access [re: GloryFish.org]  
Posted byrlparker (DH Familiar)
Posted on04/21/05 01:55 PM


Jay-

I too am learning my way around this, so my answers should *not* be considered authoritative. Last night, however, I *did* manage to get my newsfeeds back using magpierss. All my domains in question are running PHP as CGI (DH recommended and now the DH default for new domains). User macmanx also reports using magpie without any problems.

To see my quick-and-dirty workaround in action you can visit http://www.helium-labs.com/ and select the "Science News" link or, for another example (of the code I included below) visit http://www.cgiservices.net/sciencenewsx.php.

In the hope that this could be of help to you, I suggest you:

1) Get the latest magpierss from sourceforge (magpierss-0.71.1.tar.gz as of last night)

2) Install into a web accessable directory as per instructions included in the tarball. The only trick here (if you don't want to edit the class file) is to store the 5 indicated files into a directory called magpierss.

3) edit/modify one (or more) of the example .php files included in the tarball to reflect your needs.

4) Integrate those edited .php files into your site to display content as desired.

I did not find any problems with "reguiring" the necessary files to operate magpie.

I have included a short example .php file that worked for me, showing two different methods of callilng the rss feed with the magpie rss_fetch function:

--- begin code ------

<html>
<head>
<title>News</title>
<link href="http://www.helium-labs.com/templates/rhuk_solarflare_ii/css/template_css.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<?
require_once('magpierss/rss_fetch.inc');

$url = 'http://rss.news.yahoo.com/rss/science';
$rss = fetch_rss( $url );

echo "<B>Latest From: " . $rss->channel['title'] . "</b><BR>";
echo "(Links will open in a new window)<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href target='is_blank'>$title</a></li>";
}
echo "</ul><P>";

$rss = fetch_rss('http://news.search.yahoo.com/news/rss?p=RFID+Privacy&ei=UTF-8&fl=0&x=wrt');
echo "<B>Latest from: " . $rss->channel['title'] . "</b><BR>";
echo "(Links will open in a new window)<p>";
echo "<ul>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<li><a href=$href target='is_blank'>$title</a></li>";
}
echo "</ul><P>";
?>
</body>
</html>

------ end sample code ---------

A file similar to this one (I used my Mambo stylesheet, and didn't particularly code it pretty!), that lives is the directory *above* your "magpierss" folder installed per the instruction in the tarball should work; it works well for me and can be included itself as needed in your code or wrapped in an iframe (which is what I did for a quick and dirty implementation in Mambo to replace the now-broken Mambo newsfeed component).

To me, this seemed easier and quicker than grappling with cURL, though i *do* intend to attack that another day.

Regards,

rlparker




 
Entire thread
Subject  Posted byPosted on
*Dreamhost's policy on remote file access  ironikart03/17/05 01:10 PM
.*Re: Dreamhost's policy on remote file access  Skybly03/20/05 04:22 AM
.*Re: Dreamhost's policy on remote file access  Jeff @ DreamHostAdministrator03/17/05 05:55 PM
.*Re: Dreamhost's policy on remote file access  webgods04/20/05 07:16 PM
.*Re: Dreamhost's policy on remote file access  user91903/17/05 03:08 PM
.*Re: Dreamhost's policy on remote file access  Gary03/18/05 11:03 AM
.*Re: Dreamhost's policy on remote file access  Gary04/20/05 03:52 PM
.*Re: Dreamhost's policy on remote file access  Jeff @ DreamHostAdministrator04/20/05 05:27 PM
.*Re: Dreamhost's policy on remote file access  rlparker04/20/05 10:33 PM
.*Re: Dreamhost's policy on remote file access  webgods04/21/05 03:08 AM
.*Re: Dreamhost's policy on remote file access  Gary04/21/05 08:09 AM
.*Re: Dreamhost's policy on remote file access  GloryFish.org04/21/05 12:42 PM
.*Re: Dreamhost's policy on remote file access  dallasModerator04/21/05 06:59 PM
.*Re: Dreamhost's policy on remote file access  DanGarion04/26/05 03:48 PM
.*Re: Dreamhost's policy on remote file access  webgods04/29/05 00:16 AM
.*Re: Dreamhost's policy on remote file access  webgods04/21/05 08:55 PM
.*Re: Dreamhost's policy on remote file access  dallasModerator04/21/05 11:55 PM
.*Re: Dreamhost's policy on remote file access  miikka04/29/05 00:30 AM
.*Re: Dreamhost's policy on remote file access  sturm04/29/05 01:15 PM
.*Re: Dreamhost's policy on remote file access  miikka04/29/05 01:35 PM
.*Re: Dreamhost's policy on remote file access  dallasModerator04/29/05 04:42 PM
.*Re: Dreamhost's policy on remote file access  webgods05/02/05 04:00 AM
.*Re: Dreamhost's policy on remote file access  ozgreg05/02/05 06:34 AM
.*Re: Dreamhost's policy on remote file access  webgods05/03/05 00:49 AM
.*Re: Dreamhost's policy on remote file access  webgods04/22/05 10:49 AM
..Re: Dreamhost's policy on remote file access  rlparker04/21/05 01:55 PM
.*Re: Dreamhost's policy on remote file access  GloryFish.org04/21/05 02:01 PM
.*Re: Dreamhost's policy on remote file access  scjessey04/21/05 02:27 PM
.*Re: Dreamhost's policy on remote file access  GloryFish.org04/21/05 02:38 PM
.*Re: Dreamhost's policy on remote file access  rlparker04/21/05 02:32 PM
.*Re: Dreamhost's policy on remote file access  rlparker04/21/05 02:14 PM
.*Re: Dreamhost's policy on remote file access  GloryFish.org04/21/05 02:20 PM
.*Re: Dreamhost's policy on remote file access  jrahaim04/21/05 01:38 PM
.*Re: Dreamhost's policy on remote file access  GloryFish.org04/21/05 01:55 PM
.*Re: Dreamhost's policy on remote file access  macmanx04/20/05 04:18 PM
.*Re: Dreamhost's policy on remote file access  Gary04/20/05 05:33 PM
.*Re: Dreamhost's policy on remote file access  TheNinthPlayer03/18/05 05:30 PM
.*Re: Dreamhost's policy on remote file access  TheNinthPlayer03/18/05 05:35 PM
Jump to