Sunday, March 30, 2003

Amphetadesk Date Mod

I really like Amphetadesk, it allows me to rapidly wade through entries from various blogs without waiting for the remote website to load. While it does indicate if a site has been recently updated, it doesn't indicate the entry time for each story (not all feeds have this functionality). The following code will solve this problem (if the originating site uses dc:date in it's output)(I freely admit that I don't yet understand the differences between RSS, RDF, XML feeds and their variants.).

This mod sort of falls in with Ned Batcheld's and Morbus Iff's conversations about "Local Webservers as Applications" and "Amphetadesk Customizability".

Edit Amphetadesk/templates/default/headlines.html (in v 0.93.1). After the section which reads:

# display the actual item.
to_browser(qq{

\n});
to_browser(qq{ {link}" target="$link_target">\n}) if $item->{link};
to_browser(qq{ $item->{title} \n}) if $item->{title};
to_browser(qq{
\n}) if $item->{link};
to_browser(qq{

\n});

Add the following:

if($item->{"dc:date"}) {
   my ($itemdate,$itemtime)=split(/T/,$item->{"dc:date"});
   to_browser(qq{

\n});
   to_browser(qq{ $itemdate $itemtime });
   to_browser(qq{

\n});
}

No comments:

Post a Comment