LoginSignup
14
10

More than 5 years have passed since last update.

[Node]声優ラジオサイト「音泉」APIモジュール[改良版]

Last updated at Posted at 2017-02-25

はじめに

結構前に「[Node]音泉の非公開APIをモジュール化した」という記事を書いたんですが、それの改良版を作ったので公開します。
元サイトは、http://www.onsen.ag/です。

インストール

npm install onsen-node

パッケージを公開しているので、npm installでインストールできます。

メソッド

  • getList
    • 番組一覧(曜日ごと)の取得
  • getInfo
    • 番組情報の取得
  • getLink
    • 音声・動画リンクの取得
  • search
    • 番組の検索
  • getRecommends
    • レコメンドの取得
  • getRecommendMovie
    • おすすめの番組の取得
  • getRecommendGoods
    • おすすめの商品の取得
  • getTopics
    • トピックの取得

使い方

onsen = require 'onsen-node'

##
# 番組一覧の取得
##
onsen.getList (list) ->
    if list isnt null
        console.log list

##
# 番組情報の取得
##
onsen.getInfo '番組名', (info) ->
    if info isnt null
        console.log info

##
# 音声・動画リンクの取得
## 
onsen.getLink '番組名', (link) ->
    if link isnt null
        console.log link

##
# 番組の検索
##
onsen.search '検索ワード', (list) ->
    if list isnt null
        console.log list

##
# レコメンドの取得
##
onsen.getRecommends (list) ->
    if list isnt null
        console.log list

##
# おすすめの番組の取得
##
onsen.getRecommendMovie (list) ->
    if list isnt null
        console.log list

##
# おすすめの商品の取得
##
onsen.getRecommendGoods (list) ->
    if list isnt null
        console.log list

##
# おすすめの番組の取得
##
onsen.getRecommendTopics (list) ->
    if list isnt null
        console.log list

CLI

CLIにも対応したのでよかったら使ってください。

インストール

sudo npm install -g onsen-node

ヘルプ

onsen -h
onsen -help

番組一覧(曜日ごと)

onsen list
onsen list 今日
onsen list 火

list.png

番組の検索

onsen search 検索ワード

search.png

音声・動画のダウンロード

onsen download 番組名

download.png

番組情報

onsen info 番組名

info.png

さいごに

GitHubにあげてるのでよかったらみてください。
https://github.com/yuki540net/onsen-node

PHP版も空いた時間に改良版を作ろうと思います。
あと、Python版もそのうち作ります。

追記

onsen-nodeを使って、「音泉」をダウンロードする拡張作りました。
インストールはこちら

GitHub: https://github.com/yuki540net/onsen-downloader

14
10
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
14
10