Skip to content

Commit

Permalink
Fix things!
Browse files Browse the repository at this point in the history
  • Loading branch information
holdenk committed Dec 11, 2012
1 parent 84e6b65 commit d2a0a6d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 14 deletions.
1 change: 1 addition & 0 deletions Makefile.PL
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ WriteMakefile
'YAML::Any' => 0, 'YAML::Any' => 0,
'Slurp' => 0, 'Slurp' => 0,
'Net::SSH' => 0, 'Net::SSH' => 0,
'Data::Dumper' => 0,
}, },
'linkext' => { LINKTYPE => '' }, # no link needed 'linkext' => { LINKTYPE => '' }, # no link needed
'dist' => 'dist' =>
Expand Down
17 changes: 9 additions & 8 deletions fix_pandas.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
use Unicorn::Wordlist qw{fix_text check_common}; use Unicorn::Wordlist qw{fix_text check_common};
use Unicorn::Errorcheck qw{check_php fix_php check_py fix_py check_go fix_go check_cpp fix_cpp check_shell fix_shell}; use Unicorn::Errorcheck qw{check_php fix_php check_py fix_py check_go fix_go check_cpp fix_cpp check_shell fix_shell};
use Unicorn::Blacklist qw{ ok_to_update }; use Unicorn::Blacklist qw{ ok_to_update };
use Unicorn::Settings qw{ settings }: use Unicorn::Settings qw{ settings };


require "shared_fix.pl"; require "shared_fix.pl";


my $p = Pithub->new; my $p = Pithub->new;


my $c = 0; my $c = 0;
my $settings = settings(); my $settings = settings();
$consumer_key = $settings->{"twitter.consumer_key"}; my $consumer_key = $settings->{"twitter.consumer_key"};
$consumer_secret = $settings->{"twitter.consumer_secret"}; my $consumer_secret = $settings->{"twitter.consumer_secret"};
$user = $settings->{"github.user"}; my $user = $settings->{"github.user"};
$token = $settings->{"github.token"}; my $token = $settings->{"github.token"};
print "using ck $consumer_key / secret $consumer_secret\n"; print "using ck $consumer_key / secret $consumer_secret\n";
my $nt = Net::Twitter->new( my $nt = Net::Twitter->new(
traits => [qw/OAuth API::REST/], traits => [qw/OAuth API::REST/],
Expand Down Expand Up @@ -69,15 +69,15 @@ sub handle_url {
return 0; return 0;
} }
#Ok dokey lets try and fork this business #Ok dokey lets try and fork this business
print "trying to fork!\n"; print "trying to fork repo $repo from $ruser\n";
my $f = Pithub::Repos::Forks->new(token => $token); my $f = Pithub::Repos::Forks->new(token => $token);
my $result = $f->create( user => $ruser, repo => $repo); my $result = $f->create( user => $ruser, repo => $repo) or die "Forking failed $!\n";
my $clone_url = $result->content->{ssh_url}; my $clone_url = $result->content->{ssh_url};
my $upstream_url = $result->content->{parent}->{ssh_url}; my $upstream_url = $result->content->{parent}->{ssh_url};
my $master_branch = $result->content->{parent}->{master_branch} || "master"; my $master_branch = $result->content->{parent}->{master_branch} || "master";
print "using master branch: $master_branch\n"; print "using master branch: $master_branch\n";
#Oh hey lets merge the latest business to eh (just in case we have an old fork) #Oh hey lets merge the latest business to eh (just in case we have an old fork)
`rm -rf foo && mkdir -p foo && cd foo && git clone "$clone_url" && cd * && git remote add upstream "$upstream_url" && git fetch upstream && git merge upstream/$master_branch && git push`; print `rm -rf foo && mkdir -p foo && cd foo && git clone "$clone_url" && cd * && git remote add upstream "$upstream_url" && git fetch upstream && git merge upstream/$master_branch && git push`;
print "Did the sexy bit!\n"; print "Did the sexy bit!\n";
#Get the files #Get the files
my @all_files; my @all_files;
Expand All @@ -104,6 +104,7 @@ sub handle_url {
base => $master_branch, base => $master_branch,
head => $master_branch}); head => $master_branch});
print "Dump".Dumper($result->content); print "Dump".Dumper($result->content);
my $link = "lols";
exit(); exit();
#Post to twitter #Post to twitter
$twitter_msg =~ s/\[LINK\]$/$link/; $twitter_msg =~ s/\[LINK\]$/$link/;
Expand Down
4 changes: 4 additions & 0 deletions main.pl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ sub setup_output {
print "Compressing\n"; print "Compressing\n";
`bzip2 magic.tar`; `bzip2 magic.tar`;
while (my $hostline = <$hosts>) { while (my $hostline = <$hosts>) {
#Fuck comments
if ($hostline =~ /^\#/) {
next;
}
my @murh = split(/\:/,$hostline); my @murh = split(/\:/,$hostline);
my $hostname = $murh[0]; my $hostname = $murh[0];
my $pwd = $murh[1]; my $pwd = $murh[1];
Expand Down
20 changes: 14 additions & 6 deletions targets.pl
Original file line number Original file line Diff line number Diff line change
@@ -1,27 +1,32 @@
#!/usr/bin/perl #!/usr/bin/perl


use Data::Dumper;
use Bing::Search; use Bing::Search;
use Bing::Search::Source::Web; use Bing::Search::Source::Web;
use Text::SpellChecker; use Text::SpellChecker;
use Unicorn::Settings qw{ settings }; use Unicorn::Settings qw{ settings };
use strict;
use warnings;


my $settings = settings(); my $settings = settings();
my $token = $settings->{"bing.token"}; my $token = $settings->{"bing.token"};
my $user = $settings->{"bing.user"}; my $user = $settings->{"bing.user"};
my $appid = $settings->{"bing.appid"}; my $appid = $settings->{"bing.appid"};


print "using token:$token user:$user appid:$appid\n";

my $inc = 10; my $inc = 10;
my $offset = 0; my $offset = 0;
my $max = 100; my $max = 100;
@queries = ("readme.md site:raw.github.com", my @queries = ("readme.md site:raw.github.com",
"settings.py site:raw.github.com", "settings.py site:raw.github.com",
"readme.txt site:raw.github.com", "readme.txt site:raw.github.com",
"readme.pod site:raw.github.com", "readme.pod site:raw.github.com",
"hmac php site:raw.github.com"); "hmac php site:raw.github.com");
foreach my $query (@queries) { foreach my $query (@queries) {
while ($offset < $max) { while ($offset < $max) {
my $search = Bing::Search->new(); my $search = Bing::Search->new();
$search->AppId($a); $search->AppId($appid);
$search->Query(); $search->Query();
my $source = Bing::Search::Source::Web->new(); my $source = Bing::Search::Source::Web->new();
$source->Web_Count(10); $source->Web_Count(10);
Expand All @@ -35,6 +40,9 @@
my $response = $search->search(); my $response = $search->search();


foreach my $result ( @{$response->results} ) { foreach my $result ( @{$response->results} ) {
if ($result->isa("Bing::Search::Result::Errors")) {
print "error: ".Dumper($result)." in $response\n";
}
print $result->Url, "\n"; print $result->Url, "\n";
} }
$offset += $inc; $offset += $inc;
Expand Down

0 comments on commit d2a0a6d

Please sign in to comment.