express-search 0.1.0 → 0.1.1
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.
- data/.travis.yml +2 -1
- data/Gemfile.lock +7 -4
- data/README.md +22 -31
- data/lib/express/search/version.rb +1 -1
- metadata +1 -1
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
express-search (0.1.
|
4
|
+
express-search (0.1.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
addressable (2.
|
10
|
-
crack (0.4.
|
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.
|
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
|
-
|
1
|
+
## Express Search[](http://travis-ci.org/chilwar/china-express)
|
2
2
|
|
3
|
-
|
3
|
+
支持顺丰、EMS、申通、圆通、中通、宅急送、韵达、天天快递、联邦快递、汇通等,无须验证码
|
4
4
|
|
5
|
-
|
5
|
+
### Install
|
6
6
|
|
7
|
-
|
7
|
+
gem 'express-search'
|
8
8
|
|
9
|
-
|
9
|
+
### Usage
|
10
10
|
|
11
|
-
|
12
|
-
gem 'express-search'
|
13
|
-
```
|
11
|
+
需要爱查快递的`id`和`key`, [申请爱查快递API](http://www.ickd.cn/api/reg.html)
|
14
12
|
|
15
|
-
|
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
|
-
|
23
|
+
### Sample
|
18
24
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|