Skip to content

Instantly share code, notes, and snippets.

@bouzuya
Last active August 29, 2015 14:25
Show Gist options
  • Save bouzuya/687e6a833891c86a42e5 to your computer and use it in GitHub Desktop.
Save bouzuya/687e6a833891c86a42e5 to your computer and use it in GitHub Desktop.
A shell script that post a blog entry to my hatena-blog using hatena-blog-cli
#!/bin/bash
date=$1
year=$(echo ${date} | sed -e 's/\([0-9]*\)-\([0-9]*\)-\([0-9]*\)/\1/g')
month=$(echo ${date} | sed -e 's/\([0-9]*\)-\([0-9]*\)-\([0-9]*\)/\2/g')
markdown=/home/bouzuya/.ghq/github.com/bouzuya/blog.bouzuya.net/data/${year}/${month}/${date}-diary.md
source /home/bouzuya/profile.d/hatena.sh
hatena-blog create --jekyll ${markdown}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment