disqussion 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/.gitignore +9 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +80 -0
  4. data/HISTORY.mkd +5 -0
  5. data/LICENSE.mkd +20 -0
  6. data/README.mkd +139 -0
  7. data/Rakefile +23 -0
  8. data/disqussion.gemspec +37 -0
  9. data/lib/disqussion/api.rb +21 -0
  10. data/lib/disqussion/client/.DS_Store +0 -0
  11. data/lib/disqussion/client/applications.rb +20 -0
  12. data/lib/disqussion/client/blacklists.rb +4 -0
  13. data/lib/disqussion/client/categories.rb +4 -0
  14. data/lib/disqussion/client/exports.rb +4 -0
  15. data/lib/disqussion/client/forums.rb +122 -0
  16. data/lib/disqussion/client/imports.rb +4 -0
  17. data/lib/disqussion/client/posts.rb +217 -0
  18. data/lib/disqussion/client/reactions.rb +79 -0
  19. data/lib/disqussion/client/reports.rb +4 -0
  20. data/lib/disqussion/client/threads.rb +199 -0
  21. data/lib/disqussion/client/trends.rb +23 -0
  22. data/lib/disqussion/client/users.rb +103 -0
  23. data/lib/disqussion/client/utils.rb +90 -0
  24. data/lib/disqussion/client/whitelists.rb +4 -0
  25. data/lib/disqussion/client.rb +46 -0
  26. data/lib/disqussion/configuration.rb +121 -0
  27. data/lib/disqussion/connection.rb +36 -0
  28. data/lib/disqussion/error.rb +51 -0
  29. data/lib/disqussion/request.rb +38 -0
  30. data/lib/disqussion/version.rb +3 -0
  31. data/lib/disqussion/view_helpers.rb +9 -0
  32. data/lib/disqussion/widget.rb +183 -0
  33. data/lib/disqussion.rb +25 -0
  34. data/lib/faraday/response/raise_http_4xx.rb +41 -0
  35. data/lib/faraday/response/raise_http_5xx.rb +20 -0
  36. data/spec/disqussion/api_spec.rb +63 -0
  37. data/spec/disqussion/client/.DS_Store +0 -0
  38. data/spec/disqussion/client/applications_spec.rb +24 -0
  39. data/spec/disqussion/client/forums_spec.rb +80 -0
  40. data/spec/disqussion/client/posts_spec.rb +154 -0
  41. data/spec/disqussion/client/reactions_spec.rb +63 -0
  42. data/spec/disqussion/client/threads_spec.rb +128 -0
  43. data/spec/disqussion/client/trends_spec.rb +24 -0
  44. data/spec/disqussion/client/users_spec.rb +33 -0
  45. data/spec/disqussion/client_spec.rb +15 -0
  46. data/spec/disqussion_spec.rb +101 -0
  47. data/spec/faraday/response_spec.rb +30 -0
  48. data/spec/fixtures/applications/listUsage.json +129 -0
  49. data/spec/fixtures/forums/create.json +12 -0
  50. data/spec/fixtures/forums/details.json +12 -0
  51. data/spec/fixtures/forums/listCategories.json +21 -0
  52. data/spec/fixtures/forums/listPosts.json +859 -0
  53. data/spec/fixtures/forums/listThreads.json +533 -0
  54. data/spec/fixtures/posts/approve.json +6 -0
  55. data/spec/fixtures/posts/create.json +6 -0
  56. data/spec/fixtures/posts/details.json +35 -0
  57. data/spec/fixtures/posts/highlight.json +6 -0
  58. data/spec/fixtures/posts/list.json +247 -0
  59. data/spec/fixtures/posts/remove.json +6 -0
  60. data/spec/fixtures/posts/report.json +6 -0
  61. data/spec/fixtures/posts/restore.json +6 -0
  62. data/spec/fixtures/posts/spam.json +6 -0
  63. data/spec/fixtures/posts/unhighlight.json +6 -0
  64. data/spec/fixtures/posts/vote.json +6 -0
  65. data/spec/fixtures/reactions/domains.json +4 -0
  66. data/spec/fixtures/reactions/ips.json +131 -0
  67. data/spec/fixtures/reactions/threads.json +4 -0
  68. data/spec/fixtures/reactions/users.json +124 -0
  69. data/spec/fixtures/threads/close.json +4 -0
  70. data/spec/fixtures/threads/create.json +22 -0
  71. data/spec/fixtures/threads/details.json +24 -0
  72. data/spec/fixtures/threads/list.json +531 -0
  73. data/spec/fixtures/threads/listMostLiked.json +530 -0
  74. data/spec/fixtures/threads/listPosts.json +87 -0
  75. data/spec/fixtures/threads/open.json +8 -0
  76. data/spec/fixtures/threads/remove.json +4 -0
  77. data/spec/fixtures/threads/restore.json +4 -0
  78. data/spec/fixtures/threads/vote.json +4 -0
  79. data/spec/fixtures/trends/listTreads.json +283 -0
  80. data/spec/fixtures/users/details.json +19 -0
  81. data/spec/fixtures/users/follow.json +4 -0
  82. data/spec/helper.rb +47 -0
  83. metadata +348 -0
