Exemple #1
0
# Copyright (C) 2011 Bheesham Persaud.

# Setup
hubHost     = "carletonhub.ca"
hubPort     = 411               # default is 411 for most servers
botName     = "IdleDC"
botPass     = ""
botOwner    = "Bonnie"

# No need to edit the below.
from DCBot import DCBot

IdleDC          = DCBot( hubHost, hubPort, botName, botPass, botOwner )
IdleDC.debug    = True

IdleDC.login()

if ( IdleDC.logged_in == True ):
    # IdleDC.send_chat_msg( "Hey guys, this is Bonnie's bot. This is a test message. If you see this then everything is going according to plan." )
    # Initiate an infinite loop and add something along the lines of hooks
    pass
else:
    print "Could not log in. :("
Exemple #2
0

# Setup
hubHost     = "carletonhub.ca"
hubPort     = 411               # default is 411 for most servers
botName     = "URLBot"
botPass     = ""
botOwner    = "Bonnie"

ignoreUsers	= [ "HubBot" ]
ignoreURLS  = [ "carletonhub.ca", "imgur.com", "google.", "goo.gl", "bit.ly", "t.co", "tinyurl.com", "facebook.com" ]

# No need to edit the below.
from DCBot import DCBot

URLBot          = DCBot( hubHost, hubPort, botName, botPass, botOwner )
URLBot.debug    = False

URLBot.login()

class DiffUserAgent(urllib.FancyURLopener):
    version = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2"
urllib._urlopener = DiffUserAgent()



if ( URLBot.logged_in == True ):
    # Now that it's logged in, we can compile the Regular
    # Expressions to save some time.
    
    URLPattern      = re.compile( "([a-zA-Z0-9\-\.]+)\.([a-zA-Z]+){2,3}(\S*)" )