Skip to content

Instantly share code, notes, and snippets.

@tomcook
Created November 22, 2024 00:21
Show Gist options
  • Save tomcook/25e64df1f72597cbad4b63eae3760c1a to your computer and use it in GitHub Desktop.
Save tomcook/25e64df1f72597cbad4b63eae3760c1a to your computer and use it in GitHub Desktop.
atproto / python rich text length checker
import random
import string
import regex
from atproto import Client, client_utils
client = Client()
client.login('username', 'pass')
characters = string.ascii_letters
random_string = ''.join(random.choices(characters, k=295))
print(random_string)
post_content = client_utils.TextBuilder().text(random_string).link('Zombo', "https://www.zombo.com")
skeet_graphemes = regex.findall(r'\X', post_content.build_text())
print(len(skeet_graphemes))
post = client.send_post(post_content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment