diff options
author | Stefan Ritter <xeno@thehappy.de> | 2011-08-16 10:51:41 +0200 |
---|---|---|
committer | Stefan Ritter <xeno@thehappy.de> | 2011-08-16 10:51:41 +0200 |
commit | ba46c304bdffdce0b6019a47f6759ce6abbeef90 (patch) | |
tree | 40a5b204637cb65c5bb91bd4f26a248ea498e019 /parse-fileext.pl |
Initial commit
Diffstat (limited to 'parse-fileext.pl')
-rw-r--r-- | parse-fileext.pl | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/parse-fileext.pl b/parse-fileext.pl new file mode 100644 index 0000000..cde0758 --- /dev/null +++ b/parse-fileext.pl @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +#use strict; +#use warnings; +use Web::Scraper; +use URI; +use HTML::Entities; +use Encode; +use URI::Escape; +use LWP::UserAgent; + +my $scrap; + +my $wikiurl = "http://filext.com/file-extension/$ARGV[0]"; + +my $scrapp = scraper { + process '//table/tr/td', 'chars[]' => 'TEXT'; +}; +my $url = URI->new($wikiurl); +my $blubb = $scrapp->scrape($url); +my $list = $blubb->{'chars'}; + +binmode(STDOUT, ":utf8"); + +for($i = 0; $i <= $#$list;$i++) { + if ($$list[$i] =~ /^Extension: $ARGV[0]$/i) + { + print "$$list[$i+4]\n"; + } +} |