Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 6th, 2012  |  syntax: None  |  size: 0.90 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def tvn(self, irc, msg, args, text):
  2.         """ - do a search for next episode to be aired """
  3.         re_next = re.compile(r'Next\sEpisode@(.*?\d{4})')
  4.         re_show = re.compile(r'Show\sName@(.*?)\sShow')
  5.         re_time = re.compile(r'Airtime@(.*?)')
  6.         showsrc = self.search(text)
  7.         showname = re_show.findall(showsrc)
  8.         nextep = re_next.findall(showsrc)
  9.         airtime = re_time.findall(showsrc)
  10.         if not showname:
  11.             irc.reply("Could not find the series.")
  12.         elif not nextep:
  13.             irc.reply(format("%s: The air date for next episode has not been determined.", ircutils.bold(showname[0])), prefixNick=False)
  14.         else:
  15.             nextep = nextep[0].split("^")
  16.             irc.reply(format('%s: Next episode (%s), "%s", airs %s', ircutils.bold(showname[0]), nextep[0], nextep[1], nextep[2]), airtime[0], prefixNick=False)
  17.     tvn = wrap(tvn,['text'])