diff -r 08e9b1c1b324 -r 0d1fd111cb22 mod_idgames.py --- a/mod_idgames.py Wed Dec 31 11:40:46 2014 -0500 +++ b/mod_idgames.py Wed Dec 31 15:49:11 2014 -0500 @@ -18,7 +18,7 @@ g_idgamesSearchURL = 'http://www.doomworld.com/idgames/api/api.php?action=search&query=%s&type=title&sort=date&out=json' -def cmd_idgames (bot, args, replyto, **rest): +def cmd_idgames (bot, args, reply, **rest): try: url = g_idgamesSearchURL % urllib.quote (args['wad']) response = urllib2.urlopen (url).read() @@ -30,18 +30,10 @@ else: files = [data['content']['file']] - i = 0 - for filedata in files: - if i >= 5: - break - - bot.privmsg (replyto, '- %s: \'%s\' by \'%s\', rating: %s: %s' % \ - (filedata['filename'], filedata['title'], filedata['author'], filedata['rating'], filedata['url'])) - - i += 1 - #done - bot.privmsg (replyto, "(%d / %d results posted)" % (i, len(files))) + reply ('- %s: \'%s\' by \'%s\', rating: %s: %s' % \ + (filedata['filename'], filedata['title'], filedata['author'], + filedata['rating'], filedata['url'])) elif 'warning' in data and 'message' in data['warning']: command_error (data['warning']['message']) elif 'error' in data and 'message' in data['error']: @@ -50,5 +42,3 @@ command_error ("Incomplete JSON response from doomworld.com/idgames") except Exception as e: command_error ('search failed: %s' % str (e)) - #tried -#enddef \ No newline at end of file