All pastes #798987 Raw Edit

Mine

public php v1 · immutable
#798987 ·published 2007-11-27 05:19 UTC
rendered paste body
<?php// Regex on// http://www.tvrage.com/quickinfo.php?show=dexterif ( !preg_match('`^['.$config['prefixes'].'](?P<command>.+?) (?P<title>.+?)$`is', $matches['arguments']['message'], $matchesTVrage) ) {	$output[$outputNum++] = $network." PRIVMSG {$matches['arguments']['channel']} :Usage: !tvrage <title>";} else {	$file = file_get_contents('http://www.tvrage.com/quickinfo.php?show='.urlencode($matchesTVrage['title']));	if ( preg_match("`Show Name@(?P<name>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['name'] = $show['name'];	}	if ( preg_match("`Show URL@(?P<url>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['url'] = $show['url'];	}	if ( preg_match("`Premiered@(?P<premiered>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['premiered'] = $show['premiered'];	}	if ( preg_match("`Latest Episode@(?P<latest_ep>.+?)\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<next_ep>.+?)\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<country>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['country'] = $show['country'];	}	if ( preg_match("`Status@(?P<status>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['status'] = $show['status'];	}	if ( preg_match("`Classification@(?P<classification>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['classification'] = $show['classification'];	}	if ( preg_match("`Genres@(?P<genres>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['genres'] = $show['genres'];	}	if ( preg_match("`Network@(?P<network>.+?)\n`is", $file, $show) ) {		$matchesTVrage['show']['network'] = $show['network'];	}	if ( preg_match("`Airtime@(?P<airtime>.+?)\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']}";}?>