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 Dick2Y, 13 Years ago, written in Python.
Embed
  1. ###
  2. # Copyright (c) 2012, Aha2Y
  3. # Credits Digital_Lemon, Dunj3
  4. # All rights reserved.
  5. #
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are met:
  8. #
  9. #   * Redistributions of source code must retain the above copyright notice,
  10. #     this list of conditions, and the following disclaimer.
  11. #   * Redistributions in binary form must reproduce the above copyright notice,
  12. #     this list of conditions, and the following disclaimer in the
  13. #     documentation and/or other materials provided with the distribution.
  14. #   * Neither the name of the author of this software nor the name of
  15. #     contributors to this software may be used to endorse or promote products
  16. #     derived from this software without specific prior written consent.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  19. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21. # ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  22. # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  23. # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  24. # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  25. # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  26. # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  27. # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  28. # POSSIBILITY OF SUCH DAMAGE.
  29.  
  30. ###
  31.  
  32. import os
  33. import sys
  34. import time
  35. import socket
  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.settimeout(01)
  65.                 sock.connect((server, 1337))
  66.                 sock.shutdown(0)
  67.                 c.append((srvName, "3UP"))
  68.             except socket.error,e:
  69.                 c.append((srvName, "4DOWN"))
  70.        
  71.         self.cache = c
  72.         self.last = time.time()
  73.         return c
  74.            
  75. @internationalizeDocstring
  76. class EliteBNC(callbacks.Plugin):
  77.     """Add the help for "@plugin help Test" here
  78.    This should describe *how* to use this plugin."""
  79.     threaded = True
  80.    
  81.     def __init__(self, irc):
  82.         self.__parent = super(EliteBNC, self)
  83.         self.__parent.__init__(irc)
  84.         self.status = eBNC()
  85.    
  86.     def elitebnc(self, irc, msg, args):
  87.         irc.reply("Fetching...", prefixNick=False)
  88.         s = self.status.get()
  89.         m = ["%s: %s"% i for i in s]
  90.         msg = ' - '.join(m)        
  91.         irc.reply(msg, prefixNick=False)
  92.     elitebnc = wrap(elitebnc)
  93.    
  94.    
  95. Class = EliteBNC
  96.  
  97.  
  98. # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: