Skip to content

Instantly share code, notes, and snippets.

@gecko655
Last active May 16, 2019 02:59
Show Gist options
  • Save gecko655/41923f915d3429ecd31e35b0c9d16c5a to your computer and use it in GitHub Desktop.
Save gecko655/41923f915d3429ecd31e35b0c9d16c5a to your computer and use it in GitHub Desktop.
今週のアイカツフレンズ!
#!/bin/bash
# moved to https://github.com/gecko655/homebrew-aikatsu-story
if [ $# -lt 1 ] ; then
echo "usage: $0 episode-id"
exit 1
fi
episode_id=`printf %03d $1`
series_id=`printf %02d $(( ($1 - 1)/ 50 + 1))`
if [ $1 -ge 51 ] ; then
url="http://www.aikatsu.net/story/story-${episode_id}.html"
pup_command='.story-main-frame > :nth-child(2) json{}'
else
url="http://www.aikatsu.net/aikatsufriends_${series_id}/story/story-${episode_id}.html"
pup_command='.story-waku-menu > :nth-child(2) json{}'
fi
curl -s $url | \
pup "$pup_command" | \
jq --raw-output '.[].text'
@gecko655
Copy link
Author

gecko655 commented Mar 7, 2019

$ aikatsu_story 47
これまでアイドルをサポートしてきたココだが、いつしか「アイカツをしてみたい」という夢を持つようになった。協力を買って出たあいね達は、特別な装置を使ってココのいる世界へ……。みんなで一緒にアイカツ!しかしその後、とんでもない事態に!?

@gecko655
Copy link
Author

$ for i in `seq 1 57`
> do 
> lines=`aikatsu_story $i | wc -m`
> printf "%2d: %s\n" $i $lines
> done
 1: 133
 2: 170
 3: 151
 4: 131
 5: 122
 6: 108
 7: 112
 8: 150
 9: 120
10: 102
11: 130
12: 121
13: 132
14: 118
15: 126
16: 121
17: 120
18: 125
19: 111
20: 126
21: 114
22: 109
23: 121
24: 121
25: 108
26: 116
27: 123
28: 110
29: 120
30: 123
31: 118
32: 120
33: 113
34: 112
35: 107
36: 120
37: 113
38: 118
39: 113
40: 112
41: 119
42: 118
43: 112
44: 111
45: 120
46: 119
47: 117
48: 116
49: 114
50: 110
51: 122
52: 111
53: 110
54: 106
55: 119
56: 119
57: 115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment