Traceback (most recent call last):
File "/Users/cuducos/.virtualenvs/twitter-cleanup/bin/twitter-cleanup", line 11, in <module>
load_entry_point('twitter-cleanup', 'console_scripts', 'twitter-cleanup')()
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/cuducos/Dropbox/Projects/twitter-cleanup/twitter_cleanup/__main__.py", line 36, in bots
context.obj["cleanup"].soft_block_bots(threshold=threshold / 100)
File "/Users/cuducos/Dropbox/Projects/twitter-cleanup/twitter_cleanup/__init__.py", line 91, in soft_block_bots
should_soft_block = user.is_bot()
File "/Users/cuducos/Dropbox/Projects/twitter-cleanup/twitter_cleanup/user.py", line 35, in is_bot
return self.botometer_result.probability > threshold
File "/Users/cuducos/Dropbox/Projects/twitter-cleanup/twitter_cleanup/botometer.py", line 45, in probability
self._get_result()
File "/Users/cuducos/Dropbox/Projects/twitter-cleanup/twitter_cleanup/botometer.py", line 32, in _get_result
result = self.botometer.check_account(self.user_id)
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/botometer/__init__.py", line 132, in check_account
bom_resp.raise_for_status()
File "/Users/cuducos/.virtualenvs/twitter-cleanup/lib/python3.6/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Proxy Error for url: https://osome-botometer.p.mashape.com/2/check_account
In addition to cache (so we could restart the process without re-requesting Botometer's probability for users we have already requested), we could automatically retry this self.botometer.check_account(self.user_id)
in case of a server error, since it seams to be an error typical from instability and not a request error.