Rubbit 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/Rubbit/Rubbit_Construction_Layer.rb +54 -4
- data/lib/Rubbit/Rubbit_Objects.rb +30 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGFmMGJmOTMxYjQzNjhmNmE2ZGZlOGU0NDQyMTRkZWRjMmY3Njg4MQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTIzYmQ5NTZkNjBmZTMxNGE2NDAyZDkxNmNkMmY2NzY4NDFlYzg4NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGY2MTM4OTJhMDI1ZjcwMjFjZDEzZjAxYTJjNWU3NDRiNjY5ODAxMWZjMDAx
|
10
|
+
ZTMyY2M1NzgzYzdhMzU0ZWViOGFkMDViZjZiY2I3MzZlNDgyMjc0NGYzODY3
|
11
|
+
MDU1MDhkMTllNGQ1MzAzYmM1NWRlZDQ1OTE5ZDM5ZjczNWI2MDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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(
|
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
|
-
|
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
|
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
|
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
|