add Urban Dictionary plugin

This commit is contained in:
dennydai 2016-08-10 09:04:23 +08:00
parent 8fbfa63684
commit 853f0b2337

9
plugins/urbandict.php Normal file
View File

@ -0,0 +1,9 @@
<?php
PluginSet("Urban Dictionary");
$msg = $plugin_text;
$plugin_urbandict_raw = json_decode(file_get_contents("http://api.urbandictionary.com/v0/define?term=".$plugin_text),true);
foreach ($plugin_urbandict_raw['list'] as $plugin_urbandict_sublist) {
$msg .= "\n------------------\n".$plugin_urbandict_sublist['definition']."\n\n".$plugin_urbandict_sublist['permalink'];
}
$BOT->msg($plugin_sendto, $msg);