syobocal 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7cc1e6c50feebcc13acf9e2254d8395c35d30660
4
- data.tar.gz: da3c85cc7c96e2c10e7a8b5bfcb694fa82e6545d
2
+ SHA256:
3
+ metadata.gz: 1b32b7dbb64cf8d4b48bd87da408f5607b845ab85073c025327bc6e9d6294df6
4
+ data.tar.gz: 4f2ed089906d9f1560d5b0aeeaa0f009d284337069cc2794521e235ee082899c
5
5
  SHA512:
6
- metadata.gz: 63a22b9d37eaa306352681df07dbe4454cec2013e52ae52a12c5fc331bca725c7922445c5489d62d7c7f39334c226e37df2a37738a16af5ddd6d75afb0706b88
7
- data.tar.gz: 4fc53ef3db901d9793f01fd1171ce3901e8d151e22dca13ccc88c22fb0c0d2609bcae66677b7c4bbd4d70805a4c97bc9a8deda0ada9fcfe5d323d4d86c5028ff
6
+ metadata.gz: a29a2ba9cfb401f13fc69862cb283f9081fe55edb26e26618649393d0de42c97ce3759a9be5345d8bb852c59d1af453b5d4f66485dbc788851cdc7e9419cce2c
7
+ data.tar.gz: 8f71e8e5941a9a40837648e9300d7cd110b1512f00bc0169185206e12e709c0a1e7c1943e8710a55684c361da01a981459511180cb217db5f425043664dc6d5b
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at mail@xmisao.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in syobocal.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 xmisao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # syobocal
2
+
3
+ ## 概要
4
+
5
+ syobocalは[しょぼいカレンダー](http://cal.syoboi.jp/)からデータを取得するためのRubyスクリプトです。
6
+ sch_uploadを除いて仕様が公開されている以下20種類のエンドポイントすべてに対応しています。
7
+
8
+ - cal_chk.php
9
+ - db.php
10
+ - TitleLookup
11
+ - ProgLookup
12
+ - ChLookup
13
+ - ChGroupLookup
14
+ - TitleViewCount
15
+ - TitleRankHistory
16
+ - TitlePointHistory
17
+ - TitlePointTop
18
+ - json.php
19
+ - TitleMedium
20
+ - TitleLarge
21
+ - TitleFull
22
+ - ProgramByPID
23
+ - ProgramByCount
24
+ - ProgramByDate
25
+ - SubTitles
26
+ - ChFilter
27
+ - ChIDFilter
28
+ - rss.php
29
+ - rss2.php
30
+
31
+ ## インストール
32
+
33
+ ~~~~
34
+ # gem install syobocal
35
+ ~~~~
36
+
37
+ ## 使い方
38
+
39
+ エンドポイントごとにモジュールを切っています。
40
+ 例えば`db.php`の`TitleLookup`に対応したモジュールは`Syobocal::DB::TitleLookup`です。
41
+ 各モジュールには以下のモジュール関数が定義されています。
42
+
43
+ - get() -- データを取得してパースして返す
44
+ - url() -- データを取得するURLを生成して返す
45
+ - parse() -- 取得したデータをパースする
46
+
47
+ このうち`url()`と`parse()`は`get()`の内部処理のためのモジュール関数です。
48
+ 基本的には`get()`にパラメータをハッシュで渡してやればデータが取得できます。
49
+ XMLやRSSをパースした結果は値が適切な型に変換されたハッシュの配列です。
50
+ JSONをパースした結果はJSONのデータ構造をそのまま返します。
51
+
52
+ ~~~~
53
+ require 'syobocal'
54
+ require 'pp'
55
+ params = {"TID" => "1"}
56
+ pp Syobocal::DB::TitleLookup.get(params)
57
+ ~~~~
58
+
59
+ ## おまけ
60
+
61
+ テスト用の`syobocal`コマンドと、これから放送される首都圏のアニメを表示する`anime`コマンドを同梱しています。
62
+
63
+ ### syobocal
64
+
65
+ 各モジュールの機能をテストできるスクリプトです。
66
+ 以下のようにして使います。
67
+ 詳しくはソースを見て下さい。
68
+
69
+ ~~~~
70
+ $ syobocal DB::TitleLookup "{'TID' => '2077'}"
71
+ http://cal.syoboi.jp/db.php?Command=TitleLookup&TID=2077
72
+ Code: 200
73
+ Message:
74
+ [{:tid=>2077,
75
+ :last_update=>2013-12-02 02:17:55 +0900,
76
+ :title=>"魔法少女まどか☆マギカ",
77
+ :short_title=>"まどか☆マギカ",
78
+ :title_yomi=>"まほうしょうじょまどかまぎか",
79
+ :title_en=>"PUELLA MAGI MADOKA MAGICA",
80
+ :comment=>
81
+ "*リンク\n-[[公式 http://www.madoka-magica.com/tv/]]\n-[[MBS http://www.mbs.jp/madoka-magica/]]\n-[[ニコニコチャンネル http://ch.nicovideo.jp/ch260]]\n-[[TOKYO MX http://www.mxtv.co.jp/madoka_magica/]]\n-[[BS11デジタル http://www.bs11.jp/anime/2360/]]\n*メモ\n-アニマックスでのリピート放送は放送日の27:00~と日曜26:00~\n*スタッフ\n:原作:Magica Quartet\n:監督:新房昭之\n:キャラクター原案:蒼樹うめ\n:キャラクターデザイン:岸田隆宏\n:シリーズ構成・脚本:虚淵玄(ニトロプラス)\n:シリーズディレクター:宮本幸裕\n:総作画監督:谷口淳一郎、高橋美香\n:アクションディレクター:阿部望、神谷智大\n:レイアウト設計:牧孝雄\n:異空間設計:劇団イヌカレー\n:美術監督:稲葉邦彦、金子雄司\n:美術設定:大原盛仁\n:色彩設計:日比野仁、滝沢いづみ\n:ビジュアルエフェクト:酒井基\n:撮影監督:江藤慎一郎\n:編集:松原理恵\n:音響監督:鶴岡陽太\n:音響制作:楽音舎\n:音楽:梶浦由記\n:音楽制作:アニプレックス\n:アニメーション制作:SHAFT\n:製作:Magica Partners(アニプレックス、芳文社、博報堂DYメディアパートナーズ、ニトロプラス、ムービック、SHAFT)、毎日放送\n*オープニングテーマ「コネクト」\n:作詞・作曲:渡辺翔\n:主題歌協力:外村敬一\n:歌:ClariS\n:使用話数:#1~#9、#11\n-#10、#12はオープニングテーマなし、エンディングテーマとして使用\n*エンディングテーマ「Magia」\n:作詞・作曲・編曲:梶浦由記\n:音楽プロデューサー:森康哲\n:歌:Kalafina\n:使用話数:#3~#8、#11(Blu-ray/DVDのみ)\n-#1、#2、#9、#11(放送版)はエンディングテーマなし\n-#1、#2、#10は挿入歌として使用\n*キャラクターエンディングソング1「また あした」\n:作詞・作曲:hanawaya\n:編曲:流歌、田口智則\n:歌:鹿目まどか(悠木碧)\n:使用話数:#1~#2(Blu-ray/DVDのみ)\n*キャラクターエンディングソング2「and I'm home」\n:作詞・作曲:wowaka\n:編曲:どく、wowaka\n:歌:美樹さやか(喜多村英梨)、佐倉杏子(野中藍)\n:使用話数:#9(Blu-ray/DVDのみ)\n*挿入歌「コネクト (ゲームインスト)」\n:作曲:渡辺翔\n:使用話数:#6\n*キャスト\n:鹿目まどか:悠木碧\n:暁美ほむら:斎藤千和\n:巴マミ/鹿目タツヤ:水橋かおり\n:美樹さやか:喜多村英梨\n:佐倉杏子:野中藍\n:キュゥべえ:加藤英美里\n:志筑仁美:新谷良子\n:鹿目詢子:後藤邑子\n:鹿目知久:岩永哲哉\n:上条恭介:吉田聖子\n:早乙女和子:岩男潤子\n*予告イラスト\n:#1:ハノカゲ\n:#2:氷川へきる\n:#3:津路参汰(ニトロプラス)\n:#4:小林尽\n:#5:ゆーぽん(ニトロプラス)\n:#6:ウエダハジメ\n:#7:天杉貴志\n:#8:藤真拓哉\n:#9:なまにくATK(ニトロプラス)\n:#10:ムラ黒江\n:#11:ブリキ\n*エンドイラスト\n:#12:蒼樹うめ",
82
+ :cat=>10,
83
+ :title_flag=>0,
84
+ :first_year=>2011,
85
+ :first_month=>1,
86
+ :first_end_year=>2011,
87
+ :first_end_month=>4,
88
+ :first_ch=>"MBS",
89
+ :keywords=>"wikipedia:魔法少女まどか☆マギカ",
90
+ :user_point=>265,
91
+ :user_point_rank=>256,
92
+ :sub_titles=>
93
+ "*01*夢の中で会った、ような・・・・・\n*02*それはとっても嬉しいなって\n*03*もう何も恐くない\n*04*奇跡も、魔法も、あるんだよ\n*05*後悔なんて、あるわけない\n*06*こんなの絶対おかしいよ\n*07*本当の気持ちと向き合えますか?\n*08*あたしって、ほんとバカ\n*09*そんなの、あたしが許さない\n*10*もう誰にも頼らない\n*11*最後に残った道しるべ\n*12*わたしの、最高の友達"}]
94
+ ~~~~
95
+
96
+ ### syobocal-anime
97
+
98
+ これから放送される首都圏のアニメを表示するサンプルスクリプトです。
99
+
100
+ ~~~~
101
+ $ syobocal-anime
102
+ これから放送されるアニメ@首都圏
103
+ 25:25 [フジテレビ] 暗殺教室(第2期) / 卒業の時間
104
+ 25:58 [TBS] 少年メイド / 少年よ、大志を抱け
105
+ 26:28 [TBS] 坂本ですが? / ぬくもりはいらない/1-2メモリーズ
106
+ 26:35 [テレビ東京] あにむす! /
107
+ 26:58 [TBS] マギ シンドバッドの冒険 / 天空都市アルテミュラ
108
+ ~~~~
109
+
110
+ ## 作者
111
+
112
+ - [xmisao](http://www.xmisao.com/)
113
+
114
+ ## ライセンス
115
+
116
+ This library is distributed under the MIT license.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "syobocal"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -101,9 +101,9 @@ when "JSON::ProgramByCount"
101
101
  puts Syobocal::JSON::ProgramByCount.url(params)
102
102
  result = Syobocal::JSON::ProgramByCount.get(params)
103
103
  pp result
104
- when "JSON::ProgramByData"
105
- puts Syobocal::JSON::ProgramByData.url(params)
106
- result = Syobocal::JSON::ProgramByData.get(params)
104
+ when "JSON::ProgramByDate"
105
+ puts Syobocal::JSON::ProgramByDate.url(params)
106
+ result = Syobocal::JSON::ProgramByDate.get(params)
107
107
  pp result
108
108
  when "JSON::SubTitles"
109
109
  puts Syobocal::JSON::SubTitles.url(params)
File without changes
data/lib/syobocal.rb CHANGED
@@ -3,10 +3,13 @@ require 'rexml/document'
3
3
  require 'delegate'
4
4
  require 'json'
5
5
  require 'rss'
6
+ require "syobocal/version"
6
7
 
7
- require_relative 'syobocal/util.rb'
8
- require_relative 'syobocal/calchk.rb'
9
- require_relative 'syobocal/db.rb'
10
- require_relative 'syobocal/json.rb'
11
- require_relative 'syobocal/rss.rb'
12
- require_relative 'syobocal/rss2.rb'
8
+ require 'syobocal/util.rb'
9
+ require 'syobocal/calchk.rb'
10
+ require 'syobocal/db.rb'
11
+ require 'syobocal/json.rb'
12
+ require 'syobocal/rss.rb'
13
+ require 'syobocal/rss2.rb'
14
+
15
+ module Syobocal; end
data/lib/syobocal/json.rb CHANGED
@@ -86,7 +86,7 @@ module Syobocal
86
86
  end
87
87
 
88
88
  def url(params = {})
89
- 'http://cal.syoboi.jp/json.php?Req=ProgramByData' + Syobocal::Util.format_params_amp(params)
89
+ 'http://cal.syoboi.jp/json.php?Req=ProgramByDate' + Syobocal::Util.format_params_amp(params)
90
90
  end
91
91
 
92
92
  def parse(json)
@@ -0,0 +1,3 @@
1
+ module Syobocal
2
+ VERSION = "0.10.0"
3
+ end
data/syobocal.gemspec ADDED
@@ -0,0 +1,28 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "syobocal/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "syobocal"
8
+ spec.version = Syobocal::VERSION
9
+ spec.authors = ["xmisao"]
10
+ spec.email = ["mail@xmisao.com"]
11
+
12
+ spec.summary = "Simple gem for Syoboi Calendar"
13
+ spec.description = "Syoboi Calendar is the oldest and biggest ANIME information site, supported and hosted by anime fans in Japan. This gem make it easy to download information using web APIs of this site."
14
+ spec.homepage = "https://github.com/xmisao/syobocal"
15
+ spec.license = "MIT"
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
22
+ spec.bindir = "exe"
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ["lib"]
25
+
26
+ spec.add_development_dependency "bundler", "~> 2.0"
27
+ spec.add_development_dependency "rake", "~> 10.0"
28
+ end
metadata CHANGED
@@ -1,27 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syobocal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - xmisao
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-24 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2019-11-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
13
41
  description: Syoboi Calendar is the oldest and biggest ANIME information site, supported
14
42
  and hosted by anime fans in Japan. This gem make it easy to download information
15
43
  using web APIs of this site.
16
- email: mail@xmisao.com
44
+ email:
45
+ - mail@xmisao.com
17
46
  executables:
18
- - syobocal-anime
19
47
  - syobocal
48
+ - syobocal-anime
20
49
  extensions: []
21
50
  extra_rdoc_files: []
22
51
  files:
23
- - bin/syobocal
24
- - bin/syobocal-anime
52
+ - ".gitignore"
53
+ - CODE_OF_CONDUCT.md
54
+ - Gemfile
55
+ - LICENSE.txt
56
+ - README.md
57
+ - Rakefile
58
+ - bin/console
59
+ - bin/setup
60
+ - exe/syobocal
61
+ - exe/syobocal-anime
25
62
  - lib/syobocal.rb
26
63
  - lib/syobocal/calchk.rb
27
64
  - lib/syobocal/db.rb
@@ -29,6 +66,8 @@ files:
29
66
  - lib/syobocal/rss.rb
30
67
  - lib/syobocal/rss2.rb
31
68
  - lib/syobocal/util.rb
69
+ - lib/syobocal/version.rb
70
+ - syobocal.gemspec
32
71
  homepage: https://github.com/xmisao/syobocal
33
72
  licenses:
34
73
  - MIT
@@ -48,8 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
87
  - !ruby/object:Gem::Version
49
88
  version: '0'
50
89
  requirements: []
51
- rubyforge_project:
52
- rubygems_version: 2.5.1
90
+ rubygems_version: 3.0.3
53
91
  signing_key:
54
92
  specification_version: 4
55
93
  summary: Simple gem for Syoboi Calendar