Ficlets enhanced author feed, an XSL scraper hack
I've been trying to get myself serious about writing and even set up a personal slush pile for my output. Then, I found Ficlets, and spewed a few quick starter stories there. And then... I stopped. I'm hoping to pick it up again very soon, but I guess that's the nature of my serial enthusiasm—it doesn't just apply to hacking.
So, here's something ironic: I just spent a few hours tonight throwing together a hack for Ficlets. See, Ficlets runs on original stories, comments, ratings, and sequels and prequels to stories. You can get an Atom feed of an author's stories and a feed of comments—but it seems like there's no way to get notified of prequels and sequels, which are a very gratifying part of the whole shebang.
With that in mind, check out this RSS feed:
That's a blend of all my stories, comments on my stories, as well as prequels and sequels found for my stories. Subscribing to that feed will give me updates whenever there's anything new in all the above. It's thrown together using a semi-crazy mix of my FeedMagick package for caching, and some XSL for scraping. If you'd like a feed like this of your own, just replace l_m_orchard
for your own author name in the author
parameter.
Please note, however, that this little service is hosted on my site and may go away at any time for any reason.
In case you're interested in what's under the hood, here's the quick and dirty XSL that's behind it:
This thing's made possible because the Ficlets feeds are XML, and so are the XHTML pages happily infested with microformats. If they ever go invalid, this scraper breaks. But, that's the nature of scrapers, and it works for now. Oh, and although they provide Atom, this feed is RSS 2.0. Why? Because it was easier that way. I might put some more effort into an Atom feed, but my itch has so far been scratched.
Archived Comments
I had already decided I was gonna grab your FeedMagick source and try to do something with it but this just gives me more incentive as a Ficlets lover. I recently read your thoughts on pipes and feel much the same way => meh to GUI, especially a buggy one. It seems much more satisfying to just tell php what I want done and watch it go rather than spend 20 minutes fiddling with a silly applet.
@meglar: Well, just to warn ya - FeedMagick needs a lot of work. :) I've got ideas for it, but have yet to get back around to it.
That may be the coolest thing ever. Good job!
@Kevin: One thing that might not be cool is that this XSL hits Ficlets.com once for each story in the feed to pick up the additional info, but I try to cache the feed on my end for about 20 minutes per author... so hopefully it doesn't put any more stress on your site than I might have done manually in opening all my stories in tabs to check for comments and prequels/sequels. :)
That's fine. I think we can handle it. We'll get prequels/sequels added to either the author feed or their own feed in the near future.
@Kevin: Yeah, I think the bare author feed is a good thing to leave alone. But, a personal author feed with comments and prequels/sequels and possibly notes would be excellent! You know, basically, notifications of significant events that'd bring me back to the site.
I'm also thinking it might be neat to gently spider through prequels and sequels on stories to map them out and track progress, but that's just a future hackery idea.
Is there any way for me to view the documents you are mashing up to generate the resulting RSS document? I am particularly interested in seeing how Microformats are being mashed up. Thanks!
Roger: Sure... Really, the only things I'm mashing up are the author Atom feed, like mine here:
http://ficlets.com/feeds/author/lmorchard
And then, I chase down each story in the feed, like this one:
http://ficlets.com/stories/1763
You can view source on a story page and see all the information sprinkled in there - look for 'abbr' tags and class names like 'pubdate' and 'hentry'. The pages are also valid XML, so they can be manipulated right in XSL.
I'm sure that many Ficlets fans are sad that Ficlets.com is no more. We are in the process of constructing Blurbtree.com a site that might be helpful for them. It's not a replacement for Ficlets, but it's a clean start and we'll build the site based on the feedback we get from the online community. Please give it a try and let us know what we can do to make it fit your needs. You can also get more information at our Blurbtree FAQ.