Skip to content

Instantly share code, notes, and snippets.

@844196
Last active August 29, 2015 14:13
Show Gist options
  • Save 844196/38ccf2c89e4707bfcb67 to your computer and use it in GitHub Desktop.
Save 844196/38ccf2c89e4707bfcb67 to your computer and use it in GitHub Desktop.
$ cat ~/title.inm | sort | uniq | grep '\..*$' | sed -e "s/.*\(\..*\)$/\1/g" | sort | uniq -c | sort -r | head
241 .mp4
17 .mp893
7 .mp810
7 .exe
6 .
4 .mp3
4 .ksp
3 .pdf
3 .ntuy
3 .mp5
#!/bin/bash
for i in `seq 0 100 1500`
do
query="{\"query\":\"真夏の夜の淫夢\",\"service\":[\"video\"],\"search\":[\"tags\"],\"join\":[\"cmsid\",\"title\",\"view_counter\"],\"from\":${min},\"size\":${max},\"sort_by\":\"view_counter\",\"issuer\":\"apiguide\",\"reason\":\"ma10\"}"
curl -s "Accept: application/json" -H "Content-type: application/json" -X POST -d ${query} http://api.search.nicovideo.jp/api/ | jq -r .values[].title 2>/dev/null >>~/title.inm
if [ ${i} -eq 0 ]; then
min='0'
else
min=`expr ${i} + 1`
fi
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment