ianklatzco / atprototools

easy-to-use and ergonomic library for interacting with bluesky
MIT License
62 stars 11 forks source link

making posts with mentions and URL cards #4

Open MostWrong opened 1 year ago

MostWrong commented 1 year ago

WIP: idea is to use resolveHandle to populate the facets field in the post request JSON along with start and end position for the mention (anything starting with an @ and has spaces in the beginning/end and resolves to a handle)

for URL cards, thinking of something like this - https://github.com/aliceisjustplaying/atproto-starter-kit/blob/main/index.ts

ianklatzco commented 1 year ago

cool!

this is how i'd go further:

MostWrong commented 1 year ago

mentions are done ( and tested ) , now I guess it's time to add support for URL cards ( same PR)

MostWrong commented 1 year ago

@ianklatzco slightly confused about adding support for URL cards; as the user can ideally place the link anywhere within the text should I just make a method which takes in a substring of the skoot; or a starting and ending position?

ianklatzco commented 1 year ago

at a first glance without thoroughly understanding, start/end positions is probably the right way to do it because that's how the twitter API works for knowing where to highlight urls. looking closer....

ianklatzco commented 1 year ago

Trying to understand what facets are:

ianklatzco commented 1 year ago

image

image

ianklatzco commented 1 year ago

if you're feeling it, maybe split get_invites and facets into two separate PRs? that way i can quickly merge the get_invites one, and we can cleanup the facets one to merge cleanly after ^^