juhe_ruby 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98c61acea6ce5ea9b12fae5d83ec66f87f2a76c8
4
- data.tar.gz: 3526e4c4fdfd4b9e7a68b41132611ab4791c4612
3
+ metadata.gz: 317df830696a11b089b438d33a4976da9a5c9e68
4
+ data.tar.gz: 76bd7e89a12cc556222571c814ac790776ff6f35
5
5
  SHA512:
6
- metadata.gz: 11065c91697c8a50eeb1572e34f4a6fa4538343cfb4138a6c9c7da3283deac42e1ed7f3b7ce65a1173ece01278b09c450fb20c32ce791ae9c451c1c9d4579ac8
7
- data.tar.gz: 3eb8deac8164aa95462d4d4fb9197c109155ec8e298df4af6f920c39ea763cdddae313b2cfb4fdcf9f278214362761871b5d887d45f77f7954bd865dc8cb6d80
6
+ metadata.gz: 96bf34892b17a588d26c51c93f4178c29c2b87ec8c7ce870909d55dae6b8b1cdfe2da690b25f64838ca209679065476e271386592e1266732b716d4770564f1d
7
+ data.tar.gz: 0f43e12afc26428c5fb3f2e4e2f2e6c904e82f9a6f7377953134e951486fc22f28793a2aa547f5326b6bc2f9a8ea9e433601b123896d40e7c17a09414820b611
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  [聚合](http://www.juhe.cn/)ruby api,目前完成了以下功能:
4
4
 
5
5
  - 常用快递查询
6
+ - 电影票房
6
7
 
7
8
  ## 安装
8
9
 
@@ -91,3 +92,22 @@ Juhe::Express.refresh_companies
91
92
  # or
92
93
  Juhe::Express.refresh_companies(app_key: "d85fa433fb8f30419dc1b3697b035b3d")
93
94
  ```
95
+
96
+ ### 电影票房
97
+ #### 最新票房榜
98
+ 票房榜的区域,CN-内地,US-北美,HK-香港。
99
+ 示例:
100
+ ```ruby
101
+ Juhe::Boxoffice.app_key = "d85fa433fd8430419dc1b3697b035b3d"
102
+ Juhe::Boxoffice.latest("HK") # 香港最新票房榜
103
+ # 或者app_key直接作为参数
104
+ Juhe::Boxoffice.latest("HK", app_key: "d85fa433fd8430419dc1b3697b035b3d") # 香港最新票房榜
105
+ ```
106
+ #### 网票票房
107
+ 示例:
108
+ ```ruby
109
+ Juhe::Boxoffice.app_key = "d85fa433fd8430419dc1b3697b035b3d"
110
+ Juhe::Boxoffice.wp # 网票票房
111
+ # 或者app_key直接作为参数
112
+ Juhe::Boxoffice.wp(app_key: "d85fa433fd8430419dc1b3697b035b3d") # 网票票房
113
+ ```
@@ -10,8 +10,7 @@ module Juhe
10
10
  def self.search(company_name, number, options = nil)
11
11
  app_key = (options[:app_key] if options) || Juhe::Express.app_key
12
12
  url = BASE_URL \
13
- + "/index?key=" \
14
- + app_key \
13
+ + "/index?key=" + app_key \
15
14
  + "&no=" + number \
16
15
  + "&com=" + company_code_of(company_name, options)
17
16
 
@@ -1,3 +1,3 @@
1
1
  module JuheRuby
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/juhe_ruby.rb CHANGED
@@ -1,13 +1,15 @@
1
1
  require "juhe_ruby/version"
2
2
  require "juhe_ruby/express"
3
+ require "juhe_ruby/boxoffice"
3
4
 
4
5
  module Juhe
5
6
  URLS = {
6
- Express: "http://v.juhe.cn/exp"
7
+ Express: "http://v.juhe.cn/exp", # 常用快递查询
8
+ Boxoffice: "http://v.juhe.cn/boxoffice" # 电影票房
7
9
  }
8
10
 
9
11
  class << self
10
- # Array of module names
12
+ # Array of modules
11
13
  modules = Juhe.constants.map{ |el| Juhe.const_get(el) }.select{ |m| m.instance_of?(Module) }
12
14
  modules.each do |mod|
13
15
  if mod.to_s =~ /\AJuhe::(.*)/
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juhe_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - linuxnerd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-24 00:00:00.000000000 Z
11
+ date: 2014-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.1.10
79
+ rubygems_version: 2.1.11
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: '"聚合ruby api"'