Permalink
Browse files

Fix things!

  • Loading branch information...
1 parent 84e6b65 commit d2a0a6dbe9dceb4808a54660f39b3fedf8f1b1a1 @holdenk committed Dec 11, 2012
Showing with 28 additions and 14 deletions.
  1. +1 −0 Makefile.PL
  2. +9 −8 fix_pandas.pl
  3. +4 −0 main.pl
  4. +14 −6 targets.pl
View
1 Makefile.PL
@@ -19,6 +19,7 @@ WriteMakefile
'YAML::Any' => 0,
'Slurp' => 0,
'Net::SSH' => 0,
+ 'Data::Dumper' => 0,
},
'linkext' => { LINKTYPE => '' }, # no link needed
'dist' =>
View
17 fix_pandas.pl
@@ -9,18 +9,18 @@
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::Blacklist qw{ ok_to_update };
-use Unicorn::Settings qw{ settings }:
+use Unicorn::Settings qw{ settings };
require "shared_fix.pl";
my $p = Pithub->new;
my $c = 0;
my $settings = settings();
-$consumer_key = $settings->{"twitter.consumer_key"};
-$consumer_secret = $settings->{"twitter.consumer_secret"};
-$user = $settings->{"github.user"};
-$token = $settings->{"github.token"};
+my $consumer_key = $settings->{"twitter.consumer_key"};
+my $consumer_secret = $settings->{"twitter.consumer_secret"};
+my $user = $settings->{"github.user"};
+my $token = $settings->{"github.token"};
print "using ck $consumer_key / secret $consumer_secret\n";
my $nt = Net::Twitter->new(
traits => [qw/OAuth API::REST/],
@@ -69,15 +69,15 @@ sub handle_url {
return 0;
}
#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 $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 $upstream_url = $result->content->{parent}->{ssh_url};
my $master_branch = $result->content->{parent}->{master_branch} || "master";
print "using master branch: $master_branch\n";
#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";
#Get the files
my @all_files;
@@ -104,6 +104,7 @@ sub handle_url {
base => $master_branch,
head => $master_branch});
print "Dump".Dumper($result->content);
+ my $link = "lols";
exit();
#Post to twitter
$twitter_msg =~ s/\[LINK\]$/$link/;
View
4 main.pl
@@ -72,6 +72,10 @@ sub setup_output {
print "Compressing\n";
`bzip2 magic.tar`;
while (my $hostline = <$hosts>) {
+ #Fuck comments
+ if ($hostline =~ /^\#/) {
+ next;
+ }
my @murh = split(/\:/,$hostline);
my $hostname = $murh[0];
my $pwd = $murh[1];
View
20 targets.pl
@@ -1,27 +1,32 @@
#!/usr/bin/perl
+use Data::Dumper;
use Bing::Search;
use Bing::Search::Source::Web;
use Text::SpellChecker;
use Unicorn::Settings qw{ settings };
+use strict;
+use warnings;
my $settings = settings();
my $token = $settings->{"bing.token"};
my $user = $settings->{"bing.user"};
my $appid = $settings->{"bing.appid"};
+print "using token:$token user:$user appid:$appid\n";
+
my $inc = 10;
my $offset = 0;
my $max = 100;
-@queries = ("readme.md site:raw.github.com",
- "settings.py site:raw.github.com",
- "readme.txt site:raw.github.com",
- "readme.pod site:raw.github.com",
- "hmac php site:raw.github.com");
+my @queries = ("readme.md site:raw.github.com",
+ "settings.py site:raw.github.com",
+ "readme.txt site:raw.github.com",
+ "readme.pod site:raw.github.com",
+ "hmac php site:raw.github.com");
foreach my $query (@queries) {
while ($offset < $max) {
my $search = Bing::Search->new();
- $search->AppId($a);
+ $search->AppId($appid);
$search->Query();
my $source = Bing::Search::Source::Web->new();
$source->Web_Count(10);
@@ -35,6 +40,9 @@
my $response = $search->search();
foreach my $result ( @{$response->results} ) {
+ if ($result->isa("Bing::Search::Result::Errors")) {
+ print "error: ".Dumper($result)." in $response\n";
+ }
print $result->Url, "\n";
}
$offset += $inc;

0 comments on commit d2a0a6d

Please sign in to comment.