baidu_lbs 0.0.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.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +31 -0
  6. data/Rakefile +9 -0
  7. data/baidu_lbs.gemspec +30 -0
  8. data/lib/baidu_lbs/client.rb +7 -0
  9. data/lib/baidu_lbs/configurable.rb +17 -0
  10. data/lib/baidu_lbs/geo_data/column.rb +25 -0
  11. data/lib/baidu_lbs/geo_data/geotable.rb +31 -0
  12. data/lib/baidu_lbs/geo_data/job.rb +13 -0
  13. data/lib/baidu_lbs/geo_data/poi.rb +30 -0
  14. data/lib/baidu_lbs/geo_search.rb +20 -0
  15. data/lib/baidu_lbs/request.rb +39 -0
  16. data/lib/baidu_lbs/version.rb +3 -0
  17. data/lib/baidu_lbs.rb +13 -0
  18. data/test/baidu_lbs/geodata/column_test.rb +49 -0
  19. data/test/baidu_lbs/geodata/geotable_test.rb +44 -0
  20. data/test/baidu_lbs/geodata/job_test.rb +19 -0
  21. data/test/baidu_lbs/geodata/poi_test.rb +54 -0
  22. data/test/baidu_lbs/version_test.rb +8 -0
  23. data/test/fixtures/poi_list.csv +1 -0
  24. data/test/fixtures/vcr_cassettes/geo_search_test.rb +5 -0
  25. data/test/fixtures/vcr_cassettes/geodata/column/create.yml +51 -0
  26. data/test/fixtures/vcr_cassettes/geodata/column/delete.yml +51 -0
  27. data/test/fixtures/vcr_cassettes/geodata/column/detail.yml +50 -0
  28. data/test/fixtures/vcr_cassettes/geodata/column/list.yml +50 -0
  29. data/test/fixtures/vcr_cassettes/geodata/column/update.yml +51 -0
  30. data/test/fixtures/vcr_cassettes/geodata/geotable/create.yml +51 -0
  31. data/test/fixtures/vcr_cassettes/geodata/geotable/delete.yml +51 -0
  32. data/test/fixtures/vcr_cassettes/geodata/geotable/detail.yml +50 -0
  33. data/test/fixtures/vcr_cassettes/geodata/geotable/list.yml +50 -0
  34. data/test/fixtures/vcr_cassettes/geodata/geotable/update.yml +51 -0
  35. data/test/fixtures/vcr_cassettes/geodata/job/detail.yml +49 -0
  36. data/test/fixtures/vcr_cassettes/geodata/job/list.yml +56 -0
  37. data/test/fixtures/vcr_cassettes/geodata/poi/create.yml +51 -0
  38. data/test/fixtures/vcr_cassettes/geodata/poi/delete.yml +50 -0
  39. data/test/fixtures/vcr_cassettes/geodata/poi/detail.yml +50 -0
  40. data/test/fixtures/vcr_cassettes/geodata/poi/list.yml +52 -0
  41. data/test/fixtures/vcr_cassettes/geodata/poi/update.yml +51 -0
  42. data/test/fixtures/vcr_cassettes/geodata/poi/upload.yml +65 -0
  43. data/test/test_helper.rb +15 -0
  44. metadata +210 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9238956441446648e2c8fa58d91d743601e83f4e
