![]() |
|
[Perl] Google Page Rank Script - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Coding (https://sinister.ly/Forum-Coding) +--- Forum: Coding (https://sinister.ly/Forum-Coding--71) +--- Thread: [Perl] Google Page Rank Script (/Thread-Perl-Google-Page-Rank-Script) |
[Perl] Google Page Rank Script - ArkPhaze - 11-27-2011 Before continuing, please note that this script uses a few modules that you can get from cpan, as well as a google API that you need a key for. Google::Ranker Module from Cpan - Click here Code: #!/usr/bin/perl
use strict;
# use warnings;
use Google::Ranker;
if (@ARGV < 2) { &usage; exit(); }
my $url = $ARGV[0];
my $query = $ARGV[1];
my $rank = Google::Ranker->rank($url, {
q => $query,
key => "ABQIAAAAV76rbMdcHvF_HqB9sOT04RRk6pAxoAPRJX95JWh_HZe2dfAwpxS1zNHXgRjQztDNi2MvKcwhKAKHGQ",
referer => "http://tech.reboot.pro" });
# Uses "Google Loader" API
# Get valid key and referer from - http://code.google.com/apis/ajaxsearch/signup.html
unless (defined($rank)) {
print "\nSorry, the rank was undetermined...\n";
exit();
}
print "\nWebsite URL: ".$url."\n";
print "Search Query: \"".$query."\"\n";
print "Rank: [".$rank."]\n";
sub usage {
print q(
============================================================
| |
| USAGE: rank.pl [website url] [search queue] |
| Examples: rank.pl facebook.com "friends" |
| rank.pl youtube.com "music videos" |
| |
|----------------------------------------------------------|
| |
| Google Search Query Rank Perl Script |
| Copyright Ace (c)2011 - Tech.Reboot.Pro |
============================================================
)
}
exit();Please give credits to me if you use my script ![]() Here's my video demonstration of this: |