Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to use settings

  • Loading branch information...
commit b59189abc806b73d375f7c7ca27afd3954a3fdf2 1 parent a4622e4
@holdenk authored
View
1  Makefile.PL
@@ -16,6 +16,7 @@ WriteMakefile
'Bing::Search' => 0,
'Text::SpellChecker' => 0,
'Pithub' => 0,
+ 'YAML::Any' => 0,
},
'linkext' => { LINKTYPE => '' }, # no link needed
'dist' =>
View
4 README
@@ -1,5 +1,9 @@
A very simple github bot. Uses an accout of the same name. It provides spelling corrections for README files and other simple suggestions.
Requires pfff & php for the php code fixing to work.
+The current method it works is find_targets[*].pl finds possible files on github that might have something we could do to them.
+Then find_errors.pl will do a basic check
+Then fix_pandas.pl does the "hard" work
+Update settings.yml to have your credientals
See:
https://twitter.com/#!/HoldensUnicorn
https://github.com/holdensmagicalunicorn
View
12 Unicorn/Settings.pm
@@ -0,0 +1,12 @@
+package Unicorn::Settings;
+use File::Slurp qw (slurp);
+use YAML::Any;
+sub settings {
+ $m = slurp("settings.yml");
+ return Load($m);
+}
+
+use base 'Exporter';
+our @EXPORT = qw{settings};
+
+1;
View
7 fix_pandas.pl
@@ -9,11 +9,16 @@
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 }:
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"};
print "using ck $consumer_key / secret $consumer_secret\n";
my $nt = Net::Twitter->new(
traits => [qw/OAuth API::REST/],
View
10 settings.yml
@@ -0,0 +1,10 @@
+
+---
+bing.token: BINGTOKEN
+bing.user: BINGUSERNAME
+twitter.consumer_key: tkey
+twitter.consumer_secret: tsecret
+github.user: guser
+github.token: gtoken
+
+
View
8 t/Settings.t
@@ -0,0 +1,8 @@
+#Test the shell script thing
+use Test::More tests => 1;
+use Unicorn::Settings qw (settings);
+use strict;
+
+my $settings = settings();
+is($settings->{"bing.token"},"BINGTOKEN");
+
View
6 targets.pl
@@ -4,9 +4,11 @@
use Bing::Search::Source::Web;
use Net::GitHub;
use Text::SpellChecker;
+use Unicorn::Settings qw{ settings }:
-my $token = "";
-my $user = "";
+my $settings = settings();
+my $token = $settings->{"bing.token"};
+my $user = $settings->{"bing.user"};
my $a = "";
my $inc = 10;
Please sign in to comment.
Something went wrong with that request. Please try again.