snoo 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## 0.0.5
4
+
5
+ + Added `get_modqueue`
6
+ + Renamed `modlog` to `get_modlog`, to keep with convention
7
+
8
+ ## 0.0.4
9
+
10
+ + Added `modlog` to fetch the modlog
11
+
12
+ ## 0.0.3
13
+
14
+ + Added in cookie-based auth, use `auth` method
15
+
16
+ ## 0.0.2
17
+
18
+ + Refactored several commands to use option hashes instead of explicit arguments
@@ -63,16 +63,16 @@ module Snoo
63
63
  #
64
64
  # @param subreddit [String] The subreddit to fetch from
65
65
  # @param opts [Hash] Options to pass to reddit
66
- # @option opts [Fixnum] :count (100) The number to get. Can't be higher than 100
66
+ # @option opts [Fixnum] :limit (100) The number to get. Can't be higher than 100
67
67
  # @option opts [String] :before The "fullname" to fetch before.
68
- # @option opts [String] :after The "fullname" to fetch after.
68
+ # @option opts [String] :after The "fullname" to fetch after (older than).
69
69
  # @option opts [String] :type See [reddit API docs](http://www.reddit.com/dev/api#GET_moderationlog)
70
70
  # @option opts [String] :mod The moderator to get. Name, not ID
71
71
  # @return [Hash] A hash consisting of the data, first fullname, last fullname, first date, and last date
72
- def modlog subreddit, opts = {}
72
+ def get_modlog subreddit, opts = {}
73
73
  logged_in?
74
74
  options = {
75
- count: 100
75
+ limit: 100
76
76
  }.merge opts
77
77
  data = Nokogiri::HTML.parse(get("/r/#{subreddit}/about/log", query: options).body).css('.modactionlisting tr')
78
78
  processed = {
@@ -95,5 +95,21 @@ module Snoo
95
95
  return processed
96
96
  end
97
97
 
98
+ # Get the modqueue, or a subset of it (dear god)
99
+ #
100
+ # @param subreddit [String] The subreddit to fetch from
101
+ # @param opts [Hash] The options hash to pass to reddit
102
+ # @option opts [Fixnum] :limit (100) The total items to return. Can't go higher than 100
103
+ # @option opts [String] :before The thing_id to fetch before (newer than). Can be either a link (t3_) or comment (t1_)
104
+ # @option opts [String] :after The thing_id to fetch after (older than). Can be either a link (t3_) or comment (t1_)
105
+ def get_modqueue subreddit, opts={}
106
+ logged_in?
107
+ options = {
108
+ limit: 100
109
+ }.merge opts
110
+
111
+ get("/r/#{subreddit}/about/modqueue.json", query: options)
112
+ end
113
+
98
114
  end
99
115
  end
data/lib/snoo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Snoo
2
2
  # The version string (duh)
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-07 00:00:00.000000000 Z
12
+ date: 2012-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -71,6 +71,7 @@ extra_rdoc_files: []
71
71
  files:
72
72
  - .gitignore
73
73
  - .yardopts
74
+ - CHANGELOG.md
74
75
  - Gemfile
75
76
  - LICENSE
76
77
  - README.md