Giter Site home page Giter Site logo

cheapbotstootsweet's People

Contributors

boodoo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

cheapbotstootsweet's Issues

VISIBILITY controls for statuses

Bots should be allowed to set visibility on status to one of the following:
public
unlisted
private
direct (for replies only)

Delete PNGs when we're done with them

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.

"Public" visibility is posting "Unlisted" instead

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' }

Support capture groups for replies

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.

support "focal point" for media

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.


More detail on focal points

SVG using namespace-less prefix renders in browser, won't post

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

Replies are always Public

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
};

Pleroma support

Especially to offer beeping.town as another bot-friendly alternative to botsin.space

KNOWN ISSUES:
Bridge

  • Statuses with description field (alt text) fail "silently"
    using Mastodon FE on beeping.town, data is POSTed to /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 Mastodon

Frontend: No impact? (untested, lol I wish)
Backend: Untested

results is not iterable

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.

Escaping characters with Tracery2

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);

(Some) imgur images are failing to upload with 422: Unprocessable Entity

[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.

Certain external image hosts lead to "Blue ?"

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.

301 Redirects Break SVG Image Elements

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.

Support "delayed expansion"

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"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.