Rubbit 0.0.5 → 0.0.6

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWM2ZjJkMzM2YjNjMmRmMGVmZTFkNTBmZTQ5ZDk1OTEyNWM0NzkwYw==
4
+ ZGFmMGJmOTMxYjQzNjhmNmE2ZGZlOGU0NDQyMTRkZWRjMmY3Njg4MQ==
5
5
  data.tar.gz: !binary |-
6
- MTQ1ZTQ0MTI4NTI2NTc2ZTlhZGRhOGI1Y2YxMzRhNTA5YTk3NzRiMg==
6
+ MTIzYmQ5NTZkNjBmZTMxNGE2NDAyZDkxNmNkMmY2NzY4NDFlYzg4NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NWZmZDUwOThjYTg3N2MxZDI5MTc1MzJhOGZjZGJjNjkyY2U4MDVmZTQ2NjRl
10
- Y2ExMjhiZjUxYmJjOWI1YmE3OGQxYTU4Mjc5NjY5NDFkNjUzNGVhNWI3NWRj
11
- NjQyNmY4MWY2Zjk0NjFlYjExN2Y1N2M3ZGVhOTYzY2ViOWJhZWM=
9
+ NGY2MTM4OTJhMDI1ZjcwMjFjZDEzZjAxYTJjNWU3NDRiNjY5ODAxMWZjMDAx
10
+ ZTMyY2M1NzgzYzdhMzU0ZWViOGFkMDViZjZiY2I3MzZlNDgyMjc0NGYzODY3
11
+ MDU1MDhkMTllNGQ1MzAzYmM1NWRlZDQ1OTE5ZDM5ZjczNWI2MDI=
12
12
  data.tar.gz: !binary |-
13
- MWZkMmE1NzgwNGUxZmYwMThiMDA2Mzk0YjIwOWM1ODU5OTE5YzAxZjBkMDM0
14
- Y2YwY2Q3N2FkNDg5MDZjMjBjMWY4ODdmZWJlYWU2MmY0MDViOWYzYTg2MzZl
15
- ODc1NzBkZWZlZDU4ZDI3NGY4ZTM5NjJiZmQwNzI3Y2JmNmE0OWI=
13
+ YzM1ZDRjZTdlZGFkMzZjZWM0MTllNDkwZjA5ZTMxY2Y2NzJkYzliNWNiMzRk
14
+ MDQ0YzA1M2YzMDNiYTY0ZjgyOGJmZjY0ZTg3MGNlNzNkMDJmNTA1ZmZiZjUw
15
+ NWEzZDBkMGIyOGIzMTBiYjEwMGM3MDAyYjdkM2NlYjY5ZWZkZWQ=
@@ -174,18 +174,68 @@ class Rubbit_Poster
174
174
  return JSON.parse(response.body)
175
175
  end
176
176
 
177
- def comment(text,parent)
177
+ def comment(parent,id)
178
178
  params = {}
179
179
  params['text']=text
180
180
  params['thing_id']=parent
181
181
  params['uh']=get_modhash
182
182
  params['renderstylel']='html'
183
183
 
184
- puts params
185
-
186
184
  response = Reddit_Net_Wrapper.instance.make_request('post','http://www.reddit.com/api/comment',params)
187
185
 
188
- puts response.code
186
+ if(response.code=='200')
187
+ return true
188
+ end
189
+ return false
190
+ end
191
+
192
+ def hide(id)
193
+ params = {}
194
+ params['id'] = id
195
+ params['uh']=get_modhash
196
+
197
+ response = Reddit_Net_Wrapper.instance.make_request('post','http://www.reddit.com/api/hide',params)
198
+
199
+ if(response.code=='200')
200
+ return true
201
+ end
202
+ return false
203
+ end
204
+
205
+ def delete(id)
206
+ params = {}
207
+ params['id'] = id
208
+ params['uh']=get_modhash
209
+
210
+ response = Reddit_Net_Wrapper.instance.make_request('post','http://www.reddit.com/api/del',params)
211
+
212
+ if(response.code=='200')
213
+ return true
214
+ end
215
+ return false
216
+ end
217
+
218
+ def edit(id,text)
219
+ params = {}
220
+ params['api_type']='json'
221
+ params['text']=text
222
+ params['id'] = id
223
+ params['uh']=get_modhash
224
+
225
+ response = Reddit_Net_Wrapper.instance.make_request('post','http://www.reddit.com/api/editusertext',params)
226
+
227
+ if(response.code=='200')
228
+ return true
229
+ end
230
+ return false
231
+ end
232
+
233
+ def mark_nsfw(id)
234
+ params = {}
235
+ params['id'] = id
236
+ params['uh']=get_modhash
237
+
238
+ response = Reddit_Net_Wrapper.instance.make_request('post','http://www.reddit.com/api/marknsfw',params)
189
239
 
190
240
  if(response.code=='200')
191
241
  return true
@@ -200,7 +200,19 @@ class Comment
200
200
  end
201
201
 
202
202
  def reply(text)
203
- Rubbit_Poster.instance.comment(text,@name)
203
+ Rubbit_Poster.instance.comment(@name,text)
204
+ end
205
+
206
+ def delete
207
+ Rubbit_Poster.instance.delete(@name)
208
+ end
209
+
210
+ def edit(text)
211
+ Rubbit_Poster.instance.edit(@name,text)
212
+ end
213
+
214
+ def hide
215
+ Rubbit_Poster.instance.hide(@name)
204
216
  end
205
217
  end
206
218
 
@@ -217,7 +229,7 @@ class Post
217
229
  end
218
230
  end
219
231
  def reply(text)
220
- return Rubbit_Poster.instance.comment(text,@name)
232
+ return Rubbit_Poster.instance.comment(@name,text)
221
233
  end
222
234
 
223
235
  def comments
@@ -226,6 +238,22 @@ class Post
226
238
  end
227
239
  return @comments
228
240
  end
241
+
242
+ def delete
243
+ Rubbit_Poster.instance.delete(@name)
244
+ end
245
+
246
+ def edit(text)
247
+ Rubbit_Poster.instance.edit(@name,text)
248
+ end
249
+
250
+ def hide
251
+ Rubbit_Poster.instance.hide(@name)
252
+ end
253
+
254
+ def mark_nsfw
255
+ Rubbit_Poster.instance.mark_nsfw(@name)
256
+ end
229
257
  end
230
258
 
231
259
  class Message
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Rubbit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - /u/The1RGood