olafmoriarty / blue-bots-done-quick

A version of Cheap Bots, Done Quick written for Bluesky
Apache License 2.0
13 stars 1 forks source link

feature request: SVG & ability to turn off after going live #6

Closed alien-sunset closed 2 weeks ago

alien-sunset commented 3 weeks ago

it looks like there is no choice for "don't post at all" in the posting frequency drop down. this is a bit problematic if I decide to go live but then need to change the code or poke things. (although I suppose i could use "every week" but i'm a little concerned if maintenance ends up taking longer

also, I wanted to import one of my mastodon bots from Cheap Bots Toot Sweet, but it outputs SVG images. and it doesn't appear like Blue Bots can't do that yet? (og bot: https://botsin.space/@Soft_Skylines)

image image

olafmoriarty commented 3 weeks ago

There actually is a way to turn off the bot after going live - it's a separate deactivate button and not an option in the frequency list. I'll see if I can add Never to the list as well, but the functionality of turning off posting during maintenance already exists.

SVG is unfortunately not supported yet, but you're not the first person to ask for it, and it's already the next planned update, which hopefully won't take TOO long.

alien-sunset commented 3 weeks ago

oh, also, I notice that your handling of alt text is slightly different than cheap bots. is there any particular reason for this?

(just hoping that it can also be done similarly to chap bots so I don't have re-write all my alts - I have another bot I'd like to import eventually that posts pieces of Remedio Varo's art and each individual piece has it's own alt text and there are over 200 entries! 😅)

olafmoriarty commented 3 weeks ago

Honestly I didn't know that cbdq allowed alt text at all, so I just picked a solution that made sense to me. How does cbdq handle alt text? I'm a big fan of doing things similarly as long as it's practically possible, as I assume "people just wanting to import their twitter bots" is a significant share of the user base...

alien-sunset commented 3 weeks ago

Cheap Bots Toot Sweet does: https://cheapbotstootsweet.com/

image

so the tracery for one of my images looks something like this:

"Star Porridge / Papilla Estelar (1958) \n https://www.remediosvaro.art/paintings/papilla-estelar \n{img https://remedios-varo-art-images.s3.amazonaws.com/114-papilla-estelar.jpg}{alt Star Porridge / Papilla Estelar (1958) by Remedios Varo (1908 - 1963)} \nFeel free help improve this bot by suggesting better alt text in the comments, thanks. \n\n ",

I'm honestly not sure the twitter version ever did allow for alt text 🫤

alien-sunset commented 3 weeks ago

I think you are using a completely different language, but the git for cheap bots toot sweet is here:

https://github.com/BooDoo/CheapBotsTootSweet

olafmoriarty commented 2 weeks ago

TODO:

Backend:

Frontend:

alien-sunset commented 2 weeks ago

maybe I jumped the gun... but it doesn't seem to be working:

image

(this is the exact code pulled from softSkylines CBTS page, with a quick fix for different alt text handling)

adding some way for the edit page to actually display the image/svg would help troubleshoot/make sure the tracery is correct before having to wait over an hour for the bot to refresh, update and post.

(even with "every ten minutes selected, if your code only refreshes/updates every hour it takes FOREVER to see if anything actually works, and only by actually posting to your account, which is especially sucky when something goes wrong)

olafmoriarty commented 2 weeks ago

Thanks, I'll look into it. I tested your code myself and the SVG definitely works fine, so there's probably an issue with the function that converts SVG to PNG and uploads it to bsky, so I'll troubleshoot there at first opportunity.

And yeah, an SVG preview on the edit page is definitely on the todo-list.

olafmoriarty commented 2 weeks ago

@alien-sunset Okay, there were quite a few issues here, but I think they should all be solved now. I took the liberty of testing it with your soft-skylines code, and it generated the intended code.

Problem 1- the part of the code who checked whether your post was shorter than 300 characters, didn't strip out the SVG tag before doing that check. Fixed.

Problem 2 - for some bizarre reason, the regex I used to extract the SVG tag stopped working if the tag was more than appr. 8190 characters long. I replaced it with another regex and now it works. (The downside of this is that there is no longer a way to escape "}" symbols inside the SVG code - but I assume that doesn't occur too often, and while that's something I wish to get back eventually, I think we can live without it for now.)

Problem 3 - I was missing a library, so when ImageMagick tried drawing the SVG, it didn't support all the tags (the most important one being ).

All of these problems are now solved and you should be able to post skylines now.

Leaving this issue open until alternative {alt} syntax and SVG previews is added.

alien-sunset commented 2 weeks ago

wow, that's an impressive list 😮 glad I can be your bug finder 😅

I'll set soft skylines going in a little bit here

(the next trick will be if my new Alien's Aliens bot works, that one gave me conniptions over on CBTS, but I have it working there so hopefully it should work here too 🤞 (although it is over 85,000 characters long (excluding spaces - 90,500 with) i hope that won't be an issue 😬)

alien-sunset commented 2 weeks ago

oop... looks like the bot preview bit still has some kinks too....

image