Skip to content
Newer
Older
100644 48 lines (40 sloc) 1.13 KB
c5f98b5 @holdenk Initial collection of shaaady perl scripts to do the spelling correct…
authored
1 #!/usr/bin/perl
2
3 use Bing::Search;
4 use Bing::Search::Source::Web;
5 use Net::GitHub;
6 use Text::SpellChecker;
b59189a @holdenk Update to use settings
authored
7 use Unicorn::Settings qw{ settings }:
c5f98b5 @holdenk Initial collection of shaaady perl scripts to do the spelling correct…
authored
8
b59189a @holdenk Update to use settings
authored
9 my $settings = settings();
10 my $token = $settings->{"bing.token"};
11 my $user = $settings->{"bing.user"};
c5f98b5 @holdenk Initial collection of shaaady perl scripts to do the spelling correct…
authored
12
13 my $a = "";
14 my $inc = 10;
15 my $offset = 0;
16 my $max = 100;
6464ae4 @holdenk Add some more queries to the search part
authored
17 @queries = ("readme.md site:raw.github.com",
18 "settings.py site:raw.github.com",
19 "readme.txt site:raw.github.com",
20 "readme.pod site:raw.github.com",
21 "hmac php site:raw.github.com");
f6b6fe0 @holdenk murh
authored
22 foreach my $query (@queries) {
23 while ($offset < $max) {
24 my $search = Bing::Search->new();
25 $search->AppId($a);
26 $search->Query();
27 my $source = Bing::Search::Source::Web->new();
28 $source->Web_Count(10);
29 $source->Web_Offset($offset);
30 my $hash = $source->params;
31 $hash->{'web.offset'} = $offset;
32 $source->params($hash);
33
34 $search->add_source($source);
35
36 my $response = $search->search();
37
38 foreach my $result ( @{$response->results} ) {
39 print $result->Title, " -> ", $result->Url, "\n";
40 }
41 $offset += $inc;
c5f98b5 @holdenk Initial collection of shaaady perl scripts to do the spelling correct…
authored
42 }
43 }
44 #
45 #print "Connecting to github!\n";
46 #my $github = Net::GitHub::V2->new(login => $user, token => $token);
47
Something went wrong with that request. Please try again.