Summary
Welcome, If all goes well, you’ll be reading this post on Medium.
This post was written, not with that of the medium’s text editor, but with my own, (insert VSCode or Obsidian) since all I need is a requests
library from python or its equivalent in JS jquery?
This post was written in markdown. Markdown as a data format has a rich history, from its inception by the likes of John Gruber, an Apple Fanatic? (his daring fireblog) and the ever awesome Aaron Swartz, who fought for the democratization of all knowledge and against censorship, he played a large part in you getting free books, movies, series and whatnot at the internet archive and zlibrary , a genius prodigy, the one who shouldn’t have had to die, the way he did. It is sorrowful to say the least. You may not know him, but he is the co-founder of reddit. I use the old reddit every now and then to get international geopolitical news. Reddit, is the frontpage of the internet. Every news or meme passes through reddit before it reaches the rest of the internet.
More on Aaron, Wikipedia Link , his now preserved blog that i presume is written using atx
Also, let me bookmark this here, On Aaron Swartz’s legacy so that I can read it afterwards.
Apologies for the info dump
Ah, as I am writing this, I am not sure how to make sure an image makes its way to medium. You see, one could say i am writing in mdx (markdown extensible format) where I mingle markdown as well as html in between for images. I use Astro for the blog which I took as an inspiration from Ruhaan Chowdry’s blog, I originally intended to use Hugo. Anyway, since medium either takes in html or… markdown, i am not sure.
Btw, Ruhaan, you said yes to join a community with weekly or monthly meetups. Ill email you. There is an ever impending need to build a community now more than ever.
More on building a community on the next post, taking inspiration from the living visionary, Vitalik Buterin, the founder of Ethereum from his post on Network States . Have awesome concepts that I wish to discuss through my blog. Ah, I have forgotten to share the blog in question havent I? I am brainfogged like that.
Its abdu.fyi. Make sure to give a visit! Ah, I havent included analytics yet, so I wont even know if you decide to drop in.
Now that I have visited Vitalik’s blog, the font seems awesome. I think its Inter. Maybe I should add it to mine.
Steps
Now that I have delved into research while writing this, I chanced upon this post, Markdown to Medium. The open internet is awesome!
I have zero knowledge of how or what astro is. There are wierd .astro
file extensions populating my side bar right now. All I know is that astro is a static blog starter kit written in nodejs
First, I go to medium to fetch my integration token. This is what I add to notify medium that I am abdu and that I wish to post this (post?) on my medium page.
Then, I do a GET
request to Medium’s API endpoint which is,
GET https://api.medium.com/v1/me
GET /v1/me HTTP/1.1
Host: api.medium.com
Authorization: Bearer <integration-token>
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
Doing this, will fetch me my user details. Notice, that in the Authorization header, you add your own token.
With the userid
fetched, now you do a POST
request to the following endpoint, like this.
POST /v1/users/5303d74c64f66366f00cb9b2a94f3251bf5/posts HTTP/1.1
Host: api.medium.com
Authorization: Bearer 181d415f34379af07b2c11d144dfbe35d
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
{
"title": "Liverpool FC",
"contentFormat": "html",
"content": "<h1>Liverpool FC</h1><p>You’ll never walk alone.</p>",
"canonicalUrl": "http://jamietalbot.com/posts/liverpool-fc",
"tags": ["football", "sport", "Liverpool"],
"publishStatus": "public"
}
now, the question remains, how do I sync my posts with that of Medium’s so that I dont need to manually invoke a command every time I issue a blog post? Also, to note that I need to parse this post, fetch URLs for images, and then upload them to medium and change the links of to that of medium’s own endpoints as medium probably only shows images that it stores in its servers.