NeonRAW 0.1.4 → 0.1.5
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/CHANGELOG.md +5 -0
- data/lib/NeonRAW/errors.rb +1 -1
- data/lib/NeonRAW/objects/all.rb +3 -0
- data/lib/NeonRAW/objects/subreddit/utilities.rb +5 -2
- data/lib/NeonRAW/version.rb +1 -1
- 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: 2324bfcec373560663e0ec7cf943731d9f587b13
|
4
|
+
data.tar.gz: 94018ae2b46d4463542b3b6207a7659024ec4ee4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2da5759365cca36ca2ab91b4816c5afd91e16ecacee526bc14de2cf3e83918f5d68b2022ab26b9a71a0cf5506f92745109b1d91ecf718c90b14dfdd343a8b20c
|
7
|
+
data.tar.gz: 386686c61e371303edebc6d788375394dadae5d96281db67a433afb39267afc31172ae5c6d537aabf6354649034df572e0b50a2759e3c71d67a78ba7bf9659d7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 0.1.5
|
2
|
+
|
3
|
+
* Changed conditional statement in the ratelimiting so that the client will sleep if requests_remaining is <= 0.
|
4
|
+
* Changed Subreddit#info parameter from :id to :name since it takes a fullname instead of the ID.
|
5
|
+
|
1
6
|
## 0.1.4
|
2
7
|
|
3
8
|
* Renamed flatten_comments to flatten_tree and moved it to the client utilities rather than being a submission method.
|
data/lib/NeonRAW/errors.rb
CHANGED
@@ -130,7 +130,7 @@ module NeonRAW
|
|
130
130
|
def handle_ratelimit(headers)
|
131
131
|
requests_remaining = headers['X-Ratelimit-Remaining'].to_i
|
132
132
|
ratelimit_reset = headers['X-Ratelimit-Reset'].to_i
|
133
|
-
sleep(ratelimit_reset) if requests_remaining
|
133
|
+
sleep(ratelimit_reset) if requests_remaining <= 0
|
134
134
|
end
|
135
135
|
|
136
136
|
# That URL has already been submitted.
|
data/lib/NeonRAW/objects/all.rb
CHANGED
@@ -6,11 +6,14 @@ module NeonRAW
|
|
6
6
|
# Get info on a link/comment/subreddit.
|
7
7
|
# @!method info(params = {})
|
8
8
|
# @param params [Hash] The parameters.
|
9
|
-
# @option params :
|
9
|
+
# @option params :name [String] The fullname of the thing.
|
10
10
|
# @option params :url [String] The URL of the thing.
|
11
11
|
# @return [NeonRAW::Objects::Comment/Submission/Subreddit] Returns the
|
12
12
|
# object.
|
13
|
+
# @see https://www.reddit.com/dev/api#fullnames
|
13
14
|
def info(params = {})
|
15
|
+
params[:id] = params[:name]
|
16
|
+
params.delete(:name)
|
14
17
|
path = "/r/#{display_name}/api/info"
|
15
18
|
data = @client.request_data(path, :get, params)
|
16
19
|
case data[:data][:children][0][:kind]
|
@@ -39,7 +42,7 @@ module NeonRAW
|
|
39
42
|
response = @client.request_data('/api/submit', :post, params)
|
40
43
|
# Seriously though, fucking convoluted data structures.
|
41
44
|
submission_id = response[:jquery].last[3].first.split('/')[6]
|
42
|
-
info(
|
45
|
+
info(name: 't3_' + submission_id)
|
43
46
|
end
|
44
47
|
|
45
48
|
# Gets recommended subreddits for the subreddit.
|
data/lib/NeonRAW/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: NeonRAW
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SirNeon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|