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

Document blog UUID format #138

Open
marcustyphoon opened this issue Sep 25, 2024 · 2 comments
Open

Document blog UUID format #138

marcustyphoon opened this issue Sep 25, 2024 · 2 comments

Comments

@marcustyphoon
Copy link
Contributor

marcustyphoon commented Sep 25, 2024

I doubt this would be at all necessary for third party uses of the API, but for web extensions, it would be nice to have a confirmation of the blog UUID format. It appears to be t: and then 22 base64url-valid characters (t:[a-zA-Z0-9-_]{22})?

This does, I suppose, also sort of apply to the blog name format (presumably [a-z0-9-]{1,32} with no leading/trailing hyphens, per https://help.tumblr.com/changing-your-username-url/ — although my understanding is that some people have had nonconforming blog names with leading/trailing hyphens?) and to post ids (used to be some lower integer, now snowflake?)

@cyle
Copy link
Member

cyle commented Sep 25, 2024

It appears to be t: and then 22 base64url-valid characters (t:[a-zA-Z0-9-_]{22})?

yep, that's correct. we can make that more explicit in the docs!

blog name format ... [a-z0-9-]{1,32}

there are a lot of other factors that go into validating if a blog name is valid or not, but roughly, this is the start, yes. we also don't allow "tumblr" in the name, for example.

although my understanding is that some people have had nonconforming blog names with leading/trailing hyphens?)

yep, because the requirements and validation code itself has changed over time, and we haven't updated any that were previously against the current validation scheme.

and to post ids (used to be some lower integer, now snowflake?)

yeah, for post IDs, it's always been true to say that they're unsigned 64bit integers. it just so happens we hadn't breached the 32bit limit by using our previously more-or-less incrementally-updating ID number, and we changed to a proper snowflake ID in March 2020.

@marcustyphoon
Copy link
Contributor Author

Thanks! Yeah, I couldn't remember if the pre-snowflake ids were sequential or not, i.e. if they could be arbitrarily small. (And I guess in a sense I wasn't sure if the snowflake ones could be arbitrarily big, as Twitter's are limited to the signed integer range per Wikipedia, but the docs are clear on this, and anyway if I'm doing the math correctly that won't matter for the next 279 years or so. We can only hope Tumblr still exists at that time.)

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

2 participants