4
+ data.tar.gz: 13f3c826b59c85f21d6fb7e04f43b443a996a452
5
+ SHA512:
6
+ metadata.gz: 417634a1368fb81cd9192d56cdf941c0a1243ace41e58373335ac456e9cf64cc457117b3dd8834281863ab38c2e119d8a9ce23e23f476bb90b1a118410fe716e
7
+ data.tar.gz: e836a56a3f0edfa3674da16cfebad9b3d6f62bc423a4736a80724a1dee96f1b553fba5d585a37fad47ca09649192e9d804f24ec65dad71fbda525130d22bbb60
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in baidu_lbs.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Meck
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # BaiduLbs
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'baidu_lbs'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install baidu_lbs
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/baidu_lbs/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,9 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new do |t|
5
+ t.libs << %w(test lib)
6
+ t.pattern = 'test/**/*_test.rb'
7
+ end
8
+
9
+ task :default => :test
data/baidu_lbs.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'baidu_lbs/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'baidu_lbs'
8
+ spec.version = BaiduLBS::VERSION
9
+ spec.authors = ['Meck']
10
+ spec.email = ['yesmeck@gmail.com']
11
+ spec.summary = %q{Baidu LBS ruby wrapper}
12
+ spec.description = %q{Baidu LBS ruby wrapper}
13
+ spec.homepage = 'https://github.com/yesmeck/baidu_lbs'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'faraday', '~> 0.9.0'
22
+ spec.add_dependency 'faraday_middleware', '~> 0.9.1'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.7'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'minitest', '~> 5.4.1'
27
+ spec.add_development_dependency 'vcr', '~> 2.9.3'
28
+ spec.add_development_dependency 'webmock', '~> 1.18.0'
29
+ end
30
+
@@ -0,0 +1,7 @@
1
+ require 'baidu_lbs/request'
2
+
3
+ class BaiduLBS::Client
4
+ class << self
5
+ include BaiduLBS::Request
6
+ end
7
+ end
@@ -0,0 +1,17 @@
1
+ module BaiduLBS
2
+ module Configurable
3
+ attr_accessor :ak
4
+
5
+ def configure
6
+ yield self
7
+ end
8
+
9
+ def api_endpoint
10
+ 'http://api.map.baidu.com'
11
+ end
12
+
13
+ def reset!
14
+ self.ak = nil
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ module BaiduLBS::GeoData
2
+ class Column < BaiduLBS::Client
3
+ class << self
4
+ def create(params)
5
+ post '/geodata/v3/column/create', params
6
+ end
7
+
8
+ def list(params)
9
+ get '/geodata/v3/column/list', params
10
+ end
11
+
12
+ def detail(params)
13
+ get '/geodata/v3/column/detail', params
14
+ end
15
+
16
+ def update(params)
17
+ post '/geodata/v3/column/update', params
18
+ end
19
+
20
+ def delete(params)
21
+ post '/geodata/v3/column/delete', params
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,31 @@
1
+ module BaiduLBS::GeoData
2
+ class GeoTable < BaiduLBS::Client
3
+ class << self
4
+ def create(params)
5
+ post '/geodata/v3/geotable/create', params
6
+ end
7
+
8
+ def list
9
+ get '/geodata/v3/geotable/list'
10
+ end
11
+
12
+ def detail(id)
13
+ get '/geodata/v3/geotable/detail', id: id
14
+ end
15
+
16
+ def update(*id_or_params)
17
+ if id_or_params.size == 1
18
+ params = id_or_params[0]
19
+ elsif id_or_params.size == 2
20
+ params = id_or_params[1]
21
+ params[:id] = id_or_params[0]
22
+ end
23
+ post '/geodata/v3/geotable/update', params
24
+ end
25
+
26
+ def delete(id)
27
+ post '/geodata/v3/geotable/delete', id: id
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,13 @@
1
+ module BaiduLBS::GeoData
2
+ class Job < BaiduLBS::Client
3
+ class << self
4
+ def list(params = {})
5
+ get '/geodata/v3/job/list', params
6
+ end
7
+
8
+ def detail(params)
9
+ get 'geodata/v3/job/detail', params
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,30 @@
1
+ module BaiduLBS::GeoData
2
+ class Poi < BaiduLBS::Client
3
+ class << self
4
+ def create(params)
5
+ post '/geodata/v3/poi/create', params
6
+ end
7
+
8
+ def list(params)
9
+ get '/geodata/v3/poi/list', params
10
+ end
11
+
12
+ def detail(params)
13
+ get '/geodata/v3/poi/detail', params
14
+ end
15
+
16
+ def update(params)
17
+ post '/geodata/v3/poi/update', params
18
+ end
19
+
20
+ def delete(params)
21
+ post '/geodata/v3/poi/delete', params
22
+ end
23
+
24
+ def upload(params)
25
+ params[:poi_list] = Faraday::UploadIO.new(params[:poi_list], 'application/csv')
26
+ post '/geodata/v3/poi/upload', params, multipart: true
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,20 @@
1
+ class BaiduLBS::GeoSearch < BaiduLBS::Client
2
+ class << self
3
+ def nearby(params)
4
+ get '/geosearch/v3/nearby', params
5
+ end
6
+
7
+ def local(params)
8
+ get '/geosearch/v3/local', params
9
+ end
10
+
11
+ def bound(params)
12
+ get '/geosearch/v3/bound', params
13
+ end
14
+
15
+ def detail(id)
16
+ get "/geosearch/v3/detail/#{id}"
17
+ end
18
+ end
19
+ end
20
+
@@ -0,0 +1,39 @@
1
+ require 'faraday'
2
+ require 'faraday_middleware'
3
+
4
+ module BaiduLBS
5
+ module Request
6
+ def get(path, params = {}, options = {})
7
+ request(:get, path, params, options)
8
+ end
9
+
10
+ def post(path, params = {}, options = {})
11
+ request(:post, path, params, options)
12
+ end
13
+
14
+ def request(method, path, params, options)
15
+ params[:ak] = BaiduLBS.ak unless params[:ak]
16
+
17
+ response = connection(options).send(method) do |request|
18
+ case method
19
+ when :get, :delete
20
+ request.url(path, params)
21
+ when :post, :put
22
+ request.path = path
23
+ request.body = params
24
+ end
25
+ end
26
+ response.body
27
+ end
28
+
29
+ def connection(options)
30
+ connection = Faraday.new(url: BaiduLBS.api_endpoint) do |builder|
31
+ builder.request :multipart if options[:multipart]
32
+ builder.request :url_encoded
33
+ builder.use FaradayMiddleware::ParseJson
34
+ builder.adapter Faraday.default_adapter
35
+ end
36
+ connection
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,3 @@
1
+ module BaiduLBS
2
+ VERSION = '0.0.1'
3
+ end
data/lib/baidu_lbs.rb ADDED
@@ -0,0 +1,13 @@
1
+ require 'baidu_lbs/version'
2
+ require 'baidu_lbs/configurable'
3
+ require 'baidu_lbs/client'
4
+ require 'baidu_lbs/geo_data/geotable'
5
+ require 'baidu_lbs/geo_data/column'
6
+ require 'baidu_lbs/geo_data/poi'
7
+ require 'baidu_lbs/geo_data/job'
8
+
9
+ module BaiduLBS
10
+ class << self
11
+ include Configurable
12
+ end
13
+ end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class ColumnTest < MiniTest::Test
4
+ def test_create
5
+ VCR.use_cassette('geodata/column/create') do
6
+ result = BaiduLBS::GeoData::Column.create(name: 'awesome_column',
7
+ key: 'awesome_column',
8
+ type: 1,
9
+ is_sortfilter_field: 1,
10
+ is_search_field: 0,
11
+ is_index_field: 1,
12
+ geotable_id: 78835)
13
+
14
+ assert_equal 0, result['status']
15
+ end
16
+ end
17
+
18
+ def test_list
19
+ VCR.use_cassette('geodata/column/list') do
20
+ result = BaiduLBS::GeoData::Column.list(geotable_id: 78835)
21
+
22
+ assert_equal 'awesome_column', result['columns'].first['name']
23
+ end
24
+ end
25
+
26
+ def test_detail
27
+ VCR.use_cassette('geodata/column/detail') do
28
+ result = BaiduLBS::GeoData::Column.detail(geotable_id: 78835, id: 77316)
29
+
30
+ assert_equal 'awesome_column', result['column']['name']
31
+ end
32
+ end
33
+
34
+ def test_update
35
+ VCR.use_cassette('geodata/column/update') do
36
+ result = BaiduLBS::GeoData::Column.update(geotable_id: 78835, id: 77316, name: 'cool_column')
37
+
38
+ assert_equal 0, result['status']
39
+ end
40
+ end
41
+
42
+ def test_delete
43
+ VCR.use_cassette('geodata/column/delete') do
44
+ result = BaiduLBS::GeoData::Column.delete(geotable_id: 78835,id: 77316)
45
+
46
+ assert_equal 21, result['status']
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,44 @@
1
+ require 'test_helper'
2
+
3
+ class GeotableTest < MiniTest::Test
4
+ def test_create
5
+ VCR.use_cassette('geodata/geotable/create') do
6
+ result = BaiduLBS::GeoData::GeoTable.create(name: 'awesome_places',
7
+ geotype: 1,
8
+ is_published: 1)
9
+ assert_equal 0, result['status']
10
+ end
11
+ end
12
+
13
+ def test_list
14
+ VCR.use_cassette('geodata/geotable/list') do
15
+ result = BaiduLBS::GeoData::GeoTable.list
16
+
17
+ assert_equal 'awesome_places' , result['geotables'].first['name']
18
+ end
19
+ end
20
+
21
+ def test_detail
22
+ VCR.use_cassette('geodata/geotable/detail') do
23
+ result = BaiduLBS::GeoData::GeoTable.detail(78706)
24
+
25
+ assert_equal 'awesome_places', result['geotable']['name']
26
+ end
27
+ end
28
+
29
+ def test_update
30
+ VCR.use_cassette('geodata/geotable/update') do
31
+ result = BaiduLBS::GeoData::GeoTable.update(78706, name: 'cool_places')
32
+
33
+ assert_equal 0, result['status']
34
+ end
35
+ end
36
+
37
+ def test_delete
38
+ VCR.use_cassette('geodata/geotable/delete') do
39
+ result = BaiduLBS::GeoData::GeoTable.delete(78706)
40
+
41
+ assert_equal 0, result['status']
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ class JobTest < MiniTest::Test
4
+ def test_list
5
+ VCR.use_cassette('geodata/job/list') do
6
+ result = BaiduLBS::GeoData::Job.list
7
+
8
+ assert_equal 0, result['status']
9
+ end
10
+ end
11
+
12
+ def test_detail
13
+ VCR.use_cassette('geodata/job/detail') do
14
+ result = BaiduLBS::GeoData::Job.detail(id: '541c6ee0ba6000ac648b4567')
15
+
16
+ assert_equal 0, result['status']
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,54 @@
1
+ require 'test_helper'
2
+
3
+ class PoiTest < MiniTest::Test
4
+ def test_create
5
+ VCR.use_cassette('geodata/poi/create') do
6
+ result = BaiduLBS::GeoData::Poi.create(title: 'awesome_poi',
7
+ longitude: 100,
8
+ latitude: 100,
9
+ coord_type: 1,
10
+ geotable_id: 78835)
11
+ assert_equal 0, result['status']
12
+ end
13
+ end
14
+
15
+ def test_list
16
+ VCR.use_cassette('geodata/poi/list') do
17
+ result = BaiduLBS::GeoData::Poi.list(geotable_id: 78835, title: 'awesome_poi')
18
+
19
+ assert_equal 'awesome_poi', result['pois'].first['title']
20
+ end
21
+ end
22
+
23
+ def test_detail
24
+ VCR.use_cassette('geodata/poi/detail') do
25
+ result = BaiduLBS::GeoData::Poi.detail(geotable_id: 78835, id: 499219466)
26
+
27
+ assert_equal 'awesome_poi', result['poi']['title']
28
+ end
29
+ end
30
+
31
+ def test_update
32
+ VCR.use_cassette('geodata/poi/update') do
33
+ result = BaiduLBS::GeoData::Poi.update(geotable_id: 78835, id: 499219466, title: 'cool_poi')
34
+
35
+ assert_equal 0, result['status']
36
+ end
37
+ end
38
+
39
+ def test_delete
40
+ VCR.use_cassette('geodata/poi/delete') do
41
+ result = BaiduLBS::GeoData::Poi.detail(geotable_id: 78835, id: 499219466)
42
+
43
+ assert_equal 0, result['status']
44
+ end
45
+ end
46
+
47
+ def test_upload
48
+ VCR.use_cassette('geodata/poi/upload') do
49
+ result = BaiduLBS::GeoData::Poi.upload(geotable_id: 78835,
50
+ poi_list: File.expand_path('../../../fixtures/poi_list.csv', __FILE__))
51
+ assert_equal 0, result['status']
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class VersionTest < MiniTest::Test
4
+ def test_version
5
+ assert !BaiduLBS::VERSION.nil?
6
+ end
7
+ end
8
+
@@ -0,0 +1 @@
1
+ awesome_poi,浙江,100,100,1
@@ -0,0 +1,5 @@
1
+ require 'test_helper'
2
+
3
+ class GeoSearchTest < MiniTest::Test
4
+
5
+ end
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.map.baidu.com/geodata/v3/column/create
6
+ body:
7
+ encoding: UTF-8
8
+ string: ak=KmMATCZL0fakL8XkCWZsuS0K&geotable_id=78835&is_index_field=1&is_search_field=0&is_sortfilter_field=1&key=awesome_column&name=awesome_column&type=1
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Http-X-Bd-Logid:
24
+ - '2134981503'
25
+ Http-X-Bd-Logid64:
26
+ - '17044579677850031327'
27
+ Http-X-Bd-Product:
28
+ - map
29
+ Http-X-Bd-Subsys:
30
+ - apimap
31
+ Set-Cookie:
32
+ - BAIDUID=75D4C65580127A7417956510757691DB:FG=1; max-age=31536000; expires=Sat,
33
+ 19-Sep-15 16:26:26 GMT; domain=.baidu.com; path=/; version=1
34
+ P3p:
35
+ - CP=" OTI DSP COR IVA OUR IND COM "
36
+ Content-Type:
37
+ - text/javascript; charset=UTF-8
38
+ Vary:
39
+ - Accept-Encoding
40
+ Content-Length:
41
+ - '68'
42
+ Date:
43
+ - Fri, 19 Sep 2014 16:26:27 GMT
44
+ Server:
45
+ - apache
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"status":0,"id":77316,"message":"\u6210\u529f"}'
49
+ http_version:
50
+ recorded_at: Fri, 19 Sep 2014 16:26:27 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://api.map.baidu.com/geodata/v3/column/delete
6
+ body:
7
+ encoding: UTF-8
8
+ string: ak=KmMATCZL0fakL8XkCWZsuS0K&geotable_id=78835&id=77316
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ Accept:
17
+ - "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Http-X-Bd-Logid:
24
+ - '3396387194'
25
+ Http-X-Bd-Logid64:
26
+ - '2248342508530877931'
27
+ Http-X-Bd-Product:
28
+ - map
29
+ Http-X-Bd-Subsys:
30
+ - apimap
31
+ Set-Cookie:
32
+ - BAIDUID=E3B368BBCAD67C5B008FEA8B2C6ABE11:FG=1; max-age=31536000; expires=Sat,
33
+ 19-Sep-15 16:32:07 GMT; domain=.baidu.com; path=/; version=1
34
+ P3p:
35
+ - CP=" OTI DSP COR IVA OUR IND COM "
36
+ Content-Type:
37
+ - text/javascript; charset=UTF-8
38
+ Vary:
39
+ - Accept-Encoding
40
+ Transfer-Encoding:
41
+ - chunked
42
+ Date:
43
+ - Fri, 19 Sep 2014 16:32:08 GMT
44
+ Server:
45
+ - apache
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"status":21,"id":"541c5a880449e4df7f8b4567","message":"\u6b64\u64cd\u4f5c\u4e3a\u6279\u91cf\u64cd\u4f5c"}'
49
+ http_version:
50
+ recorded_at: Fri, 19 Sep 2014 16:32:08 GMT
51
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://api.map.baidu.com/geodata/v3/column/detail?ak=KmMATCZL0fakL8XkCWZsuS0K&geotable_id=78835&id=77316
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.0
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ Accept:
15
+ - "*/*"
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Http-X-Bd-Logid:
22
+ - '571298586'
23
+ Http-X-Bd-Logid64:
24
+ - '7647835353420295116'
25
+ Http-X-Bd-Product:
26
+ - map
27
+ Http-X-Bd-Subsys:
28
+ - apimap
29
+ Set-Cookie:
30
+ - BAIDUID=736F3DF8DA492A13B4BDF9FB3D9FC890:FG=1; max-age=31536000; expires=Sat,
31
+ 19-Sep-15 16:27:22 GMT; domain=.baidu.com; path=/; version=1
32
+ P3p:
33
+ - CP=" OTI DSP COR IVA OUR IND COM "
34
+ Content-Type:
35
+ - text/javascript; charset=UTF-8
36
+ Vary:
37
+ - Accept-Encoding
38
+ Transfer-Encoding:
39
+ - chunked
40
+ Date:
41
+ - Fri, 19 Sep 2014 16:27:22 GMT
42
+ Server:
43
+ - apache
44
+ body:
45
+ encoding: UTF-8
46
+ string: '{"status":0,"column":{"key":"awesome_column","type":1,"geotable_id":78835,"name":"awesome_column","is_sortfilter_field":1,"sortfilter_id":1,"is_search_field":0,"is_index_field":1,"is_unique_field":0,"create_time":"2014-09-20
47
+ 00:26:26","modify_time":"2014-09-20 00:26:26","id":77316},"message":"\u6210\u529f"}'
48
+ http_version:
49
+ recorded_at: Fri, 19 Sep 2014 16:27:25 GMT
50
+ recorded_with: VCR 2.9.3