App-Zapzi
view release on metacpan or search on metacpan
* Added Config helper module
0.006 2013-08-06 15:30:06 Asia/Hong_Kong
* Added HTML transformer for use when HTMLExtractMain does not give
desired output
* Added -t command line switch to allow selection of transformers
* Use UTF-8 to encode MOBI files
* Bugfix for article test
* Set Moo version dependency
* Handle HTML fragments as HTML in files
* Bugfix for HTML articles with no title
* Handle HTML pages with two title tags and extra whitespace
* Format title for text with leading whitespace and long lines
* Added config table plus support for schema versioning and upgrades
0.005 2013-07-12 22:42:11 Asia/Hong_Kong
* Better validation of URLs
* Handle UTF-8 text correctly
* --noarchive option to publish command
t/release-distmeta.t
t/release-pod-coverage.t
t/release-pod-syntax.t
t/release-test-version.t
t/testfiles/bad-markdown.txt
t/testfiles/distribute-script-echo.pl
t/testfiles/distribute-script-error.pl
t/testfiles/empty.html
t/testfiles/empty.txt
t/testfiles/html-font.html
t/testfiles/html-fragment.html
t/testfiles/html-links.html
t/testfiles/html-no-title.html
t/testfiles/html-two-titles.html
t/testfiles/html-utf8.html
t/testfiles/sample.html
t/testfiles/sample.pm
t/testfiles/sample.txt
t/testfiles/sample.unknown
t/testfiles/ws-and-long-lines.txt
t/04-fetch-article.t view on Meta::CPAN
isa_ok( $f, 'App::Zapzi::FetchArticle' );
ok( ! $f->fetch, 'Detects file that does not exist' );
like( $f->error, qr/Failed/, 'Error reported' );
$f = App::Zapzi::FetchArticle->new(source => 't/testfiles/empty.txt');
isa_ok( $f, 'App::Zapzi::FetchArticle' );
ok( ! $f->fetch, 'Detects file that is zero length' );
like( $f->error, qr/Failed/, 'Error reported' );
$f = App::Zapzi::FetchArticle->new(source =>
't/testfiles/html-fragment.html');
isa_ok( $f, 'App::Zapzi::FetchArticle' );
ok( $f->fetch, 'Fetch sample html fragment file from disk' );
like( $f->text, qr/This should still be treated as/,
'Contents of HTML fragment file OK' );
is( $f->content_type, 'text/html', 'Contents of fragment are HTML' );
}
sub test_get_url
{
my $f = App::Zapzi::FetchArticle->new(source => 'http://example.com/');
isa_ok( $f, 'App::Zapzi::FetchArticle' );
ok( $f->fetch, 'Fetch sample URL' );
is( $f->fetcher, 'URL', 'Text file was handled by URL fetcher' );
like( $f->validated_source, qr|http://.*example|,
'URL source was set by fetcher' );
t/testfiles/html-fragment.html view on Meta::CPAN
<p>This is a fragment of HTML text, ie without opening html/head/body
tags.</p>
<p>This should still be treated as HTML.</p>
( run in 1.959 second using v1.01-cache-2.11-cpan-b16cb0d3907 )