Skip to content

Instantly share code, notes, and snippets.

@greymd
Last active July 28, 2017 16:30
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 greymd/d89a2fd6605771c2273118b047b7b5ae to your computer and use it in GitHub Desktop.
Save greymd/d89a2fd6605771c2273118b047b7b5ae to your computer and use it in GitHub Desktop.
Wikipediaの数の性質を500まで集める
# スクレイピング
seq 500 \
| while read n;do echo "$n"; w3m -dump -cols 999 "https://ja.wikipedia.org/wiki/$n" | sed -n '/性質\[編集\]/,/\[編集\]/p' > "$n" ;done
# 最も性質が多い数は。。
seq 500 | while read f; do echo -n "$f "; cat "$f" | grep '•' | grep -c .; done | sort -k2,2n
.
.
.
15 30
6 31
1 33
3 33
4 33
2 35
7 36
11 39
5 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment