Esempio n. 1
0
def getStpFollowS(tgID, username, startTime):
    global browser
    browser = start(tgID)
    profile_list, follow_list, added_list, stopped_list = dfLoad(tgID)
    profile_list, user = checkIfUsernameExist(profile_list, username)

    followers = fetchUserFollowing(user['id'])
    profile_list, follow_list, added_list, stopped_list = dfUpdateAll(
        profile_list,
        follow_list,
        added_list,
        stopped_list,
        followers,
        user['id'],
        target='following')
    new_stoping = stopped_list[(pd.to_datetime(stopped_list.date) > startTime)
                               & (stopped_list.iid_following == user['id'])]

    followers = fetchUserFollower(user['id'])
    profile_list, follow_list, added_list, stopped_list = dfUpdateAll(
        profile_list,
        follow_list,
        added_list,
        stopped_list,
        followers,
        user['id'],
        target='follower')
    new_stoped = stopped_list[(pd.to_datetime(stopped_list.date) > startTime)
                              & (stopped_list.iid_followed == user['id'])]

    dfSave(profile_list, follow_list, added_list, stopped_list, tgID)
    browser.close()
    return new_stoping, new_stoped
Esempio n. 2
0
def passwd(update: Update, context: CallbackContext) -> int:
    context.bot.delete_message(chat_id=update.message.from_user.id, message_id=(update.message.message_id)-1)
    context.bot.delete_message(chat_id=update.message.from_user.id, message_id=update.message.message_id)
    unTable = pd.read_parquet(os.path.join(credDirPath,"usernameTable"))
    un=unTable[unTable["tg_id"]==update.message.from_user.id].iloc[0]["username"]
    pw=(update.message.text)

    resp="Attendi qualche istante...\nTi dirò quando ho finito"
    resp=context.bot.send_message(chat_id=update.message.from_user.id, text=resp)

    browser = chrome.start(str(update.message.from_user.id),un,pw, forceLogin=True)
    browser.close()

    context.bot.delete_message(chat_id=update.message.from_user.id, message_id= resp.message_id)
    resp="Log In effettuato con SUCCESSO"
    context.bot.send_message(chat_id=update.message.from_user.id, text=resp)
    return ConversationHandler.END