Scripting News: What is a River of News aggregator?#

Michael Wolff on the future of The Guardian.#

2012: News isn’t just a product, it’s a community.#

​Lifehacker: Are Cheap Android Phones Worth It?#

Wired: Where to Watch Apple's WWDC Keynote. #

As I said yesterday, I'm working on an RSS engine in node.js. #

More information coming soon, Murphy-willing. #

One of the things I've seen is that people are being sloppy with their enclosure elements.#

"image" is not a valid type. It has to be a MIME type like image/gif or image/png.#

And length must be specified and correct. Omitting it or setting it to zero is wrong. It's really easy to make a HEAD request to get that information and put it in your feed.#

WordPress seems to be lax about the type attribute. So fixing this in one place will fix a lot of feeds, making them valid, all in one update. #

Today's background image is a lovely collection of vegetables.#

Shut up and eat your vegetables is a slogan stolen from my old friend Chuck Shotton. It was the slogan of his website or his email signature, or perhaps just Chuck's slogan about life. There is a fair amount of shutting up and eating your vegetables in modern life.#

Another use-case for vegetables is the wonderful Frank Zappa song, Call Any Vegetable. #

I love to play with background images here on Scripting News but sometimes for some people they are too much. So you can turn them on or off using the commands in the Links menu at the top of every page. #

I just changed the default today, from off to on. So you may be seeing images here for the first time. Or they may have disappeared for a couple of weeks, only to re-appear now. #

Sorry for the rock and roll, this is a new feature, and a new art. Still figuring out how it works from a human standpoint.#

Still diggin! #

First a disclaimer: I'm a JavaScript newbie, but I am not a newbie to dynamic-typed languages. I designed and implemented one.#

Until yesterday I didn't have an example of a situation where JavaScript's === operator was required. I still will only use it in specific cases where it's absolutely needed. But yesterday I came across a situation where it was needed, so I thought I should document it.#

The RSS enclosure element has three required attributes: url, length and type. But some feed developers fake it by putting in zero for the length. It's actually a violation of the spec, it says the values must be correct, but we'd rather not reject enclosures for this reason alone. This American Life is an example of a feed that punts on trying to put the correct value in the enclosure length attribute. #

My new code, which is fairly strict about following the spec, has a test that looks like this:#

if (enclosure.length == undefined) //please read the spec#

I think perhaps you can see where this is going?#

In the This American Life feed it was rejecting the enclosure, because zero coerces to the built-in value undefined. I think that's the mistake. undefined should not coerce to anything. A test against undefined should be clear enough without using ===. But JavaScript does do the coercion, so you have to use === in this case.#

© 1994-2014 Dave Winer.
Last update: Sat, Sep 20, 2014 at 5:42 PM.
Reallll soooon now...