re: I'm concerned with the move that FreeCodeCamp just pulled by leaving Medium VIEW POST

re: That's not correct. If you import a post using Medium's tool it is assigned a canonical_url. (You can't set it directly, only through import). Many...

Can you point to some such articles? I can check their canonical links.

There are screenshots in the post that we're commenting on that show examples of this happening with Ali's post. The original canonical_url on medium points back to her dev.to post. The new site points back to the medium post, a different url.

I would check the one Ben put in this blog post.

Looks like you might be able to get it via the API: github.com/Medium/medium-api-docs#...

Eg they say a post object has a canonicalUrl, attribute. I can't tell from reading the docs, whether you can GET them via the API. All the examples are creating Medium posts via POST requests, and none are showing existing posts via GET requests.

But you presumably found some way to get it, so if you're getting it through an API endpoint, then check it for the canonicalUrl attribute. And if you're getting it by scraping it, then check for the link tag, eg this prints the expected value:

curl -s https://medium.com/free-code-camp/the-most-important-non-programming-skills-for-programmers-d39fadc1a0fa \
 | ruby -ne '~/<link\s+rel="can.*?"([^"]*)">/ && puts($1)'

(in reality, I'd use the CSS selector link[rel="canonical"], but I wanted an example that didn't require installing fancy tooling)

Code of Conduct Report abuse