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