Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 64 lines (61 sloc) 1.852 kb
c5f98b5 Holden Karau Initial collection of shaaady perl scripts to do the spelling correction...
authored
1 #!/usr/bin/perl
2 use LWP::UserAgent;
9bb7b39 Holden Karau Update the finding of targets
authored
3 require HTML::LinkExtor;
4 use strict;
c5f98b5 Holden Karau Initial collection of shaaady perl scripts to do the spelling correction...
authored
5
6 my $ua = new LWP::UserAgent;
7 my $max = 400;
8 my $v = 1;
9 my $inc = 1;
10 my @foo;
9bb7b39 Holden Karau Update the finding of targets
authored
11
12 #Readme files
13 handle_search("Markdown","readme","(.*?README\.m.*?)\$");
14 handle_search("Text","readme.txt","(.*?\/README\.txt.*?)\$");
15 handle_search("Perl","readme.p","(.*?README\.p.*?)\$");
16 #PHP
17 handle_search("PHP","spliti","(.*?\.php)\$");
18 handle_search("PHP","ip2long","(.*?\.php)\$");
19 handle_search("PHP","mysql_db_query","(.*?\.php)\$");
4055828 Holden Karau Fix up find errors
authored
20 handle_search("PHP","hash_hmac","(.*?\>php)\$");
9bb7b39 Holden Karau Update the finding of targets
authored
21 #django
22 handle_search("Python","\"'ENGINE'%3A+'sqlite3'\"","(.*?settings.*?\.py)");
a4622e4 Holden Karau more github search request
authored
23 handle_search("Python","\"'ENGINE'%3A+'mysql'\"","(.*?settings.*?\.py)");
9bb7b39 Holden Karau Update the finding of targets
authored
24 #bash
25 handle_search("Shell","bash","(.*?\/tree\/.*?\.)");
26 #go
4055828 Holden Karau Fix up find errors
authored
27 #handle_search("Go","nil","(.*\.go)");
9bb7b39 Holden Karau Update the finding of targets
authored
28 my @links;
29 sub handle_search() {
30 my $language = shift @_;
31 my $q = shift @_;
32 my $r = shift @_;
33 print "handling $q!\n";
34 my $v = 1;
35 my $inc = 1;
36 #Shaady loop through search results
37 my $t = "/tree/";
38 while ($t =~ /\/tree\//) {
39 print "looping!: $v\n";
40 my $url = "https://github.com/search?type=Code&language=".$language."&q=".$q."&repo=&langOverride=&x=27&y=30&start_value=$v";
41 print "url: $url\n";
42 my $res = $ua->get("$url");
43 my $rt = $res->as_string();
44 $t = $rt;
45 @links = ();
46 sub callback {
47 my($tag, %attr) = @_;
48 return if $tag ne 'a'; # we only look closer at <img ...>
49 push(@links, values %attr);
50 }
51 my $p = HTML::LinkExtor->new(\&callback);
52 $p->parse($rt);
53 foreach my $link (@links) {
54 if ($link =~ /tree/) {
55 if ($link =~ /$r/) {
56 print "$link\n";
57 }
58 }
59 }
60 $v += $inc;
61 sleep 1;
c5f98b5 Holden Karau Initial collection of shaaady perl scripts to do the spelling correction...
authored
62 }
63 }
Something went wrong with that request. Please try again.