Skip to content

Instantly share code, notes, and snippets.

View hippietrail's full-sized avatar

Andrew Dunbar hippietrail

  • Georgetown
  • 09:14 (UTC +08:00)
View GitHub Profile
@hippietrail
hippietrail / stripgutenberg.pl
Created December 22, 2010 18:59
Strip headers/footers from Project Gutenberg texts
#!/usr/bin/perl
# stripgutenberg.pl < in.txt > out.txt
#
# designed for piping
# Written by Andrew Dunbar (hippietrail), released into the public domain, Dec 2010
use strict;
my $debug = 0;
@hippietrail
hippietrail / html2txt.pl
Created December 22, 2010 18:52
Strip HTML but retain block/inline structure
#!/usr/bin/perl
# TODO img alt text?
# TODO turn into a module so randomwikipage.pl can use it
use strict;
use Encode 'decode_utf8';
use File::DosGlob;
use HTML::Parser;