twitter_api 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.
- checksums.yaml +4 -4
- data/README.md +18 -4
- data/lib/twitter_api/version.rb +1 -1
- data/lib/twitter_api.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a3db3bf69e15b1348027a86ef3ae6858278bede
|
4
|
+
data.tar.gz: 232a03167de774f62b18e49b78479801e10666db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a2249100fca19646803041a5b4ce2590a22a00764b979ccb73ffd560dd70f3d6623c4dd02dcac13c3cd315d96848ac6b9ae3189f6d9a2b94039bd270bc1667
|
7
|
+
data.tar.gz: a925350474fb0fae452f47fff15c4ce74a459e9e7852615cfa2e7d3866929669807f5b43860c583d4a1f91b2a1fa5e641737bd0b17cced116a1f99525daa28eb
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Twitter API Ruby thin client wrapper library
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/twitter_api)
|
4
|
+
|
3
5
|
## Installation
|
4
6
|
|
5
7
|
Add this line to your application's Gemfile:
|
@@ -36,7 +38,7 @@ res = t.get('https://api.twitter.com/1.1/statuses/user_timeline.json', {
|
|
36
38
|
'count' => '1'
|
37
39
|
})
|
38
40
|
puts res.headers
|
39
|
-
puts JSON.parse(res.body)
|
41
|
+
puts JSON.pretty_generate(JSON.parse(res.body))
|
40
42
|
|
41
43
|
# call GET statuses/user_timeline
|
42
44
|
res = t.statuses_user_timeline({
|
@@ -44,23 +46,35 @@ res = t.statuses_user_timeline({
|
|
44
46
|
'count' => '1'
|
45
47
|
})
|
46
48
|
puts res.headers
|
47
|
-
puts JSON.parse(res.body)
|
49
|
+
puts JSON.pretty_generate(JSON.parse(res.body))
|
48
50
|
|
49
51
|
# call POST statuses/update
|
50
52
|
res = t.post('https://api.twitter.com/1.1/statuses/update.json', {
|
51
53
|
'status' => "hello, world #{Time.now.to_i}"
|
52
54
|
})
|
53
55
|
puts res.headers
|
54
|
-
puts JSON.parse(res.body)
|
56
|
+
puts JSON.pretty_generate(JSON.parse(res.body))
|
55
57
|
|
56
58
|
# call POST statuses/update
|
57
59
|
res = t.statuses_update({
|
58
60
|
'status' => "hello, world #{Time.now.to_i}"
|
59
61
|
})
|
60
62
|
puts res.headers
|
61
|
-
puts JSON.parse(res.body)
|
63
|
+
puts JSON.pretty_generate(JSON.parse(res.body))
|
64
|
+
|
65
|
+
# call GET statues/mention_timeline
|
66
|
+
res = t.statuses_mentions_timeline({
|
67
|
+
'count' => '1'
|
68
|
+
})
|
69
|
+
puts res.headers
|
70
|
+
puts JSON.pretty_generate(JSON.parse(res.body))
|
62
71
|
```
|
63
72
|
|
73
|
+
## Documentation
|
74
|
+
|
75
|
+
Reference Documentation — Twitter Developers
|
76
|
+
https://dev.twitter.com/rest/reference
|
77
|
+
|
64
78
|
## Contributing
|
65
79
|
|
66
80
|
Bug reports and pull requests are welcome on GitHub at https://github.com/niwasawa/twitter-api-ruby-thin-client-wrapper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
data/lib/twitter_api/version.rb
CHANGED
data/lib/twitter_api.rb
CHANGED
@@ -44,6 +44,13 @@ module TwitterAPI
|
|
44
44
|
get(base_url, params)
|
45
45
|
end
|
46
46
|
|
47
|
+
# GET statuses/mentions_timeline — Twitter Developers
|
48
|
+
# https://dev.twitter.com/rest/reference/get/statuses/mentions_timeline
|
49
|
+
def statuses_mentions_timeline(params)
|
50
|
+
base_url = 'https://api.twitter.com/1.1/statuses/mentions_timeline.json'
|
51
|
+
get(base_url, params)
|
52
|
+
end
|
53
|
+
|
47
54
|
# GET statuses/user_timeline — Twitter Developers
|
48
55
|
# https://dev.twitter.com/rest/reference/get/statuses/user_timeline
|
49
56
|
def statuses_user_timeline(params)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twitter_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
|
- Naoki Iwasawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_oauth
|