Stories
Slash Boxes
Comments

Slash Open Source Project

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • 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:

    1. Explains what you are trying to do.
    2. Includes whatever code you allready have (preferably perl, but if you've got PHP post that).
    3. Points out that it could be used on any RDF feed (assuming i'm right about that)
    ...then you'll probably get all sorts of advice on where to start, and what perl libraries will match up most closely to whatever PHP libraries you used.
    • by kill-hup (3279) <scott@kill-hup.com> on Monday October 21 2002, @10:54AM (#5385) Homepage
      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)

      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>
      <title>Pioneer DVR-A05 Review</title>
      <url>http://slashdot.org/article.pl?sid=02/10/21/0 38210</url>
      <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.

      • I've also learned that some images just don't scale well with Image::Magick, on the fly ;)

        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.

      • Looks nice, except for those resized images. :) I used the pnm shell functions to do my resizing, not Imagemagik. Although it looks like you just forgot to convert the GIF to a 24-bit colour image before resizing.

        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 ... just tweak the CSS a bit, make the table 100% width, ... :)
        • Oops, forgot about the GIF conversion. Makes all the difference in the world ;)

          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.