anonymous No title
No License Python
2021年02月01日
Copy Clone
連打

import notification
import clipboard
import keyboard
import datetime
import tweepy
import json
import time
import calendar
import sys
import re

# ルーム番号
roomid = "0000" 
# パスツイ分
passtime = "00"

username = clipboard.get()
password  = ""
consumerkey = "mWaCs1BUiabDtEUQXCsNYjLcK"
consumersecret = "wBv0tKnWrDD9G0MUmtkZM3IlGMppIPbZvCvL9BP1u5jKwsVgjd"
accesstoken = "856129738049335296-SG2xi3im7MW9GD3N9PFCyMpkp2l0VLU"
accesstokensecret = "qZZ2dH1uyvEiBbod4TDGpq1pk8cvS33oJN9RTrAM7RmTv"

Auth = tweepy.OAuthHandler(consumerkey,consumersecret)
Auth.set_access_token(accesstoken,accesstokensecret)
Api = tweepy.API(Auth)

now   = datetime.datetime.now()
minute = now.minute

if("/" in str(username)):
    username = username.split("/")
    username = username[3].split("?")
    username = username[0]
else:
    print("パスツイ主のリンクをコピーしてください")
    sys.exit()

for i, status in enumerate(tweepy.Cursor(Api.user_timeline,id=username,tweet_mode="extended").items(1)):
    tweet = re.findall(r"\d+",status.full_text)
    tweettime = re.findall(r"\d+",str(status.created_at))

count = len(tweet)

# Just パスツイ
if(passtime in tweettime):
    print("loading...")
else:
    print("ツイートの更新がありません。")
    sys.exit()

if(len(tweet) == 0):
   print("パスワードが見つかりませんでした。")
   sys.exit()
elif(roomid in tweet and count >= 2):
    roomidindex = tweet.index(roomid)
    password = tweet[roomidindex+1]
elif(count == 1):
    password = tweet[0]
elif(count >= 2):
    if(int(len(tweet[0])) == 2 and int(len(tweet[1]) == 2)):
        password = tweet[2]


if(password == ""):
    print("対応していない形式です。")
else:
    notification.schedule(password)
    keyboard.insert_text(password)
    keyboard.insert_text("\n")
    print("Password:"+password)
連打

import notification
import clipboard
import keyboard
import datetime
import tweepy
import json
import time
import calendar
import sys
import re

# ルーム番号
roomid = "0000" 
# パスツイ分
passtime = "00"

username = clipboard.get()
password  = ""
consumerkey = "mWaCs1BUiabDtEUQXCsNYjLcK"
consumersecret = "wBv0tKnWrDD9G0MUmtkZM3IlGMppIPbZvCvL9BP1u5jKwsVgjd"
accesstoken = "856129738049335296-SG2xi3im7MW9GD3N9PFCyMpkp2l0VLU"
accesstokensecret = "qZZ2dH1uyvEiBbod4TDGpq1pk8cvS33oJN9RTrAM7RmTv"

Auth = tweepy.OAuthHandler(consumerkey,consumersecret)
Auth.set_access_token(accesstoken,accesstokensecret)
Api = tweepy.API(Auth)

now   = datetime.datetime.now()
minute = now.minute

if("/" in str(username)):
    username = username.split("/")
    username = username[3].split("?")
    username = username[0]
else:
    print("パスツイ主のリンクをコピーしてください")
    sys.exit()

for i, status in enumerate(tweepy.Cursor(Api.user_timeline,id=username,tweet_mode="extended").items(1)):
    tweet = re.findall(r"\d+",status.full_text)
    tweettime = re.findall(r"\d+",str(status.created_at))

count = len(tweet)

# Just パスツイ
if(passtime in tweettime):
    print("loading...")
else:
    print("ツイートの更新がありません。")
    sys.exit()

if(len(tweet) == 0):
   print("パスワードが見つかりませんでした。")
   sys.exit()
elif(roomid in tweet and count >= 2):
    roomidindex = tweet.index(roomid)
    password = tweet[roomidindex+1]
elif(count == 1):
    password = tweet[0]
elif(count >= 2):
    if(int(len(tweet[0])) == 2 and int(len(tweet[1]) == 2)):
        password = tweet[2]


if(password == ""):
    print("対応していない形式です。")
else:
    notification.schedule(password)
    keyboard.insert_text(password)
    keyboard.insert_text("\n")
    print("Password:"+password)
No one still commented. Please first comment.
Output