Permalink
Browse files

Murhbots

  • Loading branch information...
1 parent a1b60bd commit 89b7ce9ed37ad54ee58ba9527e85180b2d6084f5 @holdenk committed Jan 25, 2013
Showing with 18 additions and 1 deletion.
  1. +18 −1 handle_django_response.pl
View
@@ -42,5 +42,22 @@
while (<>) {
my ($url,$target_username,$message_txt,$twitter_txt,$patch_good) = split(/,/, $_);
-
+ my $repo = "";
+ if ($url =~ /https:\/\/github.com\/[^\/]+?\/([^\/]+?)\//) {
+ $repo = $1;
+ }
+ if ($patch_good) {
+ my $pu = Pithub::PullRequests->new(user => $user ,token => $token);
+ my $result = $pu->create(user => $target_username,
+ repo => $repo,
+ data => {
+ title => "Pull request to a fix things",
+ body => $message_txt,
+ base => "master",
+ head => "$user:"."master"});
+ my $link = $result->content->{_links}->{html}->{href};
+ #Post to twitter
+ $twitter_msg =~ s/\[LINK\]$/$link/;
+ $nt->update($twitter_msg);
+ }
}

0 comments on commit 89b7ce9

Please sign in to comment.