twitter / twitter-text

Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.
https://developer.twitter.com/en/docs/counting-characters
Apache License 2.0
3.07k stars 520 forks source link

Missing docs? #319

Closed transitive-bullshit closed 4 years ago

transitive-bullshit commented 4 years ago

Several previous issues like #303 reference docs like https://developer.twitter.com/en/docs/developer-utilities/twitter-text which seems to no longer exist.

Searching the twitter developer docs for "twitter-text" yields no results and the list of official twitter libraries no longer mentions twitter-text.

Which leads me to a few questions:

  1. Where can we go to view basic documentation for these packages aside from reading through the source code? I'm specifically interested in the JS library.
  2. Is this library still actively maintained by Twitter?
  3. If I have a tweet object from the Twitter API, what's the best way in JS to manage it with convenience methods?

Thanks!

andypiper commented 4 years ago

Thanks for raising this. As part of resolving issue #303, we took down the page on the developer website, as the content was being duplicated between that page, the README for the library, and the Counting Characters page (which now is in much better shape in terms of describing the way this library handles counting).

You're right that twitter-text therefore lost its prominence on the developer site, and we need to work on fixing that. The Counting Characters page does point at this repository, but I think that may be the only reference to it.

Answers for you:

  1. Each of the relevant packages should be published to their respective package managers (npmjs in the case of the JS code) and documented there and in the local readmes here on GitHub.

  2. Yes, this library is maintained, and we do our best to keep any internal changes in sync with GitHub. Sometimes there are some delays, related to using slightly different review and CI tooling etc internally.

  3. "It depends" - on what you want to do.

For example, I have a Gist here that takes a Tweet's text and then validates and tokenizes it using the JS library.

Note that twitter-text is all about tokenizing the text content of a Tweet - it does nothing special with anything else you'll find in a Tweet JSON object.

transitive-bullshit commented 4 years ago

Awesome, thanks for the thorough answer Andy 💯