diff options
author | mattn <mattn.jp@gmail.com> | 2011-10-27 19:30:57 +0900 |
---|---|---|
committer | mattn <mattn.jp@gmail.com> | 2011-10-27 19:30:57 +0900 |
commit | b90f5fc03f8e4a10db9e7dedc7c0544eb72939db (patch) | |
tree | 0e2c96344281925ba44741f62e0f03b6f0b3f915 /template/scraping.perl | |
parent | 724cf9e720336322ea43cac08230e58ad308c0f1 (diff) | |
download | vim-sonictemplate-b90f5fc03f8e4a10db9e7dedc7c0544eb72939db.tar.gz vim-sonictemplate-b90f5fc03f8e4a10db9e7dedc7c0544eb72939db.tar.bz2 vim-sonictemplate-b90f5fc03f8e4a10db9e7dedc7c0544eb72939db.zip |
scraping.perl
Diffstat (limited to 'template/scraping.perl')
-rw-r--r-- | template/scraping.perl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/template/scraping.perl b/template/scraping.perl new file mode 100644 index 0000000..ffb696d --- /dev/null +++ b/template/scraping.perl @@ -0,0 +1,16 @@ +use strict; +use warnings; +use utf8; +use Web::Scraper; +use URI; + +my $scraper = scraper { + process '{{_cursor_}}', 'data' => 'TEXT'; + result 'data'; +}; +$scraper->user_agent->env_proxy; + +use YAML::Syck; +for (@{$scraper->scrape( URI->new('') )}) { + print $_->{data}, "\n"; +} |