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

irc2speech.py - Stikked
From Ivory Plover, 12 Years ago, written in Python.
Embed
  1. #!/usr/bin/python2.6
  2.  
  3. import socket, os
  4. import smtplib
  5. from email.mime.text import MIMEText
  6. from time import sleep
  7. from datetime import datetime
  8.  
  9. class Bot:
  10.  
  11.     def __init__(self, network, channel, botname, username):
  12.         self.username = username
  13.         self.irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  14.         self.irc.connect((network, 6667))
  15.         print self.irc.recv(1024)
  16.         self.send('NICK ' + botname)
  17.         self.send('USER botty botty botty :Python IRC')
  18.         sleep(3)
  19.         self.send('JOIN ' + channel)
  20.         self.loop()
  21.  
  22.     def send(self, text):
  23.         print 'sending: ' + text
  24.         self.irc.send(text + '\r\n')
  25.  
  26.     def say_aloud(self, text):
  27.         pipe = os.popen('festival --tts', 'w')
  28.         pipe.write(str(text))
  29.  
  30.     def send_mail(self, text):
  31.         msg = MIMEText(text)
  32.         msg['Subject'] = '[sms] IRC'
  33.         msg['From'] = 'sms@gateway.com'
  34.         msg['To'] = 'sms@gateway.com'
  35.  
  36.         s = smtplib.SMTP('sdf.com')
  37.         s.sendmail('sms@gateway.com', 'sms@gateway.com', msg.as_string())
  38.         s.quit()
  39.  
  40.     def loop(self):
  41.         while True:
  42.             data = self.irc.recv(1024)
  43.             if data.find('PING') != -1:
  44.                 self.send('PONG ' + data.split()[1])
  45.             elif data.find('VERSION') != -1:
  46.                 self.send('VERSION Defience v.2.5 <Defience@recon.org>')
  47.             elif data.find(self.username + ': ') != -1:
  48.                 if datetime.now().hour >= 9:
  49.                     msg = str(' '.join(data.split()[4:]))
  50.                     sender = str(data.split()[0].split(':')[1].split('!')[0])
  51.                     outmsg = sender + ': ' + msg
  52.                     self.send_mail(outmsg)
  53.                     self.say_aloud(outmsg)
  54.             print data
  55.  
  56. b = Bot('irc.rizon.net', '#channel', 'bots_name', 'nick2watch4')