Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 30 lines (21 sloc) 0.796 kb
fcc5114 @petdance first draft of rebuilt scraps
authored
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use 5.10.0;
6
7 my (undef,$meat) = <>; # Skip XML doc line
8 while ( $meat =~ m{<envelope([^>]*)>(.*?)</envelope>}gsm ) {
9 my $package = $2;
10
11
12 $package =~ s{<sender([^>]*)>(.+?)</sender>}{};
13 my $sender = $2;
14 say "* **$sender**";
15
16 while ( $package =~ m{<message id=".+?" received="(.+?)">(.+?)</message>}g ) {
17 my ($stamp,$message) = ($1,$2);
18
19 my ($date,$time,$tz) = split / /, $stamp;
20
21 $message =~ s{<span.+?>(.+?)</span>}{$1}g;
22 $message =~ s{<samp>(.+?)</samp>}{`$1`}g;
23 $message =~ s{<a href="(.+?)">(.+?)</a>}{[$2]($1)}g;
24
25 $message =~ s{([_*])}{\\$1}g; # Escape markdown specials
26 #$message =~ s{&gt;}{>}g; # Change HTML entities back
27 say " * $time: $message";
28 }
29 }
Something went wrong with that request. Please try again.