sutters / hq

All the things!
1 stars 0 forks source link

Post to Medium via CLI #7

Closed lambtron closed 9 years ago

lambtron commented 9 years ago

..with the new Medium API.

Kind of like plato, where you write in markdown and then have a few CLI commands.

$ medium post

or like

$ medium publish
lambtron commented 9 years ago
$ medium login

..will ask the user for Integration Token (more on self issued access tokens).

and

$ medium publish

Which will take the files from the below directory and post them:

- articles
|   - a-brave-new-prod
|       - index.md
|       - img.png
.

Use frontmatter/yaml in index.md for tags, etc..

lambtron commented 9 years ago

Waiting for response from Medium re: checking for existing posts. Otherwise, the command publish should programmatically (upon success) add some flag to the front matter that indicates whether or not the markdown file has been posted. The publish would also only publish markdown files where published is undefined or not true.

---
published: true
---
lambtron commented 9 years ago

Need to look into how other CLI's store tokens.

lambtron commented 9 years ago

https://devcenter.heroku.com/articles/authentication

Heroku stores in ~/.netrc

lambtron commented 9 years ago

Subcommands

create

login

publish

lambtron commented 9 years ago

https://www.npmjs.com/package/medium-cli