File: entities.pl

package info (click to toggle)
libmojolicious-perl 2.98%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,968 kB
  • sloc: perl: 10,178; sh: 48; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 475 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use FindBin;
use lib "$FindBin::Bin/../lib";
use Mojo::Base -strict;

# "She's built like a steakhouse, but she handles like a bistro!"
use Mojo::ByteStream 'b';
use Mojo::UserAgent;

# Extract named character references from HTML5 spec
my $tx
  = Mojo::UserAgent->new->get('http://dev.w3.org/html5/spec/single-page.html');
b($_->at('td > code')->text . $_->children('td')->[1]->text)->trim->say
  for $tx->res->dom('#named-character-references-table tbody > tr')->each;

1;