weibo_api 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/weibo_api/endpoint.rb +1 -16
- data/lib/weibo_api/version.rb +1 -1
- data/weibo_api.gemspec +2 -4
- metadata +5 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c7b7a4ebe51199eec6b539b0c06bf438a07202ac5e20f9bd19884835b9f58b6
|
4
|
+
data.tar.gz: c028601b537728c045072fd882e532aa72574f4e82639388e04588bcda6260bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f45796f89cd07a4ba30c2d9b37df060f4c0077be73b100845e894fa31762ed09ce5b43dbc514e832e8269301a1abb76fa94d58667a34015c310187fe5db4d706
|
7
|
+
data.tar.gz: 599e4dcaad8f3f67638362fd80e3c47dcf255c3424f7405104af45b093705440e1458917f1a57641bc2b181d01f889c28639e95a171157424476ace46453539c
|
data/lib/weibo_api/endpoint.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'httparty'
|
2
|
-
require 'hashie'
|
3
2
|
|
4
3
|
module WeiboApi
|
5
4
|
module Endpoint
|
@@ -7,16 +6,6 @@ module WeiboApi
|
|
7
6
|
|
8
7
|
BASE_API_URI = 'https://api.weibo.com/2'.freeze
|
9
8
|
|
10
|
-
ERROR_CODES = {
|
11
|
-
400 => BadRequest,
|
12
|
-
404 => NotFound,
|
13
|
-
429 => TooManyRequests,
|
14
|
-
500 => InternalServerError,
|
15
|
-
502 => BadGateway,
|
16
|
-
503 => ServiceUnavailable,
|
17
|
-
504 => GatewayTimeout
|
18
|
-
}.freeze
|
19
|
-
|
20
9
|
protected
|
21
10
|
|
22
11
|
def resource_path(id = nil, opts = {})
|
@@ -34,11 +23,7 @@ module WeiboApi
|
|
34
23
|
private
|
35
24
|
|
36
25
|
def parse_success(response)
|
37
|
-
|
38
|
-
limit: response.headers['x-ratelimit-limit'],
|
39
|
-
remaining: response.headers['x-ratelimit-remaining']
|
40
|
-
)
|
41
|
-
::Hashie::Mash.new(response_hash)
|
26
|
+
JSON.parse(response.body)
|
42
27
|
end
|
43
28
|
|
44
29
|
def parse_failed(response)
|
data/lib/weibo_api/version.rb
CHANGED
data/weibo_api.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'weibo_api/version'
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'weibo_api'
|
7
7
|
spec.version = WeiboApi::VERSION
|
8
|
-
spec.authors = ['
|
8
|
+
spec.authors = ['Oren Carta-Lag']
|
9
9
|
spec.email = ['oren.carta-lag@hotmail.fr']
|
10
10
|
|
11
11
|
spec.summary = 'A Ruby wrapper for the Weibo API v2.'
|
@@ -21,7 +21,5 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
24
|
-
spec.add_development_dependency '
|
25
|
-
spec.add_development_dependency 'httparty', '~> 0'
|
26
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
24
|
+
spec.add_development_dependency 'httparty', '~> 0.16'
|
27
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weibo_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Oren Carta-Lag
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,48 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.16'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: hashie
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: httparty
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '10.0'
|
33
|
+
version: '0.16'
|
62
34
|
type: :development
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
38
|
- - "~>"
|
67
39
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
40
|
+
version: '0.16'
|
69
41
|
description: A Ruby wrapper for the Weibo API v2.
|
70
42
|
email:
|
71
43
|
- oren.carta-lag@hotmail.fr
|