Created
April 4, 2014 02:01
-
-
Save IzumiSy/9966679 to your computer and use it in GitHub Desktop.
Google search from terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Encode; | |
our $args = decode_utf8($ARGV[0]); | |
foreach my $i (1 .. $#ARGV) { | |
$args = $args . "+" . decode_utf8($ARGV[$i]); | |
} | |
our $num = 10; | |
our $url = "http://www.google.com/search?hl=ja&ie=UTF-8&num=$num&q=$args"; | |
our $cmd = "x-www-browser \"$url\""; | |
print "Query: \"$args\"\n"; | |
print "Launching a web browser...\n"; | |
system($cmd); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment