A place to cache linked articles (think custom and personal wayback machine)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.md 7.6KB

4 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. title: Syndicating to Medium
  2. url: https://adactio.com/journal/9694
  3. hash_url: cb7f3028da7f4c456f4a1b20a8c443bb
  4. <p>When I brainpuked <a href="https://adactio.com/journal/9646">my thoughts on Google’s AMP project</a>, I finished up by saying it was one more option for the <a href="https://indiewebcamp.com/">Indie Web</a> approach to syndication:</p>
  5. <blockquote>
  6. <p>When I publish something on adactio.com in HTML, it already gets syndicated to different places. This is the Indie Web idea of <a href="https://indiewebcamp.com/POSSE">POSSE</a>: Publish (on your) Own Site, Syndicate Elsewhere. As well as providing RSS feeds, I’ve also got <a href="https://adactio.com/journal/7130">Twitter bots</a> that syndicate to Twitter. An <a href="https://ifttt.com/">If This, Then That</a> script pushes posts to Facebook. And if I publish <a href="https://adactio.com/notes/photos">a photo</a>, it goes <a href="http://flickr.com/photos/adactio">to Flickr</a>. Now that <a href="https://github.com/Medium/medium-api-docs">Medium is <em>finally</em> providing a publishing API</a>, I’ll probably start syndicating articles there as well. The more, the merrier.</p>
  7. </blockquote>
  8. <p>Until <a href="https://medium.com/">Medium</a> provided an API, I didn’t see much point in Medium. Let me clarify: I didn’t see much point in it <em>for me</em>. I’ve already got a website where I can publish whatever I like. For someone who doesn’t have their own website, I guess Medium—like Facebook, Twitter, Tumblr, etc.—provides a place to publish. I think this is what people mean when they use the word “platform” in a digital—rather than a North Sea oil drilling—sense.</p>
  9. <p>Publishing exclusively on somebody else’s site works pretty well right up until the day the platform turns out to be a trap door and <a href="http://indiewebcamp.com/site-deaths">disappears from under you</a>. </p>
  10. <p>But I’m really puzzled by people who already have their own website choosing to publish on Medium instead. <a href="https://medium.com/@andrhia/the-problem-with-medium-336300490cbb">A shiny content farm is still a content farm</a>.</p>
  11. <p>“It’s the reach!” I’m told. That makes me sad. The whole point of the World Wide Web is that everybody has an equal opportunity to share their thoughts. You don’t need to ask anyone for permission. The gatekeepers of the previous century—record labels, book publishers, film producers—can’t stop you from making whatever you want and putting it out there for the world to see. And thanks to the principle of net neutrality baked into the design of TCP/IP, no one gets preferential treatment.</p>
  12. <p>Notice that I said “people who already have their own website choosing to publish on Medium <em>instead</em>.” That last bit is important. Using Medium to publish <em>copies</em> of what you’ve already published on your own site gives you the best of both worlds: ownership and reach. <a href="http://known.kevinmarks.com/2015/the-web-is-the-network">That’s what Kevin does</a>, for example. <a href="https://medium.com/@zeldman">And Jeffrey</a>. Until recently that was quite a pain in the ass, requiring a manual copy’n’paste process.</p>
  13. <p>Back when Medium first launched, <a href="https://medium.com/i-m-h-o/we-could-make-history-349109119cee">Dave Winer said</a>:</p>
  14. <blockquote>
  15. <p>Let me enter the URL of something I write in my own space, and have it appear here as a first class citizen. Indistinguishable to readers from something written here.</p>
  16. </blockquote>
  17. <p>It still isn’t quite that simple, but now that <a href="https://github.com/Medium/medium-api-docs">Medium has a publishing API</a>, it’s relatively straightforward to syndicate copies of your posts to Medium at the moment you publish on your own site.</p>
  18. <p>Here’s what I did…</p>
  19. <p>First of all, I signed up for a Medium account. For the longest time, even this simple step was off-limits for me because Medium used to require authentication using Twitter. By itself, that’s not a problem. The problem was that Medium demanded write permissions for my Twitter account. <a href="https://adactio.com/journal/5995">Just say no</a>.</p>
  20. <p>Now it’s possible to sign up for Medium using email so that <a href="http://solita.tumblr.com/post/31458949716/this-is-rude-this-is-not-lets-be-polite">rudeness</a> is less of an issue (although I’d really like to see Medium stop being so demanding when it comes to Twitter permissions, especially as the interface copy bends over backwards to promise that Medium would never post to Twitter on my behalf …so why ask for permission to do just that?).</p>
  21. <p>Once I had a Medium account, I needed two pieces of secret information in order to use the API.</p>
  22. <p>The first piece is an access token.</p>
  23. <p>I went to <a href="https://medium.com/me/settings">my settings on Medium</a> and scrolled all the way to the bottom to the heading “Integration tokens”. I entered a description (“Syndication from adactio.com”) and pressed the “Get integration token” button.</p>
  24. <p>Now I could use that token to get the second piece of information: my user ID.</p>
  25. <p>I opened up a browser tab and went to this URL: <a href="https://api.medium.com/v1/me?accessToken=">https://api.medium.com/v1/me?accessToken=</a> …adding my new secret integration token to the end.</p>
  26. <p>That returns a JSON response. One of the fields in the JSON object has the name “id”. The value of that field is my user ID on Medium.</p>
  27. <p>With those two pieces of information, I could make an authenticated POST request using cURL. Here’s <a href="https://gist.github.com/adactio/c174a4a68498e30babfd">the PHP code I’m using</a>. It’s probably terrible but please feel free to use it, copy it, fork it, or do anything else you want with it.</p>
  28. <p>When I run that code, I get a JSON response back from Medium’s API. Assuming I get a successful response, I can store the URL of the Medium copy and link out to it from here. That copy on Medium has a corresponding <code>link rel="canonical"</code> in the <code>head</code> of the document pointing back here to adactio.com.</p>
  29. <p>That’s pretty much it. I added a checkbox to my posting interface so that sending a copy of a post to Medium is just a toggle away. I’ll tick that checkbox when I post this. You could be reading this on my site or you could be reading the copy on Medium.</p>
  30. <p>The code I wrote is pretty similar to <a href="https://adactio.com/journal/6826">how I post notes to Twitter</a> and <a href="https://gist.github.com/adactio/a9c7e419b2913f318bd1">photos to Flickr</a>. In fact, posting to Medium is more straightforward: Flickr requires three bits of secret information; Twitter requires four.</p>
  31. <p>What would make this cross-posting with Medium really interesting would be if it could work in both directions. Then I’d be able to use the (very nice) writing interface on Medium to publish on adactio.com.</p>
  32. <p>That’s not so far-fetched. I’ve already got a <a href="http://indiewebcamp.com/micropub">micropub</a> endpoint here on my site (here’s <a href="https://gist.github.com/adactio/8168e6b78da7b16a4644">the code</a>). That’s how I’m able to use Instagram to post photos to my own site (using <a href="https://ownyourgram.com/">OwnYourGram</a>). I let Instagram keep a copy of my photo. I’d be happy to let Medium keep a copy of my post.</p>
  33. <p><a href="https://medium.com/i-m-h-o/we-could-make-history-349109119cee">We could make history</a>:</p>
  34. <blockquote>
  35. <p>We need to break out of the model where all these systems are monolithic and standalone. There’s art in each individual system, but there’s a much greater art in the union of all the systems we create.</p>
  36. </blockquote>