Commit Graph

2 Commits

Author SHA1 Message Date
Edward Loveall bb94fb41b1
Support medium's redirectUrl query param
When a post has a gi= query param, Medium makes a global_identifier
"query". This redirects via a 307 temporary redirect to a url that
looks like this:

https://medium.com/m/global-identity?redirectUrl=https%3A%2F%2Fexample.c
om%2Fmy-post-000000000000

Previously, scribe looked for the Medium post id in the url's path, not
it's query params since query params can include other garbage like
medium_utm (not related to medium.com). Now it looks first for the post
id in the path, then looks to the redirectUrl as a fallback.
2021-10-11 12:04:17 -04:00
Edward Loveall aacef34a14
Accept all known medium post path types
Including:

* https://example.com/my-cool-post-123456abcdef
* https://example.com/123456abcdef
* https://medium.com/@user/my-cool-post-123456abcdef
* https://medium.com/user/my-cool-post-123456abcdef
* https://medium.com/p/my-cool-post-123456abcdef
* https://medium.com/posts/my-cool-post-123456abcdef
* https://medium.com/p/123456abcdef

Replace any of those posts with the scribe domain and it should resolve
2021-10-03 16:45:20 -04:00