diff --git a/modules/acronym.pl b/modules/acronym.pl deleted file mode 100755 index d3aaac50..00000000 --- a/modules/acronym.pl +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl -w - -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -# quick and dirty by :pragma - -use LWP::UserAgent; - -my ($result, $acro, $entries, $text); - -if ($#ARGV <0) -{ - print "What is the acronym you'd like to know about?\n"; - die; -} - -$acro = join("+", @ARGV); - -my $ua = LWP::UserAgent->new; -$ua->agent("Mozilla/5.0"); - -my $response = $ua->post("http://www.acronymsearch.com/index.php", - [ acronym => $acro, act => 'search' ]); - -if (not $response->is_success) -{ - print "Couldn't get acronym information.\n"; - die; -} - -$text = $response->content; - -$acro =~ s/\+/ /g; - -if ($text =~ m/No result found/) -{ - print "Sorry, couldn't figure out what '$acro' stood for.\n"; - die; -} - -$entries = 1; -$entries = $1 if ($text =~ m/"2">(.*?) results? found/gi); - -print "$acro ($entries entries): "; - -$acro=""; - -while ($text =~ m/
(.*?)
/g;
- $header = $1;
- $header =~ s/<.*?>//g;
- print "$header";
-
- if ($text =~ m/Description:(.*?)
/)
- {
- $header = $1;
- $header =~ s/<.*?>//g;
- print " - $header\n";
- }
- die;
-}
-
-
-$matches = 5 if ($matches > 5);
-
-my $i = 0;
-
-my $quote = chr(226) . chr(128) . chr(156);
-my $quote2 = chr(226) . chr(128) . chr(157);
-my $dash = chr(226) . chr(128) . chr(147);
-
-while ($text =~ m/
/g; - - $tonight = "Tonight: $1" - if $text =~ m/Tonight:<\/b>\s(.*?)
/g; - - $feelsc = int(5/9*($feels - 32)); - $tempc = int(5/9*($temp - 32)); - $highc = int(5/9*($high - 32)); - $lowc = int(5/9*($low - 32)); - - if ($date > 0) - { - $date = "[".$days[$date]."] "; - } - - $date =~ s/Mon/Monday/i; - $date =~ s/Tue/Tuesday/i; - $date =~ s/Wed/Wednesday/i; - $date =~ s/Thu/Thursday/i; - $date =~ s/Fri/Friday/i; - $date =~ s/Sat/Saturday/i; - $date =~ s/Sun/Sunday/i; - - - if ($date eq "") - { - print "$country, $state, $city (Updated $update): Temp: ".$temp."F/".$tempc."C (Feels like: $feels"."F/".$feelsc."C), ". - "High: ".$high."F/".$highc."C, Low: ".$low."F/".$lowc."C, ". - "Sky: $cond, Humidity: $humid, Wind: $wind, Sunrise: $sunup, Sunset: $sundown, $today $tonight\n"; - } - else - { - print "$country, $state, $city (Updated $update): $date". - "High: ".$high."F/".$highc."C, Low: ".$low."F/".$lowc."C, ". - "Sky: $cond.\n"; - }