If I wanted to set up an RSS feed for my journal on a personal site (say, my UCC public-html area*), how hard would it be and what would I use**? What if I wanted to create a parallel site that aggregated everything I like to read in one place? Could that site also access locked LJ posts with appropriate authentication efforts? Is there a pre-
(
Read more... )
Comments 15
require_once('magpierss/rss_fetch.inc');
$rss=fetch_rss("http://theducks.livejournal.com/data/rss");
foreach( $rss->items as $item) {
$i++;
if ($i < 5) {
if ($i > 1) { echo ""; }
echo "$item[pubdate] - $item[title]
$item[summary]
Comment on this
";
}
}
echo "Archives";
?>
Reply
Reply
Reply
Reply
Unfortunately, it's written in Python, which is a lovely language for quick hacks like this one but you haven't listed it above...
Also, running it at UCC could be difficult because of the traffic filtering - LiveJournal is not free traffic. Things like Planet UCC are actually powered by machines outside the UWA network, and FTPed in automatically.
- David 'Zanchey' Adam
Reply
Indeed, the Planet UCC engine is written in Python and makes extensive use of the 'feedparser' module written by Mark Pilgrim. The HTML is also statically generated and uploaded to the UCC when required from a machine not inside the UCC.
The feedparser module is by critical acclaim the most flexible and powerful RSS/Atom parser available on the net (it parses something like 9 not-compatible versions of RSS) as well as Atom.
I am fairly sure you can get locked posts if you pass a valid Livejournal login cookie when you make the request (this might be interesting to implement).
. You'll want to look in the XMLParse2 module to see how to use feedparser.
As Zanchey covered, it's all in Python, but that's ok, because Python is better then PHP anyway.
Reply
Reply
Reply
Leave a comment