Subdomain Posts
Perl | 944 days ago
Perl | 944 days ago
CSS | 949 days ago
Recent Posts
None | 34 sec ago
None | 40 sec ago
PHP | 1 min ago
None | 1 min ago
None | 1 min ago
None | 2 min ago
VisualBasic | 2 min ago
None | 2 min ago
HTML | 3 min ago
None | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Plutor on the 19th of Aug 2007 10:00:49 PM
Download |
Raw |
Embed |
Report
#!/usr/bin/perl
# How I used this:
# I got all of the MetaTalk archives at <http://metatalk.metafilter.com/archive.mefi>
# and saved all of those pages. Then, I ran this script with all of the filenames as
# arguments. I posted the results here: <http://metatalk.metafilter.com/14744/Safety-first>
my %mval = ( January => 0,
February => 1,
March => 2,
April => 3,
May => 4,
June => 5,
July => 6,
August => 7,
September => 8,
October => 9,
November => 10,
December => 11 );
my @posts;
for my $filename (@ARGV) {
if (open(F
, "<", $filename)) {
my $f = <F>;
my ($month, $year) = ($f =~ /<p class="copy">(\w+) (200\d) Archives \(<a href="\/archive\.mefi\">all archives<\/a>\)<\/p>/);
$year -= 1900;
my ($day, $hour, $min);
while ($f =~ /<div class="monthday">(\w+) (\d+)<\/div>|<span class="smallcopy">posted by <a[^>]*>[^<]*<\/a> to <a[^>]*>[^<]*<\/a> at (\d+):(\d+) ([AP]M) PST - <a href="([^"]*)"/g) {
if ($1 and $2) {
$day = $2;
} elsif ($3 and $4 and $5) {
$hour = $3;
$min = $4;
$hour = 0 if ($hour == 12);
$hour += 12 if ($5 eq "PM");
$url = $6;
($name) = ($url =~ /\/mefi\/(\d+)/);
my $u = strftime('%s', 0, $min, $hour, $day, $mval{$month}, $year);
#print "$year-$mval{$month}-$day $hour:$min:00 $u $url\n";
push @posts, [ $u, $url, $name ];
}
}
} else {
warn "Could not open $filename: $!";
}
}
@posts = sort { $b->[0
] <=> $a->[0
] } @posts;
my $lastpost = shift @posts;
for my $p (@posts) {
my $diff = abs( $lastpost->[0
] - $p->[0
] );
if ($diff >= 24*60*60) {
print "<a href=\"$lastpost->[1]\">$lastpost->[2]</a> ";
print "and <a href=\"$p->[1]\">$p->[2]</a> - ";
}
$lastpost = $p;
}
Submit a correction or amendment below.
Make A New Post