コード例 #1
0
from twitchtools import login, chat, utils
import time

if __name__ == '__main__':
    utils.Printer.level = "DEBUG"

    with chat.IRC(("irc.twitch.tv", 6667),
                  login.Profile("bomb_mask")) as twitch:
        twitch.capibilities("tags")
        twitch.capibilities("commands")

        user = input("User>")
        message = input("Message>")
        length = int(input("Length/2>"))
        USER = chat.User(chat.Channel("", "testing"), user)

        if not message[-1] == ' ':
            message += ' '

        for i in range(1, length * 2):
            if i < length:
                math = i
            else:
                math = length - (i % length)

            time.sleep(.4)

            twitch.whisper(USER, message * math)
コード例 #2
0
from twitchtools import login

#login.Profile("bomb_mask", username="******", oauth=)
m = login.Profile("bomb_mask", oauth="oauth:6x8jnkhuovp21eaq4wg08kgfsrjarj")
m.export()
コード例 #3
0
    #         time.sleep(.4)
    #
    #
    #         twitch.whisper(USER, message*math)

    user = input("Channel>")
    message = input("Message>")
    length = int(input("Length/2>"))

    if not message[-1] == ' ':
        message += ' '

    twitch_link = ("irc.twitch.tv", 6667)
    accounts = ["bomb_mask", "themaskoftruth", "whitetail_atom", "bombmask"]
    twitchs = [
        chat.IRC(twitch_link, login.Profile(account), True)
        for account in accounts
    ]
    USER = chat.User(chat.Channel("", "testing"), user)

    time.sleep(.2)

    for twitch in twitchs:
        twitch.join(user)

    time.sleep(.2)

    print()

    for i in range(1, length * 2):
        if i < length:
コード例 #4
0
import os
import socket
from time import sleep
from twitchtools import login

spam = input("Bool : ")
print type(spam)
amount = input("(int)amount : ")
size = input("(int)size : ")

data = raw_input("(str)String : ")
channel = raw_input("(str)channel : ")

user = login.Profile("bomb_mask")
t_nick = user.name
t_oauth = user.password

twitch_host = "irc.twitch.tv"
twitch_port = 6667

print "Joining {} as {}.\n".format(channel, t_nick)

irc = socket.socket()
irc.connect((twitch_host, twitch_port))
#irc.setdefaulttimeout(1)
irc.sendall('PASS {}\r\n'.format(t_oauth))
irc.sendall('NICK {}\r\n'.format(t_nick))
irc.sendall('JOIN #{}\r\n'.format(channel))

print irc.recv(8192)
コード例 #5
0
ファイル: banbot.py プロジェクト: firestack/garden
from twitchtools import login, chat
import time

twitchlink = ("irc.twitch.tv",6667)

def BanBotRuntime(channel, message):

    if message.serverCOM == "CLEARCHAT":
        for oldMessage in channel.users[message.sender].messages[-5:]:
            channel.sendMessage(oldMessage)
            time.sleep(0.1)
            #channel.sendMessage(channel.users[message.sender].messages[-1])

with chat.IRC.IRC(twitchlink, login.Profile("TheMaskOfTruth")) as twitch:
    twitch.capibilities("tags")
    twitch.capibilities("commands")
    twitch.join("bomb_mask").MessageCallback(BanBotRuntime)
    

    for i in twitch.readfile():
        print i
        if i.message == "QUIT":
            break

    #     if hasattr(i, 'serverCHAN'):
    #         try:
    #             if i.serverCOM == "PRIVMSG":
    #                 if i.message.startswith(":"):twitch.channels[i.serverCHAN].sendMessage(i.message)
    #         except KeyError:
    #             pass
コード例 #6
0
ファイル: scrape.py プロジェクト: firestack/garden
import twitchtools.login as login
import twitchtools.chat as chat

print dir(chat)

twitchlink = ("irc.twitch.tv", 6667)

annon = login.Profile("justinfan0007", oauth="blaw")
bomb = login.Profile("bomb_mask")
channel = "snarfybobo"
scrapeTime = 20
scrapeMessages = 400

with chat.IRC.IRC(twitchlink, bomb) as twitch:
    twitch.join(channel)
    twitch.capibilities("tags")
    twitch.capibilities("commands")
    twitch.join("bomb_mask")

    for i in twitch.readfile():
        print i
        with open(__file__[:-3] + '.log', 'a') as fout:
            fout.write(repr(i) + "\n")

flink = twitch.link.makefile()

raw_input('Press enter to exit...')