#!/usr/bin/perl -w # Prints a list of all the dates that have posts with # the 'top' tag, with a count of the number of posts per day. # You probably don't have a 'top' tag, or even know what I'm on # about, in which case just comment out that check for /top/ # in the loop below... # It should be possible to do a lot of this using # $del->posts_per_date() but I couldn't get it to work... # 2004-12-16 # Phil Gyford - phil@gyford.com # http://www.gyford.com/phil/writing/2004/12/16/posting_links_fr.php use strict; use Net::Delicious; my $delUser = 'username'; my $delPass = 'password'; my $del = Net::Delicious->new({ user => $delUser, pswd => $delPass }); my @posts = $del->all_posts(); my %dates; for my $post (@posts) { # We're only counting posts tagged with 'top'. if ($post->tags =~ /top/) { # Get rid of the time - just want the date. my $year = substr($post->time, 0, 10); if (!exists( $dates{$year} )) { $dates{$year} = 1; } else { $dates{$year}++; } } } foreach my $year (sort keys %dates) { print "$year - $dates{$year}\n"; }