.+?) (?P
.+?)$`is', $matches['arguments']['message'], $matchesTVrage) ) {
$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :Usage: !tvrage ";
} else {
$file = file_get_contents('http://www.tvrage.com/quickinfo.php?show='.urlencode($matchesTVrage['title']));
if ( preg_match("`Show Name@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['name'] = $show['name'];
}
if ( preg_match("`Show URL@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['url'] = $show['url'];
}
if ( preg_match("`Premiered@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['premiered'] = $show['premiered'];
}
if ( preg_match("`Latest Episode@(?P.+?)\n`is", $file, $show) ) {
$show = explode('^', $show['latest_ep']);
$matchesTVrage['show']['latest_ep']['se'] = $show[0];
$matchesTVrage['show']['latest_ep']['ep_name'] = $show[1];
$matchesTVrage['show']['latest_ep']['ep_date'] = $show[2];
}
if ( preg_match("`Next Episode@(?P.+?)\n`is", $file, $show) ) {
$show = explode('^', $show['next_ep']);
$matchesTVrage['show']['next_ep']['se'] = $show[0];
$matchesTVrage['show']['next_ep']['ep_name'] = $show[1];
$matchesTVrage['show']['next_ep']['ep_date'] = $show[2];
}
if ( preg_match("`Country@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['country'] = $show['country'];
}
if ( preg_match("`Status@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['status'] = $show['status'];
}
if ( preg_match("`Classification@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['classification'] = $show['classification'];
}
if ( preg_match("`Genres@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['genres'] = $show['genres'];
}
if ( preg_match("`Network@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['network'] = $show['network'];
}
if ( preg_match("`Airtime@(?P.+?)\n`is", $file, $show) ) {
$matchesTVrage['show']['airtime'] = $show['airtime'];
}
$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :Show: {$matchesTVrage['show']['name']} ( {$matchesTVrage['show']['genres']} )";
if ( isset($matchesTVrage['show']['latest_ep']) ) {
$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :Last episode: [{$matchesTVrage['show']['latest_ep']['se']}] {$matchesTVrage['show']['latest_ep']['ep_name']} ({$matchesTVrage['show']['latest_ep']['ep_date']})";
}
if ( isset($matchesTVrage['show']['next_ep']) ) {
$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :Next episode: [{$matchesTVrage['show']['next_ep']['se']}] {$matchesTVrage['show']['next_ep']['ep_name']} ({$matchesTVrage['show']['next_ep']['ep_date']})";
}
if ( isset($matchesTVrage['show']['status']) ) {
$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :Show Status: {$matchesTVrage['show']['status']}";
}
$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :URL: {$matchesTVrage['show']['url']}";
}
?>