Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import schedule
- import time
- import socket
- FollowArray = []
- HOST = "irc.chat.twitch.tv"
- PORT = 6667
- NICK = "BOT_NAME_HERE"
- PASS = 'oauth:OAUTH_HERE'
- CHANNEL = "CHANNEL_TO_SIT_IN(I used my bot's channel)"
- def send_message(msg):
- s.send(bytes("PRIVMSG #" + CHANNEL + " :" + msg + "\r\n", "UTF-8"))
- print("Connecting to host.")
- s = socket.socket()
- s.connect((HOST, PORT))
- s.send(bytes("PASS " + PASS + "\r\n", "UTF-8"))
- s.send(bytes("NICK " + NICK + "\r\n", "UTF-8"))
- s.send(bytes("JOIN #" + CHANNEL + " \r\n", "UTF-8"))
- print("Connected to host")
- def PhishFind():
- headers = {
- 'Client-ID': 'CLIENT_ID_HERE',
- }
- response = requests.get('https://api.twitch.tv/helix/streams?first=5&game_id=459931', headers=headers)
- resp = response.json()
- streams = resp['data']
- for phishers in streams:
- followerresp = requests.get('https://api.twitch.tv/helix/users/follows?to_id=' + (phishers['user_id']), headers=headers)
- followers = followerresp.json()
- streams2 = followers['data']
- phisher = (phishers['user_name'])
- if (followers['total']) < 100:
- print ("\n\nThese people are phishing:\n Username:" + (phishers['user_name']) + "\n Title: " + (phishers['title']) + "\n Viewers: " + str((phishers['viewer_count'])) + "\n Followers: " + str((followers['total'])))
- for following in streams2:
- follow = following['from_name']
- if follow not in FollowArray:
- FollowArray.append(follow)
- print ("This is FollowArray test: " + str(FollowArray))
- send_message("/w " + following['from_name'] + " Hi, The stream you followed: " + (phishers['user_name']) + " is actually a fake stream made to steal your Runescape password!")
- elif (followers['total']) > 100:
- continue
- schedule.every(1).minutes.do(PhishFind)
- while 1:
- schedule.run_pending()
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement