Diverging my eyes is very easy and painless. Crossing my eyes kinda hurts.

This is probably because I’m nearsighted and don’t use my glasses when using my phone and instead hold my phone 20cm from my face. They’re already crossed from doing that and crossing them even more is difficult.

Diverging your eyes is how magic eye posters work.

  • @CrayonRosaryOP
    link
    35 months ago

    A bot is just a piece of code that: wakes up periodically, reads from the Lemmy API, and occasionally takes some actions like posting comments via the Lemmy API.

    You could write it in Python and host it on Python Anywhere as an always-on task. Costs $5/mo for the minimum account level that is allowed to have an always-on task. Then you just have to learn how to code all of the steps you mentioned using Python.

    You can develop and test it for free using a free account. You can simply open a bash console and run the script that does the periodic check but doesn’t have any of the looping and sleeping an always-on script would have.

    You can also make a free Django website at the same time with a button you press to run the script without having to log into the backend console. (You can use cookies so you, yourself, are always logged in.) It would only need to be refreshed once a day, and if you ever want to make it faster, you can upgrade to a $5/mo account and make your always-on task to check Lemmy every 15 minutes or something.

    You would need a database (or at least a text file at first) to hold post IDs you’ve already seen and processed so you don’t spend any time with them again. The Lemmy API might have a mechanism to load all new posts after some ID or date-time. Maybe you store a last-updated date-time instead of a post ID. It depends on the API. Either way you have to make sure the process resumes in an elegant way after a crash or restart, probably by checking it’s most recent work.

    You will likely want to cache all generated images for a little while to help with resuming work in the middle of a processing a batch of posts after it crashes.

    It could use some retrying logic to deal with temporary internet outages without retrying too many times or spamming the API.

    You also have to ensure repeated, rapid crashes of your process don’t cause accidental spamming to the API. Especially make sure you don’t make repeat comments. Check your work, see what new work there is to do, log what work you’re about to attempt as a batch, then do that work. Catch all errors while logging them in the database (or log files) for later inspection. And use that data to also help with automatic retries later.

    Splitting the images and swapping the sides is the trivial part.

    I do wonder if anyone has a Lemmy bot platform where all you program is the work itself. Or at least an open source template for hosting your own. Maybe everything bot-related is already done for us and we just have to make sure it has the necessary features to make it play nice.