LoginSignup
12
11

More than 5 years have passed since last update.

現在のAppStoreのトップセールス1位を取得する one-liner

Last updated at Posted at 2015-04-22

RSS ( https://rss.itunes.apple.com/jp/ ) のエントリの1番目をみるだけ。

コード

$ ruby -r rss -e "p RSS::Parser.parse('https://itunes.apple.com/jp/rss/topgrossingapplications/limit=10/xml').entries[0].title.content"
"モンスターストライク - mixi, Inc"

zsh の関数にしてみると

function apps() {
  index=$[$1 - 1]
  echo "AppStore rank $1 位:"
  ruby -r rss -e "puts RSS::Parser.parse('https://itunes.apple.com/jp/rss/topgrossingapplications/limit=10/xml').entries[$index].title.content"
}
$ apps 1
AppStore rank 1 位:
モンスターストライク - mixi, Inc

こうなった :)

12
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
11