|
Posted by Andrew @ Rockface on 05/10/05 18:32
Andrew wrote:
> Download LastRSS and extract LastRSS into a conveinient directory, for
> example in a folder called classes in the same directory as your page.
>
> <?php
> include 'classes/lastRSS.php';
> $rssfeed = new lastRSS;
> /* see below on these next 2 lines */
> $rssfeed->cache_dir = 'classes/rsscache';
> $rssfeed->cache_time = 30*60;
> $ascfeed =
>
$rssfeed->get('http://www.your.to/the/rss/feed/of/your/favourite/cheese.rss'
);
>>
>
> You're probably going to want the cache feature of this class created
> a directory in classes called rsscache so you have /classes/rsscache/
> and make sure it's chmodded to 777 so PHP can write to it.
>
> What you're left with is an associative array. You'll have to
> formulate how to use this because obviously you want to fit it in
> with your page. If you're unsure of how to use it, then I suggest
> you checkout the PHP manual at http://www.php.net/array nearly
> everything in the PHP manual is very well documented.
>
> It should be noted I typed this rather quickly after a quick scan down
> the lastRSS class code (I never even downloaded it), so I might be
> ignorant of some major functionality or requirements. Some things I
> did notice about it are:
>
> - It doesn't seem to have much error control is something goes wrong
> - It makes use of fopen for an URL without validation, meaning fopen
> URL wrappers have to be and you shouldn't allow any way for visitors
> to enter their own rss feed. (if intentionally or by accident)
> - It uses regular expressions when PHP has several built in XML
> parsers that'd do the job.
>
> But it'll get the job done, I hope i've been of a little help.
Thanks for that. I was going to chop some of my code to post but then work
got in the way :)
--
Andrew @ Rockface
www.rockface-records.co.uk
"Pablo Picasso never got called an asshole"
Navigation:
[Reply to this message]
|