Hello,
My problem is pretty simple, everytime I call botometer inside a SubProcess, botometer won't use the user_name (screen_name) provided but will pick the one associated with the customer key account.
I managed to reproduce the problem on a second computer, on PyCharm and console, so I believe there might be a bug. Here are the way of reproducting it.
Env :
Python 3.7.9
botometer 1.6.1
tweepy 3.10.0
subprocess.py
import json
import os
import subprocess
import argparse
import re
p = subprocess.Popen(["venv/Scripts/python", "botometer.py", "-s \"realDonaldTrump\""], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = p.communicate()
p.kill()
output = str(output)
print(output)
botometer.py
import botometer
from config import consumer_key, consumer_secret, access_token, access_token_secret
import argparse
import re
# Authenticate
rapidapi_key = 'xxxxx'
twitter_app_auth = {
'consumer_key': consumer_key,
'consumer_secret': consumer_secret,
'access_token': access_token,
'access_token_secret': access_token_secret,
}
bom = botometer.Botometer(wait_on_ratelimit=True,
rapidapi_key=rapidapi_key,
**twitter_app_auth)
def fake_followers(screen_name):
result = bom.check_account('@' + str(screen_name))
return result['user']['user_data']['screen_name']
# Add arguments
parser = argparse.ArgumentParser(description="Bot detector")
parser.add_argument("-s", "--screen_name", dest="screen_name", help='screen_name of the user to be analyzed',
required=False)
args = parser.parse_args()
print(fake_followers(args.screen_name))
How to replicate :
add those files and a config.py file with the credentials (and add the rapidapikey in the botometer.py file)
create a venv and install the wished librairies
execute py .\botometer.py -s "realDonaldTrump" from console (with venv activated) to see that it's properly working (i.e returning realDonalTrump)
execute py .\subprocess.py and see that's it not properly working (i.e not returning realDonaldTrump but your own account associated with the credentials).
Feel free to ask for clarifications or more informations.
Have a nice day and thank you for this amazing tool !
Hello, My problem is pretty simple, everytime I call botometer inside a SubProcess, botometer won't use the user_name (screen_name) provided but will pick the one associated with the customer key account.
I managed to reproduce the problem on a second computer, on PyCharm and console, so I believe there might be a bug. Here are the way of reproducting it.
Env : Python 3.7.9 botometer 1.6.1 tweepy 3.10.0
subprocess.py
botometer.py
How to replicate :
py .\botometer.py -s "realDonaldTrump"
from console (with venv activated) to see that it's properly working (i.e returning realDonalTrump)py .\subprocess.py
and see that's it not properly working (i.e not returning realDonaldTrump but your own account associated with the credentials).Feel free to ask for clarifications or more informations. Have a nice day and thank you for this amazing tool !