express-search 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
3
+ - 1.9.3-p551
4
+ cache: bundler
data/Gemfile.lock CHANGED
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- express-search (0.1.0)
4
+ express-search (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- addressable (2.3.8)
10
- crack (0.4.2)
9
+ addressable (2.4.0)
10
+ crack (0.4.3)
11
11
  safe_yaml (~> 1.0.0)
12
12
  diff-lcs (1.2.5)
13
- rake (10.4.2)
13
+ rake (10.5.0)
14
14
  rspec (3.2.0)
15
15
  rspec-core (~> 3.2.0)
16
16
  rspec-expectations (~> 3.2.0)
@@ -38,3 +38,6 @@ DEPENDENCIES
38
38
  rake (~> 10.0)
39
39
  rspec (~> 3.2.0)
40
40
  webmock (~> 1.21.0)
41
+
42
+ BUNDLED WITH
43
+ 1.12.5
data/README.md CHANGED
@@ -1,39 +1,30 @@
1
- # Express::Search
1
+ ## Express Search[![Build Status](https://secure.travis-ci.org/chilwar/china-express.png)](http://travis-ci.org/chilwar/china-express)
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/express/search`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ 支持顺丰、EMS、申通、圆通、中通、宅急送、韵达、天天快递、联邦快递、汇通等,无须验证码
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ ### Install
6
6
 
7
- ## Installation
7
+ gem 'express-search'
8
8
 
9
- Add this line to your application's Gemfile:
9
+ ### Usage
10
10
 
11
- ```ruby
12
- gem 'express-search'
13
- ```
11
+ 需要爱查快递的`id`和`key`, [申请爱查快递API](http://www.ickd.cn/api/reg.html)
14
12
 
15
- And then execute:
13
+ require 'express/search'
14
+ Express::Search.id = 'id_sample'
15
+ Express::Search.key = 'key_sample'
16
+ Express::Search.get_result(单号, '快递公司')
17
+
18
+ 可选参数(按顺序):
19
+ type: 返回值类型(json(默认)|html|xml|text)
20
+ encode: 数据编码(gbk|utf8(默认))
21
+ ord: 排序(asc(默认)|desc)
16
22
 
17
- $ bundle
23
+ ### Sample
18
24
 
19
- Or install it yourself as:
20
-
21
- $ gem install express-search
22
-
23
- ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
- ## Contributing
34
-
35
- 1. Fork it ( https://github.com/[my-github-username]/express-search/fork )
36
- 2. Create your feature branch (`git checkout -b my-new-feature`)
37
- 3. Commit your changes (`git commit -am 'Add some feature'`)
38
- 4. Push to the branch (`git push origin my-new-feature`)
39
- 5. Create a new Pull Request
25
+ result = Express::Search.get_result('123456', '顺丰')
26
+ result.success? # true
27
+ result.data # [{'time' => "2015-05-05 09:20", 'context' => "您的快递被大水冲走了"}]
28
+ result.data.each do |item|
29
+ puts "#{ item['time'] } #{ item['context'] }"
30
+ end
@@ -1,5 +1,5 @@
1
1
  module Express
2
2
  module Search
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: express-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: