schollz / twittermatic

7 stars 3 forks source link

problem with json #17

Closed tdinformatique closed 8 years ago

tdinformatique commented 8 years ago

Sir, Thank you for this beautiful tool I tried your script:

from lib import * bot = TwitterBot('data/default.json') # Load bot bot.makefriends()

and I get this error :

Database.init_db: INFO Setting up database Database.initdb: INFO Database setup complete /home/(**)/Desktop/twittermatic-master/lib.py:95: ResourceWarning: unclosed file <_io.TextIOWrapper name='data/default.json' mode='r' encoding='UTF-8'> self.settings = json.load(open(settingsFile, 'r')) data/default.json: DEBUG Initialized data/default.json: DEBUG Signing in... data/default.json: DEBUG Using login method 2 data/default.json: DEBUG https://twitter.com/ Traceback (most recent call last): File "essay.py", line 3, in bot.makefriends() File "/home/(_)/Desktop/twittermatic-master/lib.py", line 249, in makefriends self.signin() File "/home/(_)/Desktop/twittermatic-master/lib.py", line 188, in signin self.getStats() File /home/(**)/Desktop/twittermatic-master/lib.py", line 1031, in _getStats self.settings['followers'] = int(following[2].text.replace(',', '')) IndexError: list index out of range sys:1: ResourceWarning: unclosed file <_io.BufferedWriter name='/dev/null'> /usr/lib/python3.4/importlib/_bootstrap.py:2150: ImportWarning: sys.meta_path is empty

schollz commented 8 years ago

I suspect this is because your account is following no one? I added in try-catches so that this shouldn't be a problem anymore.

There may be yet more debugging to do so please be patient, and keep sending me issues!

tdinformatique commented 8 years ago

ok