Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


iWantToKeepAnon (686)

The Fine Print: The following are owned by whoever posted them. We are not responsible for them in any way.
Tuesday May 20, 14
04:40 PM
Code

Pull req#188. At this rate I'm set to become the build manager or something. NOT! ...

Added a close tag for the anchors in the report table. I found this when I found the misplaced partial anchor tag in 'headMessage;misc;default' in pull request 184.

Unlike 184, this wasn't creating a problem b/c browsers automatically closed the anchor when it saw the TD close. This is just cleaner and won't cause issues if the HTML is changed.

'topAbusers;users;default' already contains the close tag. So this also makes things consistent.

Wednesday May 14, 14
10:20 PM
Code

I just committed a code change to Soylent new's slashcode :)). #184 here.

There was a random errant anchor opening tag with no close. Either a vestige of old code or copy and pasted by accident. It ate up HTML code up to the next either qoute or anchor close. Either way it was eating up the left side panel up to the About link in Navigation.

This is/was in the file "themes/default/templates/headMessage;misc;default", so it was messing up the dev site. Being template code, I don't know if this would have ever migrated to production or not. Just nice to give back a little. :))

Monday April 28, 14
10:32 PM
Code

I have a "method" to get RSS feeds from soylent WITH the article body. A simple cron scheduled bash script and 2 XSLT files.

  1. Download the 'index.rss' feed (save the ETag header and add 'If-None-Match:' header to respect server loads).
  2. If feed hasn't been updated, exit.
  3. XSLT 'rss.xsl' (first-pass) on RSS: for each article generate a unique filename (date/time stamp + URI encoded article title)
  4. For each unique filename, if it exists skip the next 2 steps
  5. Download article into temp file
  6. XSLT 'article.xsl': process the DIV.article element from the temp file into the unique filename (this is our article cache, we should not read an article twice to limit i/o and server loads).
  7. XSLT 'rss.xsl' (second-pass) on RSS: this is an identity template pass that recreates the 'index.rss' file (now named 'index-w-articles.rss'); except with one change-it adds a '<description>' element to each '<rss:item>' with the contents of the article (which was cached in the unique filename).
  8. If this 'index-w-articles.rss' is different from the last cron execution that's on my webserver, copy it over the last one for my feed reader to find.

The 'article.xsl' program uses tag-soup to handle HTML as a valid input document. This could be replaced by a perl script with regexp's to isolate the article body. But since we're using XSLT already this was a good option.

In database talk, I take the RSS "summary table" and use that information to create my own "article detail" table and then "join" them into a new RSS file which I put on my own server and point my feed reader here. I am a proxy to the real thing, just plus articles.

I schedule this once per hour (which is how my feed reader refresh is scheduled too, so no added load to soylent here). It downloads the articles exactly once (no images or js or css or etc...), from which the article body is extracted. A "get article" API in slashcode (is there one?) whould still cause one soylent hit, so this isn't excessive IMO.

Make sense? Anyone interested? This is definitely a stopgap measure until soylent can modify the official feed. I could put the code out there somewhere, tho I won't publish my feed url to save my bandwidth.