aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2011-10-27 19:30:57 +0900
committermattn <mattn.jp@gmail.com>2011-10-27 19:30:57 +0900
commitb90f5fc03f8e4a10db9e7dedc7c0544eb72939db (patch)
tree0e2c96344281925ba44741f62e0f03b6f0b3f915
parent724cf9e720336322ea43cac08230e58ad308c0f1 (diff)
downloadvim-sonictemplate-b90f5fc03f8e4a10db9e7dedc7c0544eb72939db.tar.gz
vim-sonictemplate-b90f5fc03f8e4a10db9e7dedc7c0544eb72939db.tar.bz2
vim-sonictemplate-b90f5fc03f8e4a10db9e7dedc7c0544eb72939db.zip
scraping.perl
-rw-r--r--template/scraping.perl16
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";
+}