A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Ivory Pintail, 13 Years ago, written in Python.
Embed
  1. ###
  2. # Copyright (c) 2012, Aha2Y
  3. # All rights reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions are met:
  7. #
  8. #   * Redistributions of source code must retain the above copyright notice,
  9. #     this list of conditions, and the following disclaimer.
  10. #   * Redistributions in binary form must reproduce the above copyright notice,
  11. #     this list of conditions, and the following disclaimer in the
  12. #     documentation and/or other materials provided with the distribution.
  13. #   * Neither the name of the author of this software nor the name of
  14. #     contributors to this software may be used to endorse or promote products
  15. #     derived from this software without specific prior written consent.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  18. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20. # ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  21. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  22. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  23. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  24. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  25. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  26. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  27. # POSSIBILITY OF SUCH DAMAGE.
  28.  
  29. ###
  30.  
  31. import supybot.utils as utils
  32. from supybot.commands import *
  33. import supybot.plugins as plugins
  34. import supybot.ircutils as ircutils
  35. import supybot.callbacks as callbacks
  36. from supybot.i18n import PluginInternationalization, internationalizeDocstring
  37. import urllib2
  38. import lxml.html
  39. _ = PluginInternationalization('Fml')
  40.  
  41. @internationalizeDocstring
  42.  
  43. def sortByTag(data):
  44.     D = {}
  45.     for entry in data:
  46.         L = entry.split(':')
  47.         key = L[0].lower()
  48.         contents = L[1][1:]
  49.         D[key] = contents
  50.     return D
  51.  
  52. class FML:
  53.     def __init__(self):
  54.         api = urllib2.urlopen("http://rscript.org/lookup.php?type=fml")
  55.         data = lxml.html.parse(api)
  56.         api.close()
  57.        
  58.         contents = data.xpath("//pre/text()")[0].split('\n')
  59.         contents.sort()
  60.         # lets remove the trash that will fuck the dict up
  61.         del contents[0]
  62.         del contents[0]
  63.         contents.remove("START")
  64.         contents.remove("END")
  65.        
  66.         data = sortByTag(contents)
  67.        
  68.         # lets sort it into something BEAUTIFUL :D
  69.         self.id = data['id']
  70.         self.cate = data['cate']
  71.         self.text = data['text']
  72.         self.agree = data['agree']
  73.         self.deserved = data['deserved']
  74.         self.comments = data['comments']
  75.         self.comments = data['comments']
  76.        
  77. fml = FML()
  78.        
  79.  
  80. class Fml(callbacks.Plugin):
  81.     """Add the help for "@plugin help Fml" here
  82.    This should describe *how* to use this plugin."""
  83.     threaded = True
  84.  
  85.     def fml(self, irc, msg, args):
  86.         irc.reply("[%s/%s] %s" % (fml.cate, fml.id, fml.text), prefixNick=False)
  87.         irc.reply("Agreed: %s - Deserved: %s" % (fml.agree, fml.deserved), prefixNick=False)
  88.     fml = wrap(fml)
  89.  
  90. Class = Fml
  91.  
  92.  
  93. # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
  94.