From ba46c304bdffdce0b6019a47f6759ce6abbeef90 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Tue, 16 Aug 2011 10:51:41 +0200 Subject: Initial commit --- parse-fileext.pl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 parse-fileext.pl (limited to 'parse-fileext.pl') 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"; + } +} -- cgit v1.2.3