Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: substring not found #6

Open
ghost opened this issue Apr 20, 2017 · 1 comment
Open

ValueError: substring not found #6

ghost opened this issue Apr 20, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 20, 2017

Hi,
I've a got a "locale" problem between Mastodon and usercount bot. When i put in .env.production file of Mastodon :
DEFAULT_LOCALE=fr
then usercount stop working and give an error :

Traceback (most recent call last):
File "usercount.py", line 98, in
current_id = int( get_between(pagecontent, "Home to", "users").replace(",", ""))
File "usercount.py", line 92, in get_between
return s[(s.index(substring1)+len(substring1)):s.index(substring2)]
ValueError: substring not found

@csabyka
Copy link

csabyka commented Aug 22, 2018

its caused by these lines:
Get the number of users, removing commas
current_id = int( get_between(pagecontent, "Home to", "users").replace(",", ""))

Get the number of toots, removing commas
num_toots = int (get_between(pagecontent, "Who authored", "statuses").replace(",", ""))

try to replace Home to, users, Who authored and statuses .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant