Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Posts not public and cut off badly #37

Open
mirabilos opened this issue Nov 6, 2022 · 0 comments
Open

Posts not public and cut off badly #37

mirabilos opened this issue Nov 6, 2022 · 0 comments

Comments

@mirabilos
Copy link

--- a/feediverse.py
+++ b/feediverse.py
@@ -54,7 +55,11 @@ def main():
             if args.dry_run:
                 print("trial run, not tooting ", entry["title"][:50])
                 continue
-            masto.status_post(feed['template'].format(**entry)[:499])
+            postbody = feed['template'].format(**entry)
+            if len(postbody) > 499:
+                postfix = "…\n\n(more…)"
+                postbody = postbody[:(499 - len(postfix))] + postfix
+            masto.status_post(postbody, visibility='public')
 
     if not args.dry_run:
         config['updated'] = newest_post.isoformat()

I was first considering making the length configurable, but posting a longer entry leads to people having to click a button first in Pinafore, for example. So add an indicator that it’s cut off.

Also, set the post visibility — this should probably be a config item, ideally one that can be set globally but overridden per feed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant