D-Bot/plugins/urbandict.php

10 lines
413 B
PHP
Raw Permalink Normal View History

2016-08-09 20:04:23 -05:00
<?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);