@@ -0,0 +1,531 @@
1
+ {
2
+ "cursor": {
3
+ "prev": null,
4
+ "hasNext": true,
5
+ "next": "1301726165300245:0:0",
6
+ "hasPrev": false,
7
+ "total": null,
8
+ "id": "1301726165300245:0:0",
9
+ "more": true
10
+ },
11
+ "code": 0,
12
+ "response": [
13
+ {
14
+ "category": "595774",
15
+ "reactions": 0,
16
+ "identifiers": [
17
+ "post_4522"
18
+ ],
19
+ "forum": "yvanrodic",
20
+ "title": "Sydney",
21
+ "dislikes": 0,
22
+ "isDeleted": false,
23
+ "author": "6138058",
24
+ "userScore": 0,
25
+ "id": "297457168",
26
+ "isClosed": false,
27
+ "posts": 2,
28
+ "link": "http://www.yvanrodic.com/posts/4522/sydney",
29
+ "likes": 0,
30
+ "message": "",
31
+ "slug": "sydney_143",
32
+ "createdAt": "2011-05-07T03:02:56"
33
+ },
34
+ {
35
+ "category": "595774",
36
+ "reactions": 0,
37
+ "identifiers": [],
38
+ "forum": "yvanrodic",
39
+ "title": "Sydney",
40
+ "dislikes": 0,
41
+ "isDeleted": false,
42
+ "author": "6138058",
43
+ "userScore": 0,
44
+ "id": "297457167",
45
+ "isClosed": false,
46
+ "posts": 0,
47
+ "link": "http://yvanrodic.com/posts/4522/sydney",
48
+ "likes": 0,
49
+ "message": "",
50
+ "slug": "sydney_18",
51
+ "createdAt": "2011-05-07T03:02:55"
52
+ },
53
+ {
54
+ "category": "595774",
55
+ "reactions": 3,
56
+ "identifiers": [
57
+ "post_4521"
58
+ ],
59
+ "forum": "yvanrodic",
60
+ "title": "Sydney",
61
+ "dislikes": 0,
62
+ "isDeleted": false,
63
+ "author": "6138058",
64
+ "userScore": 0,
65
+ "id": "295818503",
66
+ "isClosed": false,
67
+ "posts": 0,
68
+ "link": "http://yvanrodic.com/posts/4521/sydney",
69
+ "likes": 0,
70
+ "message": "",
71
+ "slug": "sydney_27",
72
+ "createdAt": "2011-05-05T08:40:37"
73
+ },
74
+ {
75
+ "category": "595774",
76
+ "reactions": 7,
77
+ "identifiers": [
78
+ "post_4520"
79
+ ],
80
+ "forum": "yvanrodic",
81
+ "title": "Shanghai",
82
+ "dislikes": 0,
83
+ "isDeleted": false,
84
+ "author": "6138058",
85
+ "userScore": 0,
86
+ "id": "293757871",
87
+ "isClosed": false,
88
+ "posts": 7,
89
+ "link": "http://yvanrodic.com/posts/4520/shanghai",
90
+ "likes": 0,
91
+ "message": "",
92
+ "slug": "shanghai_21",
93
+ "createdAt": "2011-05-03T00:35:20"
94
+ },
95
+ {
96
+ "category": "595774",
97
+ "reactions": 10,
98
+ "identifiers": [
99
+ "post_4519"
100
+ ],
101
+ "forum": "yvanrodic",
102
+ "title": "Shanghai",
103
+ "dislikes": 0,
104
+ "isDeleted": false,
105
+ "author": "6138058",
106
+ "userScore": 0,
107
+ "id": "292599971",
108
+ "isClosed": false,
109
+ "posts": 4,
110
+ "link": "http://yvanrodic.com/posts/4519/shanghai",
111
+ "likes": 0,
112
+ "message": "",
113
+ "slug": "shanghai",
114
+ "createdAt": "2011-05-01T11:08:44"
115
+ },
116
+ {
117
+ "category": "595774",
118
+ "reactions": 15,
119
+ "identifiers": [
120
+ "post_4518"
121
+ ],
122
+ "forum": "yvanrodic",
123
+ "title": "Tokyo",
124
+ "dislikes": 0,
125
+ "isDeleted": false,
126
+ "author": "6138058",
127
+ "userScore": 0,
128
+ "id": "291807157",
129
+ "isClosed": false,
130
+ "posts": 3,
131
+ "link": "http://yvanrodic.com/posts/4518/tokyo",
132
+ "likes": 0,
133
+ "message": "",
134
+ "slug": "tokyo_67",
135
+ "createdAt": "2011-04-30T03:38:20"
136
+ },
137
+ {
138
+ "category": "595774",
139
+ "reactions": 5,
140
+ "identifiers": [
141
+ "post_4517"
142
+ ],
143
+ "forum": "yvanrodic",
144
+ "title": "Seoul",
145
+ "dislikes": 0,
146
+ "isDeleted": false,
147
+ "author": "6138058",
148
+ "userScore": 0,
149
+ "id": "289356160",
150
+ "isClosed": false,
151
+ "posts": 2,
152
+ "link": "http://yvanrodic.com/posts/4517/seoul",
153
+ "likes": 0,
154
+ "message": "",
155
+ "slug": "seoul_52",
156
+ "createdAt": "2011-04-27T04:12:03"
157
+ },
158
+ {
159
+ "category": "595774",
160
+ "reactions": 0,
161
+ "identifiers": [
162
+ "post_4516"
163
+ ],
164
+ "forum": "yvanrodic",
165
+ "title": "Seoul",
166
+ "dislikes": 0,
167
+ "isDeleted": false,
168
+ "author": "6138058",
169
+ "userScore": 0,
170
+ "id": "288449201",
171
+ "isClosed": false,
172
+ "posts": 2,
173
+ "link": "http://www.yvanrodic.com/posts/4516/seoul",
174
+ "likes": 0,
175
+ "message": "",
176
+ "slug": "seoul_08",
177
+ "createdAt": "2011-04-26T01:58:24"
178
+ },
179
+ {
180
+ "category": "595774",
181
+ "reactions": 16,
182
+ "identifiers": [
183
+ "post_4515"
184
+ ],
185
+ "forum": "yvanrodic",
186
+ "title": "Seoul",
187
+ "dislikes": 0,
188
+ "isDeleted": false,
189
+ "author": "6138058",
190
+ "userScore": 0,
191
+ "id": "287593148",
192
+ "isClosed": false,
193
+ "posts": 1,
194
+ "link": "http://yvanrodic.com/posts/4515/seoul",
195
+ "likes": 0,
196
+ "message": "",
197
+ "slug": "seoul_526",
198
+ "createdAt": "2011-04-24T22:10:02"
199
+ },
200
+ {
201
+ "category": "595774",
202
+ "reactions": 0,
203
+ "identifiers": [],
204
+ "forum": "yvanrodic",
205
+ "title": "Yvan Rodic - Cape Town - March 22 2011",
206
+ "dislikes": 0,
207
+ "isDeleted": false,
208
+ "author": "6138058",
209
+ "userScore": 0,
210
+ "id": "286471516",
211
+ "isClosed": false,
212
+ "posts": 0,
213
+ "link": "http://www.yvanrodic.com/posts/4488/cape-town-march-14th-15th-2011",
214
+ "likes": 0,
215
+ "message": "",
216
+ "slug": "yvan_rodic_cape_town_march_22_2011",
217
+ "createdAt": "2011-04-23T04:52:27"
218
+ },
219
+ {
220
+ "category": "595774",
221
+ "reactions": 0,
222
+ "identifiers": [],
223
+ "forum": "yvanrodic",
224
+ "title": "Yvan Rodic - Cape Town - March 24 2011",
225
+ "dislikes": 0,
226
+ "isDeleted": false,
227
+ "author": "6138058",
228
+ "userScore": 0,
229
+ "id": "286471507",
230
+ "isClosed": false,
231
+ "posts": 0,
232
+ "link": "http://www.yvanrodic.com/posts/4486/cape-town-march-17th-2011",
233
+ "likes": 0,
234
+ "message": "",
235
+ "slug": "yvan_rodic_cape_town_march_24_2011",
236
+ "createdAt": "2011-04-23T04:52:25"
237
+ },
238
+ {
239
+ "category": "595774",
240
+ "reactions": 2,
241
+ "identifiers": [
242
+ "post_4514"
243
+ ],
244
+ "forum": "yvanrodic",
245
+ "title": "Seoul",
246
+ "dislikes": 0,
247
+ "isDeleted": false,
248
+ "author": "6138058",
249
+ "userScore": 0,
250
+ "id": "284628014",
251
+ "isClosed": false,
252
+ "posts": 5,
253
+ "link": "http://www.yvanrodic.com/posts/4514/seoul",
254
+ "likes": 0,
255
+ "message": "",
256
+ "slug": "seoul_41",
257
+ "createdAt": "2011-04-20T21:25:23"
258
+ },
259
+ {
260
+ "category": "595774",
261
+ "reactions": 12,
262
+ "identifiers": [
263
+ "post_4513"
264
+ ],
265
+ "forum": "yvanrodic",
266
+ "title": "New York",
267
+ "dislikes": 0,
268
+ "isDeleted": false,
269
+ "author": "6138058",
270
+ "userScore": 0,
271
+ "id": "282369868",
272
+ "isClosed": false,
273
+ "posts": 3,
274
+ "link": "http://yvanrodic.com/posts/4513/new-york",
275
+ "likes": 0,
276
+ "message": "",
277
+ "slug": "new_york_99",
278
+ "createdAt": "2011-04-18T12:07:42"
279
+ },
280
+ {
281
+ "category": "595774",
282
+ "reactions": 0,
283
+ "identifiers": [
284
+ "post_4512"
285
+ ],
286
+ "forum": "yvanrodic",
287
+ "title": "New York",
288
+ "dislikes": 0,
289
+ "isDeleted": false,
290
+ "author": "6138058",
291
+ "userScore": 0,
292
+ "id": "281693372",
293
+ "isClosed": false,
294
+ "posts": 3,
295
+ "link": "http://www.yvanrodic.com/posts/4512/new-york",
296
+ "likes": 0,
297
+ "message": "",
298
+ "slug": "new_york_703",
299
+ "createdAt": "2011-04-17T15:10:49"
300
+ },
301
+ {
302
+ "category": "595774",
303
+ "reactions": 7,
304
+ "identifiers": [
305
+ "post_4511"
306
+ ],
307
+ "forum": "yvanrodic",
308
+ "title": "New York",
309
+ "dislikes": 0,
310
+ "isDeleted": false,
311
+ "author": "6138058",
312
+ "userScore": 0,
313
+ "id": "281253585",
314
+ "isClosed": false,
315
+ "posts": 1,
316
+ "link": "http://yvanrodic.com/posts/4511/new-york",
317
+ "likes": 0,
318
+ "message": "",
319
+ "slug": "new_york_549",
320
+ "createdAt": "2011-04-16T23:55:04"
321
+ },
322
+ {
323
+ "category": "595774",
324
+ "reactions": 5,
325
+ "identifiers": [
326
+ "post_4510"
327
+ ],
328
+ "forum": "yvanrodic",
329
+ "title": "New York",
330
+ "dislikes": 0,
331
+ "isDeleted": false,
332
+ "author": "6138058",
333
+ "userScore": 0,
334
+ "id": "281227676",
335
+ "isClosed": false,
336
+ "posts": 2,
337
+ "link": "http://yvanrodic.com/posts/4510/new-york",
338
+ "likes": 0,
339
+ "message": "",
340
+ "slug": "new_york_75",
341
+ "createdAt": "2011-04-16T22:52:46"
342
+ },
343
+ {
344
+ "category": "595774",
345
+ "reactions": 0,
346
+ "identifiers": [
347
+ "post_4509"
348
+ ],
349
+ "forum": "yvanrodic",
350
+ "title": "London",
351
+ "dislikes": 0,
352
+ "isDeleted": false,
353
+ "author": "6138058",
354
+ "userScore": 0,
355
+ "id": "279410358",
356
+ "isClosed": false,
357
+ "posts": 2,
358
+ "link": "http://www.yvanrodic.com/posts/4509/london",
359
+ "likes": 2,
360
+ "message": "",
361
+ "slug": "london_56",
362
+ "createdAt": "2011-04-14T16:36:04"
363
+ },
364
+ {
365
+ "category": "595774",
366
+ "reactions": 13,
367
+ "identifiers": [
368
+ "post_4508"
369
+ ],
370
+ "forum": "yvanrodic",
371
+ "title": "Manchester",
372
+ "dislikes": 0,
373
+ "isDeleted": false,
374
+ "author": "6138058",
375
+ "userScore": 0,
376
+ "id": "278447450",
377
+ "isClosed": false,
378
+ "posts": 11,
379
+ "link": "http://yvanrodic.com/posts/4508/manchester",
380
+ "likes": 0,
381
+ "message": "",
382
+ "slug": "manchester",
383
+ "createdAt": "2011-04-13T14:45:08"
384
+ },
385
+ {
386
+ "category": "595774",
387
+ "reactions": 0,
388
+ "identifiers": [
389
+ "post_4507"
390
+ ],
391
+ "forum": "yvanrodic",
392
+ "title": "Liverpool",
393
+ "dislikes": 0,
394
+ "isDeleted": false,
395
+ "author": "6138058",
396
+ "userScore": 0,
397
+ "id": "276107815",
398
+ "isClosed": false,
399
+ "posts": 9,
400
+ "link": "http://www.yvanrodic.com/posts/4507/liverpool",
401
+ "likes": 3,
402
+ "message": "",
403
+ "slug": "liverpool",
404
+ "createdAt": "2011-04-10T17:31:07"
405
+ },
406
+ {
407
+ "category": "595774",
408
+ "reactions": 7,
409
+ "identifiers": [
410
+ "post_4506"
411
+ ],
412
+ "forum": "yvanrodic",
413
+ "title": "Milan",
414
+ "dislikes": 0,
415
+ "isDeleted": false,
416
+ "author": "6138058",
417
+ "userScore": 0,
418
+ "id": "275515296",
419
+ "isClosed": false,
420
+ "posts": 2,
421
+ "link": "http://yvanrodic.com/posts/4506/milan",
422
+ "likes": 0,
423
+ "message": "",
424
+ "slug": "milan_05",
425
+ "createdAt": "2011-04-09T18:47:49"
426
+ },
427
+ {
428
+ "category": "595774",
429
+ "reactions": 4,
430
+ "identifiers": [
431
+ "post_4505"
432
+ ],
433
+ "forum": "yvanrodic",
434
+ "title": "Milan",
435
+ "dislikes": 0,
436
+ "isDeleted": false,
437
+ "author": "6138058",
438
+ "userScore": 0,
439
+ "id": "274499225",
440
+ "isClosed": false,
441
+ "posts": 2,
442
+ "link": "http://yvanrodic.com/posts/4505/milan",
443
+ "likes": 0,
444
+ "message": "",
445
+ "slug": "milan_82",
446
+ "createdAt": "2011-04-08T12:16:33"
447
+ },
448
+ {
449
+ "category": "595774",
450
+ "reactions": 0,
451
+ "identifiers": [],
452
+ "forum": "yvanrodic",
453
+ "title": "Yvan Rodic - London - April 1 2011",
454
+ "dislikes": 0,
455
+ "isDeleted": false,
456
+ "author": "6138058",
457
+ "userScore": 0,
458
+ "id": "273875089",
459
+ "isClosed": false,
460
+ "posts": 0,
461
+ "link": "http://www.yvanrodic.com/posts/4500/LFW",
462
+ "likes": 0,
463
+ "message": "",
464
+ "slug": "yvan_rodic_london_april_1_2011",
465
+ "createdAt": "2011-04-07T20:19:22"
466
+ },
467
+ {
468
+ "category": "595774",
469
+ "reactions": 1,
470
+ "identifiers": [
471
+ "post_4504"
472
+ ],
473
+ "forum": "yvanrodic",
474
+ "title": "Reykjav\u00edk",
475
+ "dislikes": 0,
476
+ "isDeleted": false,
477
+ "author": "6138058",
478
+ "userScore": 0,
479
+ "id": "272906432",
480
+ "isClosed": false,
481
+ "posts": 2,
482
+ "link": "http://www.yvanrodic.com/posts/4504/reykjavik",
483
+ "likes": 0,
484
+ "message": "",
485
+ "slug": "reykjavik_25",
486
+ "createdAt": "2011-04-06T19:31:36"
487
+ },
488
+ {
489
+ "category": "595774",
490
+ "reactions": 0,
491
+ "identifiers": [
492
+ "post_347"
493
+ ],
494
+ "forum": "yvanrodic",
495
+ "title": "Stockholm",
496
+ "dislikes": 0,
497
+ "isDeleted": false,
498
+ "author": "6138058",
499
+ "userScore": 0,
500
+ "id": "270681479",
501
+ "isClosed": false,
502
+ "posts": 0,
503
+ "link": "http://www.yvanrodic.com/posts/347/stockholm-august-1st-2009",
504
+ "likes": 0,
505
+ "message": "",
506
+ "slug": "stockholm_20",
507
+ "createdAt": "2011-04-04T13:14:49"
508
+ },
509
+ {
510
+ "category": "595774",
511
+ "reactions": 21,
512
+ "identifiers": [
513
+ "post_4503"
514
+ ],
515
+ "forum": "yvanrodic",
516
+ "title": "Reykjav\u00edk",
517
+ "dislikes": 0,
518
+ "isDeleted": false,
519
+ "author": "6138058",
520
+ "userScore": 0,
521
+ "id": "270595549",
522
+ "isClosed": false,
523
+ "posts": 1,
524
+ "link": "http://yvanrodic.com/posts/4503/reykjavik",
525
+ "likes": 0,
526
+ "message": "",
527
+ "slug": "reykjavik_80",
528
+ "createdAt": "2011-04-04T10:48:06"
529
+ }
530
+ ]
531
+ }