magicalraccoon / tootstream

A command line interface for interacting with Mastodon instances
MIT License
259 stars 32 forks source link

New toot_parser features #147

Closed erinolivia closed 6 years ago

erinolivia commented 6 years ago

Hi! I've had these toot_parser features lying around for a while and I finally got a chance to clean them up. This adds a few new features to toot parser that aren't yet enabled in tootstream.

link/mention/hashtag styles - Styles can be passed in to toot parser to change the color/style of links, mentions, and hashtags.

retrieving links from a toot - Toot parser will generate a list of urls found in the source toot that can be retrieved with get_links()

emoji short code conversion - Standard emoji short codes can be converted into unicode emoji by using https://github.com/carpedm20/emoji/

link shortening - Mastodon shortens links by embedding span tags that hide certain parts of the link and adds ellipsis to the end of the link. Toot parser now supports shortening links using this method.

magicalraccoon commented 6 years ago

Nice to have real emojis now!

craigmaloney commented 6 years ago

I'm a little concerned that this includes a complete TextWrapper implementation, since it's part of the standard library. Would you remove this?

Thanks!

erinolivia commented 6 years ago

Sure - done. I can figure out a better way to do this later especially since text wrapping is not enabled by default in tootstream right now.

craigmaloney commented 6 years ago

Looks good. Thank you!