boodoo / cheapbotstootsweet Goto Github PK
View Code? Open in Web Editor NEWHosting Tracery-based Mastodon bots for others https://cheapbotstootsweet.com
License: MIT License
Hosting Tracery-based Mastodon bots for others https://cheapbotstootsweet.com
License: MIT License
When I updated Frontend for CW/ALT/SHOW/HIDE I totally forgot about /source/index.php
This needs to be fixed ASAP.
The most challenging part about this will be updating behavior/documentation for character escaping logic (see #10)
Bots should be allowed to set visibility
on status to one of the following:
public
unlisted
private
direct
(for replies only)
Seems like the since_id
(last_reply
in our DB) isn't respected immediately after server upgrade?
Maybe just with major versions?
this happened when botsin.space upgraded to v2.5
Having some issues with /tmp
filling up as more image bots exist generating ~200-800KB images. Instead of leaving this to a cronjob we should clean up our own mess.
As reported on behalf of @[email protected]
Logs all show "public" but the bot's TL i a mixture of public and unlisted:
2023-05-21T08:21:44.760Z INFO umbralgold (https://botsin.space/@umbralgold) posting { status: 'a reckoning is not to be postponed indefinitely.', visibility: 'public' }
2023-05-21T09:21:46.666Z INFO umbralgold (https://botsin.space/@umbralgold) posting { status: 'honor… is the doing of what is good and noble when the world conspires to prevent you from it, and in that sense, i have never lived an honorable day. every service i have done has been the
path of least resistance.', visibility: 'public' }
2023-05-21T11:21:50.989Z INFO umbralgold (https://botsin.space/@umbralgold) posting { status: 'you holy boys roll deep.', visibility: 'public' }
2023-05-21T12:21:57.380Z INFO umbralgold (https://botsin.space/@umbralgold) posting { status: 'pop, that’s how i know that hera can’t be built. because if it could’ve been, you’d have done it already.', visibility: 'public' }
2023-05-21T13:22:01.472Z INFO umbralgold (https://botsin.space/@umbralgold) posting { status: "in my mind i thought the birds would sing and sparks would fly, but it's just quiet.", visibility: 'public' }
2023-05-21T15:21:45.228Z INFO umbralgold (https://botsin.space/@umbralgold) posting { status: "'you know, you believe in me in a way that no one ever has and... i could use some of that right now.' \n'i don't believe in you. you will fail without me. and the best part is you know that
.'", visibility: 'public' }
see server-side /prod/traceryhosting-backend/run_bots_error.log
for traces
followtrick...
do NOT work
Mastodon API doesn't respect the order of media_id array; CBTS should serialize the uploads of media so ensure order of assigned media_ids matches source grammar's media order.
Changes needed in both send_status
and backend
Treat media_promises a la Bluebird's mapSeries()?
Either a sensible enforced maximum, or be click/drag resizable.
This could be cool, right?
"If mention contains 1-6 characters of punctualphanumerics, separated from other text, return a variation on the 100 emoji containing that string":
{
"[\s\b]([!-z]{1,6})[\s\b]":
"[word:#capture#]#svg_prefix##word##svg-suffix# {alt an emoji like \"100\" but it reads \"#word#\"} {hide}"
}
See reply_for_account
in backend/run_bots.js
- this might be more trouble than it's worth.
When a MediaAttachment
is the image
type, it supports a focus{x,y}
object in its meta
payload [1]
Floating point -1.0 to 1.0 on each axis, where focus: {x: -1.0, y: -1.0}
being bottom-left, and focus: {x: 1.0, y: 1.0}
is top right -- default is {x: 0.0, y: 0.0}
which is center.
add/remove empty
class to div#status-media
/div#reply-media when processing tags, and update CSS rules accordingly?
Try:
{
"origin": "{svg #prefix##image##text#</svg>}",
"prefix": "<svg width='800px' height='400px'>",
"image": "<image xlink:href='https://placeimg.com/640/480/animals/image.jpg' width='300px' height='300px' preserveAspectRatio='xMidYMid slice'/>",
"text": "<text text-anchor='middle' x='20%' y='40%' style='font: italic 40px serif; fill: red;'>TESTING</text>"
}
FRONTEND: Renders in browser, Firefox notes parsing error Chrome doesn't complain
SEND_STATUS: does not successfully Post using Post! button (FF and Chrome both)
BACKEND: scheduled posting impact still TBD
When replying to a mention, bot should respect direct/private/unlisted flags when replying to mentions.
Proposed fix:
backend/run_bots.js ~ L289
var username = in_reply_to["account"]["acct"];
params = {
status: "@" + username + " " + status_without_meta,
in_reply_to_id:in_reply_to.status.id,
visibility: in_reply_to.status.visibility
};
Especially to offer beeping.town as another bot-friendly alternative to botsin.space
KNOWN ISSUES:
Bridge
description
field (alt text) fail "silently"/media
with a "filename" attribute that seeds image description field; changing this field sends a PUT to media/:id
with the description
field. This multi-step workflow is also documented for MastodonFrontend: No impact? (untested, lol I wish)
Backend: Untested
We rely on svg2png which hasn't been touched for 2 years and relies on PhantomJS.
PhantomJS is being sunset in favor of headless Chrome (via puppeteer).
Should consider alternatives.
TypeError: results is not iterable
at run (/opt/cbts/prod/traceryhosting-backend/run_bots.js:584:24)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
/opt/cbts/prod/traceryhosting-backend/run_bots.js:584
for (const result of results)
Pretty sure this happens during the REPLIES runs; haven't looked into it any further than that yet.
Issue with escaping some characters, particularly {
and }
(and #
) within a meta tag e.g. declaring styles within CSS:
{
"origin": "[name:#word#]{alt testing data-uri font, text reads '#name#'}#svgBody#",
"word": ["testing", "test", "issue", "bug"],
"svgBody": "{svg <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width='600px' height='150px'>#styleTag##text#</svg>}",
"styleTag": "<style> #fontFace# #textClass# </style>",
"fontFace": "@font-face \\\\{ font-family: '199x'; src: url(data:application/font-woff2;charset=utf-8;base64,#base64-font#) format('woff2'); font-weight: normal; font-style: normal; \\\\} ",
"textClass" : ".brand-font \\\\{ font-family: '199x'; font-size:240px; \\\\}",
"text": "<text text-anchor='middle' x='50%' y='68%' class='brand-font' fill='\\#2F0849'>#name#</text>",
"base64-font": "…"
}
Behavior is different with allowEscapeChars
flag:
// main.js ~l.385 : default
processedGrammar.flatten("#origin#");
// main.js ~l.385 : better(?)
processedGrammar.flatten("#origin#", true);
I already migrated the node components, I should migrate Frontend as well so everything is consistent.
[https://docs.joinmastodon.org/methods/media/#422-unprocessable-entity](422: Unprocessable Entity) for imgur-hosted images. Not all of them, but often. Including images that have previously posted successfully, and which appropriately use the i.imgur.com subdomain.
Seems to be related to changes in imgur's service, not CBTS, but it would be good to fix if possible.
Reported on behalf of @[email protected]
OK, this is going to take some actual debugging.
I think the issue is that I pass a request()
call into uploadMedia
as a Stream and this is maybe not always successful?
All image imports work in browser/frontend, but here are some hosts that do/do not work on backend:
http://boodoo.co ✅ (HTTP/1.1)
https://boodoo.co 🚫 (HTTP/2, TLS1.3 - LetsEncrypt)
https://www.newyorker.com ✅ (HTTP/1.1, TLS 1.2 - GlobalSign)
https://new-yorker-cartoon-url.glitch.me ✅ (HTTP/2, TLS 1.2 - Amazon)
https://postimg.cc 🚫 (HTTP/2, TLS 1.3 - LetsEncrypt)
https://cheapbotstootsweet.com 🚫 (HTTP/2, TLS1.3 - LetsEncrypt)
https://i.discogs.com/ ✅ (HTTP/2, TLS 1.3 - CloudFlare)
https://media.discordapp.net ✅ (HTTP/2, TLS 1.3 - CloudFlare)
Reverse-proxy issue or something?? what the hell is going on here.
Most likely to occur when an SVG composition has an image embed to https://imgur.com/someURL
as these all return 301 - Permanently Moved
status and instead of shunting over to https://i.imgur.com/someURL
the headless browser fails to load the resource at all.
This can be worked around by using the i.imgur.com
URL as the source initially, but an HTTP 301 really should be handled more gracefully than this...
in-browser Frontend preview works fine, of course, but it fails in puppeteer/headless Chromium when attempting to post.
An example provided by a user, which works in Tracery1 but fails in Tracery2:
{
"origin": "#[tweet:#start#]tweet#",
"start": "\\#helloworld\\#",
"helloworld": "omg what how"
}
It would be cool to find a way to carry this over into full Tracery2 migration (#13)
Either by fiddling with the escaping (#10) or, perhaps better, by way of a Tracery "modifier"?
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.