The Clockwork Mansion

Village Square => The Lost Lake Inn => Topic started by: spacewarp on July 11, 2012, 06:14:16 PM

Title: DMFA RSS
Post by: spacewarp on July 11, 2012, 06:14:16 PM
Hello everyone. As a long-time reader of DMFA and user of Google Reader I've been slightly annoyed at the lack of a DMFA RSS feed. However, instead of complaining about it I decided that as a programmer with a mostly unused server I could make one myself. So I did.

It's been working wonderfully for a while now so I though that maybe I should share. I'm hoping that for once one of my projects may benefit others :)

TLDR; http://spacewarp.se/DMFA.php (http://spacewarp.se/DMFA.php) spacewarp.se/DMFA (http://spacewarp.se/DMFA) now serves a valid DMFA RSS :D
Title: Re: DMFA RSS
Post by: Tapewolf on July 11, 2012, 06:35:01 PM
Cool.  Actual RSS support has long been promised for the site rebuild, but things seem to have stalled with that again.

It's perhaps also worth noting that DMFA is announced on Twitter.  I believe the URL is https://twitter.com/Ambaaargh
Title: Re: DMFA RSS
Post by: llearch n'n'daCorna on July 12, 2012, 04:26:44 AM
*makes notes* We may request the code for that, soas to simply duplicate it across to the new format.

Or we may not. Depends on how things work out...
Title: Re: DMFA RSS
Post by: spacewarp on July 12, 2012, 04:55:34 AM
Well, I've poked at the server configuration so the code is openly available from http://spacewarp.se/DMFA/ (http://spacewarp.se/DMFA/). The code isn't commented but is quite short (only 250 lines total), simple and well-named (hurray Python :) ).
Title: Re: DMFA RSS
Post by: llearch n'n'daCorna on July 12, 2012, 06:49:03 AM
Ah. So.. you're using php to call python to generate xml.

I...

Honestly, I'm not sure what to say. >.<
Title: Re: DMFA RSS
Post by: Turnsky on July 12, 2012, 07:02:37 AM
Quote from: llearch n'n'daCorna on July 12, 2012, 06:49:03 AM
Ah. So.. you're using php to call python to generate xml.

I...

Honestly, I'm not sure what to say. >.<

This? (http://www.youtube.com/watch?v=GEStsLJZhzo)  >:3
Title: Re: DMFA RSS
Post by: spacewarp on July 12, 2012, 07:03:46 AM
Hahaha...  

The first draft for the system was pure php, but I simply like python a whole lot better. I would have made apache run the python script directly, but then I would have to add a bunch of code to handle the protocol as well as xml output. Also, the php step turned out to be necessary to make the system run with correct text encoding.
Title: Re: DMFA RSS
Post by: llearch n'n'daCorna on July 12, 2012, 07:07:37 AM
... why? All you need to do is mod_python or wsgi, and then print to stdout, and apache will handle everything else.

... which is all you're doing anyway.

See http://www.ossramblings.com/node/380 for example...
Title: Re: DMFA RSS
Post by: spacewarp on July 12, 2012, 07:18:58 AM
Honestly I pretty much forgot about that... I blame it on me setting it up at 1 AM. It was easier to avoid the problem than fix it. But now that you've (with horror :)) pointed it out I'm feeling ashamed enough to try again :)
Title: Re: DMFA RSS
Post by: llearch n'n'daCorna on July 12, 2012, 07:27:01 AM
Hehehehe. Good luck with that, then.
Title: Re: DMFA RSS
Post by: spacewarp on July 12, 2012, 08:06:25 AM
There you go :) After some .conf poking spacewarp.se/DMFA (http://spacewarp.se/DMFA) now runs the RSS output program directly. I feel a bit silly now as apparently I already had wsgi installed, just not used. spacewarp.se/DMFA.php (http://spacewarp.se/DMFA.php) now provides short info and source instead of RSS.
Title: Re: DMFA RSS
Post by: Darkmoon on July 12, 2012, 07:52:36 PM
Depending on what we do with the site redesign, RSS may get automated by the server itself. It is on CVRPG, so there's an easy possibility.
Title: Re: DMFA RSS
Post by: Damaris on July 12, 2012, 11:38:47 PM
Thank you for putting in the effort, Spacewarp. I'm sure many people are currently thrilled :)
Title: Re: DMFA RSS
Post by: Arcblade on July 14, 2012, 11:04:54 AM
There's also this one, which I did not write I'm afraid.  www.comicsyndicate.org/Comics/Rss/175 (http://www.comicsyndicate.org/Comics/Rss/175) 
Title: Re: DMFA RSS
Post by: spacewarp on July 14, 2012, 11:40:21 AM
Quote from: Arcblade on July 14, 2012, 11:04:54 AM
There's also this one, which I did not write I'm afraid.  www.comicsyndicate.org/Comics/Rss/175 (http://www.comicsyndicate.org/Comics/Rss/175)  

For me that url just generates a long error message about incorrect authentication. That can't just be me can it?

[Edit] Never mind, a few reloads later it randomly works :I

I'll claim my feed to be better though, as I also grab the rant at time of update :)

[Edit 2] Speaking of which, I've been thinking about updating the code to also grab non-update rants. Thoughts?
Title: Re: DMFA RSS
Post by: Mao on July 14, 2012, 12:37:58 PM
I'd be a bit careful with that.  Mab seems to not like having her rants archived for the world to see.
Title: Re: DMFA RSS
Post by: spacewarp on July 14, 2012, 01:00:32 PM
Quote from: Mao on July 14, 2012, 12:37:58 PM
I'd be a bit careful with that.  Mab seems to not like having her rants archived for the world to see.

Hmm, well then I suppose it's a good thing I decided not to make the RSS accept a way to go back in time to older posts.
Title: Re: DMFA RSS
Post by: llearch n'n'daCorna on July 14, 2012, 04:07:56 PM
Quote from: Damaris on July 12, 2012, 11:38:47 PM
Thank you for putting in the effort, Spacewarp. I'm sure many people are currently thrilled :)

This is why we keep Damaris around. She's the one who knows how to say "thankyou" ;-]