Slashcode Log In
Mozilla sidebar
I've built something that I think was sorely lacking on Slashdot: a Mozilla sidebar. It's pretty cool, if I may toot my own horn:
http://r2d2.easydns.com/~cmv/slashdot/
The headlines and info comes from the XML feed. The icons are grabbed from Slashdot as needed, resized, PNG-ed, and stored locally.
Now, the sidebar is *NOT* available to the entire world, so don't go posting that URL everywhere (I've taken off the link to load the sidebar). That server isn't designed to handle huge loads.
However, I've had an email convo with Rob Malda where I said I'm happy to share the source code so that Slashdot could provide this service directly from their site.
His response was:
If you ported that to Slashcode (www.slashcode.com) I'm almost certain it would be live on Slashdot a week or 2 later. The only thing you'd have to make certain is that the page itself was a static piece of HTML and regenerated every 30 minutes, so millions of sidebar loads wouldn't kill us.
Very cool tho. I've seen several attempts to make a good sidebar, but thats the first that looks good.
So
Is there somebody here who would be interested in helping me port my code to slashcode? I suppose, once it is ported, it would be an additional server for not only Slashdot, but any site that uses the same code
Comments?



Getting Help... (Score:1)
Based on your description, it sounds like what you've got could be generalized to generate a side-bar based on any RDF feed (allthough maybe not ... I'm not sure where you're getting the comment counts, or topic/image -- since those aren't in the feed [slashdot.org])
"Porting to slashcode" would be very easy ... make it a command line perl script that can read the RDF file from disk, and write out a file in whatever format the side-bars are in, and it can be run as a regular "task"
As for getting people to help you rewrite it in perl, the folks over at PerlMonks [perlmonks.org] could probably lend a hand. If you submit a post that:
Re:Getting Help... (Score:1)
Re:Getting Help... (Score:1)
Not in the RDF feed to which you linked, but in the sitename.xml file. If you look at http://slashdot.org/slashdot.xml:
<story>0 38210</url>
<title>Pioneer DVR-A05 Review</title>
<url>http://slashdot.org/article.pl?sid=02/10/21/
<time>2002-10-21 12:47:56</time>
<author>Hemos</author>
<department>learning-'bout-it</department>
<topic>137</topic>
<comments>28</comments>
<section>articles</section>
<image>topichardware.gif</image>
</story>
The comment count as well as topic and image are listed. There's no absolute URL for the image, but with a Slash-based site, you could probably assume domain/images/topics/.
I don't see why the "sidebar" functionality couldn't be placed in a standalone script. If all you're doing is interpreting the XML and resizing images, you could just code a quickie script to run out of cron. Or perhaps make it a task for slashd, maybe after new XML/RSS/RDF files are written.
After seeing this post during the weekend, I coded up a quickie CGI [perldude.org] to take any slash-style XML feed and whip it into the format in Greedo's sample image. The whole thing is highly inefficient, as no images are cached locally, but it was just more of a POC for myself. Obviously, this would be a cool addition to Slashcode itself (or the slashd process), but it can be easily made into a server-side cron job or a standalone cgi/php page.
Apologies, Greedo, if I've violated any copylefts ;)
--
Kill-HUP.com [kill-hup.com], proudly running Slash since 1/28/2002.
Re:Getting Help... (Score:1)
Guess I'll have to revisit some of Kill-HUP's topic icons...
--
Kill-HUP.com [kill-hup.com], proudly running Slash since 1/28/2002.
Re:Getting Help... (Score:1)
Anyway, my goal (I think) was to make this part of the slashcode code, so that sites that use slash will have automatically generated XML, RSS, RDF and now Moz sidebar feeds. Basically, make the flat HTML file at the same time the other feeds are made (and cache the images locally of course).
Looks like your CGI is a great start
Re:Getting Help... (Score:1)
I did manage to get it down to a task capable of running under slashd. I opted to make it a separate task, as not to clutter the open_backend util. Makes it a great add-in, even for sites running "older" slash versions who aren't looking to upgrade.
If I get a chance to clean up the code a bit more, I'll be sure to post something.
--
Kill-HUP.com [kill-hup.com], proudly running Slash since 1/28/2002.
It's easy (as in "copy existing code") (Score:1)
You can tell from the filename that we just changed the code for ultramode.txt (which wrote out a preliminary version of an rss feed) and added some html tags for the sidebar. All story information was already in the DB query for ultramode.txt. Our /ultramode.html is in fact just a symbolic link to /ultramode.txt [symlink.ch].
So all that needs to be done is find the place where the rss file is written, and edit it to write out the sidebar file contents in HTML
--
symlink.ch [symlink.ch]: YAGSS - yet another German slash si
Sounds nifty! (Score:2)
or at the very least giving you whatever
assistance you might need to assist you
with a port.
Email me: cliff at slashdot dot org.
:D
source code (Score:1)
File used to add sidebar to Mozilla (just javascript code):
http://r2d2.easydns.com/~cmv/slashdot/add.phps
Outer HTML page:
http://r2d2.easydns.com/~cmv/slashdot/sidebar.php
Inner HTML page (does all the XML stuff):
http://r2d2.easydns.com/~cmv/slashdot/sidebar-inn
Image manipulation function:
http://r2d2.easydns.com/~cmv/slashdot/img_manip.p
Stylesheet
http://r2d2.easydns.com/~cmv/slashdot/style-sideb
The 4 pages that make up the actual sidebar could probably be reduced to 2 (inner and outer HTML), maybe even 1, since the goal would be to have a server side script to all the parsing and output to a flat HTML file every 15 minutes or so
Anyway, let me know what more I can do to help! An "official" Slashdot Mozilla Sidebar would be doubleplusgood.
Better code (Score:1)
http://r2d2.easydns.com/~cmv/slashdot/mozbar.ph
My Attempt (Score:1)
Anyone interested in taking a peek can visit the project page I've set up [perldude.org] and feel
--
Kill-HUP.com [kill-hup.com], proudly running Slash since 1/28/2002.
Re:My Attempt (Score:1)
Of course, that's just one geek's opinion ;)
Feel free to check out the code [perldude.org] or take a look at the bar in action [kill-hup.com].
--
Kill-HUP.com [kill-hup.com], proudly running Slash since 1/28/2002.