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 Anal_Lemon, 13 Years ago, written in Python.
Embed
  1. ###
  2. # Copyright (c) 2012, Dick2Y
  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 os
  32. import sys
  33. import time
  34. import socket
  35.  
  36. import supybot.utils as utils
  37. from supybot.commands import *
  38. import supybot.plugins as plugins
  39. import supybot.ircutils as ircutils
  40. import supybot.callbacks as callbacks
  41. from supybot.i18n import PluginInternationalization, internationalizeDocstring
  42.  
  43. _ = PluginInternationalization('EliteBNC')
  44.  
  45. SERVERS = ["alpha.elitebnc.net",   "delta.elitebnc.net",
  46.            "epsilon.elitebnc.net", "gamma.elitebnc.net",
  47.            "omega.elitebnc.net",   "sigma.elitebnc.net",
  48.            "xi.elitebnc.net",      "zeta.elitebnc.net"]
  49.  
  50. class eBNC:
  51.     def __init__(self):
  52.         self.cache = {}
  53.         self.last = 0
  54.    
  55.     def get(self):
  56.         delta = time.time() - self.last
  57.         if delta < 120:
  58.             return self.cache
  59.         c = {}
  60.         for server in SERVERS:
  61.             try:
  62.                 srvName = server.split(".elitebnc.net")[0].title()
  63.                 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  64.                 sock.connect((server, 1337))
  65.                 c[srvName] = "3UP"
  66.             except Exception, r:
  67.                 c[srvName] = "4DOWN"
  68.        
  69.         self.cache = c
  70.         self.last = time.time()
  71.         return c
  72.            
  73. @internationalizeDocstring
  74. class EliteBNC(callbacks.Plugin):
  75.     """Add the help for "@plugin help Test" here
  76.    This should describe *how* to use this plugin."""
  77.     threaded = True
  78.    
  79.     def __init__(self, irc):
  80.         self.__parent = super(EliteBNC, self)
  81.         self.__parent.__init__(irc)
  82.         self.status = eBNC()
  83.    
  84.     def elitebnc(self, irc, msg, args):
  85.         s = self.status.get()
  86.        
  87.         m = ["%s: %s"%(k,v) for (k,v) in s.items()]
  88.         msg = ' - '.join(m)
  89.         irc.reply(msg, prefixNick=False)
  90.        
  91.     elitebnc = wrap(elitebnc)
  92.    
  93.    
  94. Class = EliteBNC
  95.  
  96.  
  97. # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: