From aa26e56e921b38886a236eb40aa5aa45946ad51b Mon Sep 17 00:00:00 2001 From: Denny Dai Date: Sun, 5 Jul 2015 15:12:42 +0800 Subject: [PATCH] ipv4-wildcard-calculator and update github plugin --- plugins/github.php | 8 +++++++- plugins/ipcalc.php | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 plugins/ipcalc.php diff --git a/plugins/github.php b/plugins/github.php index cc95036..920634f 100644 --- a/plugins/github.php +++ b/plugins/github.php @@ -2,6 +2,7 @@ PluginSet("find someone on Github"); $opts = array ('http' => array ('header' => "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0",)); +if (strpos($plugin_text,"@") === 0) {$plugin_text = substr($plugin_text,1);} if (!strpos($plugin_text,'/')) { $user = file_get_contents("https://api.github.com/users/".urlencode($plugin_text).'?access_token='.PLUGIN_GITHUB_TOKEN, false, stream_context_create($opts)); $starred = file_get_contents("https://api.github.com/users/".urlencode($plugin_text)."/starred".'?access_token='.PLUGIN_GITHUB_TOKEN, false, stream_context_create($opts)); @@ -11,7 +12,12 @@ if (!strpos($plugin_text,'/')) { plugin_github_check("Name", $user['name']); plugin_github_check("Email", $user['email']); plugin_github_check("Company", $user['company']); - plugin_github_check("Starred", count(json_decode($starred,true))); + if (count(json_decode($starred,true)) == 30) { + $starred = '>30'; + }else{ + $starred = count(json_decode($starred,true)); + } + plugin_github_check("Starred", $starred); plugin_github_check("Repos", $user['public_repos']); plugin_github_check("Followers", $user['followers']); plugin_github_check("Following", $user['following']); diff --git a/plugins/ipcalc.php b/plugins/ipcalc.php new file mode 100644 index 0000000..49d4496 --- /dev/null +++ b/plugins/ipcalc.php @@ -0,0 +1,40 @@ +msg($plugin_sendto, $msg); +}else{ + $BOT->msg($plugin_sendto, "Bad IP Address."); +} \ No newline at end of file