lynnesbian / mstdn-ebooks Goto Github PK
View Code? Open in Web Editor NEWNO LONGER BEING UPDATED, NOT GUARANTEED TO WORK AT ALL
License: Mozilla Public License 2.0
NO LONGER BEING UPDATED, NOT GUARANTEED TO WORK AT ALL
License: Mozilla Public License 2.0
functions.py in particular is disgraceful
I'm not quite sure why it's not doing this as I was sure this was a feature that is implemented. Everything is set up according to the guide, and I re-set up the bot again just now to make sure. Is there a glaringly obvious configuration option that I could be missing?
Running this on ubuntu server 18.04.3 LTS if that matters.
While this project is small, I think it would be a good idea to put the current code into a proper installable package.
I can submit a PR if you like.
We need an oauth token but I don't know how to get one
As described here: https://fedi.lynnesbian.space/web/statuses/102094864542977892
The bots could check how many faves and boosts a given post gets over X hours/days, then save the "score". They could use this to keep a "best of" list.
I got an error when running gen.py
with --simulate
. Apparently the script fails when trying to decode the "zany-face"-Emoji.
╭─lerk@comm ~/mstdn-ebooks ‹master*›
╰─$ python3 ./gen.py --simulate
Traceback (most recent call last):
File "./gen.py", line 39, in <module>
print(toot['toot'])
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f92a' in position 100: ordinal not in range(128)
Can I ignore invalid characters somehow?
There are multiple situations that will cause an ebooks bot to create an infinite reply loop:
We need to guard against this. One possible option is to ignore a thread after already replying in it five times.
Turns out that snowflake IDs broke mstdn-ebooks a while ago and nobody noticed until now
Hello,
I've tried using this and generation wouldn't work, so I dug into the code and found out that all toots' content in the db were empty. Looking further, I've found the reason : 8274409 line 73
This commit changed the handling of p tags from "Append a line break and unwrap" to "replace with a linebreak". I'm assuming that's an unfortunate copy/paste with the above change about br tags, but either way the result is that all content inside p tags is sent into oblivion. I don't know if it's common or something about my instance but all of my toots' content are wrapped in a p tag, thus the database emptiness. Reverting that change made the code work again for me.
Hiiiiii!
Was reading through the ebooks bot guide and it sort of dawned on me that it'd be really simple to set up a button on the repo to deploy it to Now.sh or Heroku (probably the former because it supports Docker).
Docs:
I've only really ever had luck with the latter but I haven't tried Docker on Now.sh yet, might work better.
Happy to PR if it helps! 💚
-Andi
This isn't possible with the current AP outbox method, and will require re-implementing the legacy method. It will only work with Mastodon instances.
Right now, rate limiting produces the generic "fucky wucky" error. We should catch the HTTP error (if any) and print something more helpful in case of HTTP 429.
here is the error output, running the latest version from git, i tried twice so it did get through some tootsmews but eventually there came a problem toot
WebFingering...
catgirl.science is a pleroma instance -- falling back to legacy toot collection method
Downloading and parsing tootsEncountered an error! Saving toots to database and exiting.
WebFingering...
catgirl.science is a pleroma instance -- falling back to legacy toot collection method
Downloading and parsing tootsEncountered an error! Saving toots to database and exiting.```
If someone the bot is following types "@.bot pin" to a post, the bot will pin the post. "@.bot unpin" would also be possible.
Keep track of the top 10 people to fave/boost the bot's posts, because why not
I have a user with one post which breaks the script with the following error:
Using config.json as configuration file
Downloading posts for user @robin, starting from 0
WebFingering...
Using Pleroma compatibility mode
Traceback (most recent call last):
File "main.py", line 199, in <module>
j = j['first']
KeyError: 'first'
The issue seems to be that the JSON being returned does not contain a next
field (presumably because there are no next posts to load) and so the script assumes Pleroma compatibility mode is needed, which then causes the rest of the script to fail.
Using config.json as configuration file
Downloading posts for user @[email protected], starting from 0
WebFingering...
Using standard mode
Downloading and saving posts............................................ Done!
Downloading posts for user @[email protected], starting from 0
WebFingering...
Using standard mode
Downloading and saving posts................................. Done!
Downloading posts for user @[email protected], starting from 0
WebFingering...
Using standard mode
Downloading and saving posts........... Done!
Downloading posts for user @[email protected], starting from 0
WebFingering...
Using standard mode
Traceback (most recent call last):
File "/app/main.py", line 215, in
j = r.json()
File "/usr/lib/python3.8/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Using config.json as configuration file
Downloading posts for user @[email protected], starting from 40dd49ac-3b6e-4ea6-9f99-7415a57bed3c
WebFingering...
Using standard mode
Traceback (most recent call last):
File "/app/main.py", line 215, in
j = r.json()
File "/usr/lib/python3.8/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
TODO on
Line 57 in dd7a4ef
Not sure if this is still valid but still listed as a TODO. @Lynnesbian can you confirm if this is still broken as it seems to be working on live bots?
Certain terms keep coming up (names of instances, names of people) that I don't want. Allowing a filter to remove certain words from being used in posts by filtering them from being learned from would make the Bot Experience Better
This would prevent unclosed quotes and parentheses while mostly leaving things intact.
mstdn-ebooks shouldn't make posts that start with mentions
Multithreading doesn't actually work properly, I need to fix it
Dependabot couldn't authenticate with https://pypi.python.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.