Blog posts tagged "xml"

“Photocasting”

January 11th, 2006

James Holderness (check the comments)

Do you ever think maybe the Apple guys are just winding you up? Nobody could possibly be that stupid.

Maybe, though I tend to share Phil’s skepticism. Lets start the with the name, “photocasting”. Worst name I’ve heard since “MacBook”. I’d speculate that Apple’s marketing department recently started outsourcing to Engineering, except I’d be slandering my own profession. That’s a minor thing, aesthetic really, but dear god, how could they screw up the RSS? Again? (especially as I know people at Apple who are not only smart and clueful, but get XML)

I mean the iTunes name space was a train wreck. (though truth be told podcasting for some reason produces the scariest, wackiest feeds on the planet, at one point roughly 1/3 of the feeds Odeo was crawling had serious errors)

User agent detection? Of RSS? In 2006?!? Come again?

Embedded CSS? Misformatted dates? Random, namespace-less new elements (PhotoDate?) A new standard for including comments within an item.

See Phil’s comment, Sam, Dave Winer

Hey Apple, consider hiring someone who knows something about syndication, it’s worth it.

Take a look (unless of course you’re using Firefox).

update: [2005/01/18] MarkP on “photocasting”. It’s not just bad, it’s spectaculary bad. (via)

Tagged: Uncategorized , , , , ,

PrinceXML: XSLT Alternative?

December 5th, 2005

I’ve had a todo item “Check out PrinceXML” since seeing it mentioned in ALA’s Printing a Book with CSS.

So I got so far as figuring out it wasn’t opensource, and seeing that the price was $349 dollars. Definitely makes me think I should probably shuffle that “Learn XSL” up the todo list again.

Still I’m very intrigued, and will probably download the trial version when I’ve got enough free time that I can pour some into learning a proprietary tool.

Anyone else played with it?

Tagged: Uncategorized , , ,

Conditional GET with LWP & Perl

March 1st, 2003

I was arguing recently that implementing a conditional GET with LWP is trivial and there was no reason why someone wouldn’t support it. I assumed there must be a dozen examples of how to do this. Afterall O’reilly has “open sourced” their original LWP book, there is an LWP cookbook, and reams of POD.

No Such Luck

Well a quick search didn’t turn up anything. A more concerted one might have but it was easier to write this example then keep searching. If you’re looking for more general info on Conditional GETs try Charles Miller’s HTTP Conditional Get for RSS Hackers. If you’re looking for an implementation in PHP, you might look in rss_fetch of my RSS parser/aggregator Magpie.

Conditional GET

The basic idea is, when you request a file you remember the ETag and Last-Modified HTTP headers, passing them along with your next request as If-None-Match and If-Last-Modified. If the file has changed then you’ll get the content as normal, if the file hasn’t changed you’ll get a ‘304 Not Modified’ header.

This is something of a toy example, but I try to be as correct as possible with it. Noteable in its absence is doing anything with the file you’ve fetched. (for example parsing and storing an RSS feed) Also I use a simple file to store ETag and Last-Modified, you might want to use a different backend.
See the Code

Example Code


use LWP::UserAgent;
use HTTP::Request;

my $url = "http://localhost/rss/laughingmeme.rdf";
my $cache_file = 'cache';
my %headers;

if ( -e $cache_file ) {
    open (CACHE, "< $cache_file") or die "Couldn't open: $!";
    %headers = (
        If_None_Match => <CACHE>,
        If_Last_Modified => <CACHE>
    );
    close CACHE;
}

my $ua = new LWP::UserAgent();
$ua->agent("Conditionally Enabled v0.1");

my $req = HTTP::Request->new( GET => $url );
$req->header(%headers);

my $res = $ua->request($req);
if ($res->is_success) {
    print "new!\n";
    # save ETag & Last-Modified
    open (CACHE, "> $cache_file") or die "Couldn't open: $!";
    print CACHE $res->header('ETag'), "\n";
    print CACHE $res->header('Last-Modified'), "\n";
    close CACHE;
}
elsif ( $res->code() eq '304' ) {
    print "not modified, go to cache\n";
    # do logic for RSS not modified
}
else {
    print "fooey! somthing went wrong\n";
}

Tagged: Uncategorized , , , , ,

Process & Collaboration

November 1st, 2002

Kendall’s latest, Community and Specifications includes

Megginson’s Four Laws of writing successful specs:
  1. Simplicity succeeds
  2. Process is poison
  3. Code first, then specify
  4. Almost every new spec fails anyway
(as the author of SAX presumably he knows of what he speaks)

In a similar vein, the David Clark quote I had as my sig for years (and am thinking of reviving)

“we reject kings, presidents and voting. we believe in rough consensus and running code.”
Been struggling with this of late, particularily in online organizing which exagerates communication problems; walking the line between enough process to stay transparent, and enough flexibility to stay open.

Tagged: Uncategorized , , , ,