Skip to content

Instantly share code, notes, and snippets.

@tmd45
Created February 3, 2016 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmd45/e8de13c396a12956af25 to your computer and use it in GitHub Desktop.
Save tmd45/e8de13c396a12956af25 to your computer and use it in GitHub Desktop.
Qiita:Team で一年前の投稿を検索表示する。nkf コマンド必要
#!/bin/sh -e
echo "NOTE: I need command nkf. please 'brew install nkf'."
echo "NOTE: I'll open a result in browser."
echo ""
printf "Your Qiita:Team? (only subdomain) : "
read subdomain
printf "Who are you? : "
read userid
date1=$(date -v-1y +%Y-%m-%d)
date2=$(date -v-1y -v+1d +%Y-%m-%d)
# 認証必要だったorz 面倒だからブラウザ開いちゃおう
# curl -s -X GET \
# --data-urlencode "sort=rel" \
# --data-urlencode "q=created:>${date1}+created:<${date2}+user:${userid}" \
# https://${subdomain}.qiita.com/search
query_date1=$(echo "created:>${date1}" | nkf -wMQ | tr = %)
query_date2=$(echo "created:<${date2}" | nkf -wMQ | tr = %)
query_user=$(echo " user:${userid}" | nkf -wMQ | tr = %)
open "https://${subdomain}.qiita.com/search?sort=rel&sort=rel&q=${query_date1}+${query_date2}+${query_user}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment