Squeegy (owner)

Revisions

gist: 214609 Download_button fork
public
Public Clone URL: git://gist.github.com/214609.git
Embed All Files: show embed
_code_.c #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  CKURL *url = create(CKURL);
  curl_setURL(url, cstring_text(urlString));
  dispose(urlString);
  
  CKMemory *document = (CKMemory *)curl_fetch(url, 60);
  if (!document) {
    cobject_error(self, 3, "Failed to load URL: %s", curl_text(url));
  }
  
  cstream_open(document, CK_ReadOnly);
  CKObject *json = CKRuntimeThaw(superclass(document), NO);
  
  CKList *rootPostList = cobject_evaluate(json, "comments");
  CKObject *rootPostComment = clist_firstElement(rootPostList);
  CKList *posts = cobject_evaluate(rootPostComment, "comments");
ckit tree #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CKList 0x1002865d8 = {
  0: [(CKHash *)0x10027b488 = {
    [(CKString *)0x1002756d8 = "id"] -> [(CKValue *)0x10027a468 Type=Int64 Value=21194810]
    [(CKString *)0x1002815a8 = "date"] -> [(CKString *)0x1002812b8 = "Oct 20, 2009 1:19pm CST"]
    [(CKString *)0x100281358 = "category"] -> [(CKString *)0x100281068 = "stupid"]
    [(CKString *)0x1002817f8 = "body"] -> [(CKString *)0x100281508 = "What happens when you fuck a stranger in the acidspan class="jt_green"?/span#13;br/br/a target="_blank" href="http://www.shackpics.com/viewer.x?file=astrangerintheass_qgc15kmzfzok29cjntkv.jpg"http://www.shackpics.com/viewer.x?file=astrangerintheass_qgc15kmzfzok29cjntkv.jpg#13;/abr/br/attn span class="jt_sample"span class="jt_strike"Captain Corvette/span/span span class="jt_yellow"gmd/span"]
    [(CKString *)0x100280eb8 = "author"] -> [(CKString *)0x100280b28 = "Lunatic Angelic"]
    [(CKString *)0x100283238 = "last_reply_id"] -> [(CKValue *)0x100289018 Type=Int64 Value=21196482]
    [(CKString *)0x100275778 = "reply_count"] -> [(CKValue *)0x100272808 Type=Int64 Value=11]
    [(CKString *)0x100280be8 = "comments"] -> [CKList 0x1002855a8 = { }]
    [(CKString *)0x100281108 = "preview"] -> [(CKString *)0x100280e18 = "What happens when you fuck a stranger in the acid? http://www.shackpics.com/viewer.x?file=astrangerintheass_qgc15kmzfzok29cjntkv.jpg attn Captain Corv"]
    [(CKString *)0x100283198 = "participants"] -> [CKList 0x100285358 = {
      0: [(CKHash *)0x100267b88 = {
        [(CKString *)0x100283dc8 = "post_count"] -> [(CKValue *)0x1002802b8 Type=Int64 Value=1]
        [(CKString *)0x1002836d8 = "username"] -> [(CKString *)0x100283638 = "trOmblyj"]
      }]
      1: [(CKHash *)0x10023fd38 = {
        [(CKString *)0x100284418 = "post_count"] -> [(CKValue *)0x10027fdf8 Type=Int64 Value=1]
        [(CKString *)0x100283d28 = "username"] -> [(CKString *)0x1002844b8 = "Crabs Jarrard"]
      }]
      2: [(CKHash *)0x10026c5b8 = {
        [(CKString *)0x100283488 = "post_count"] -> [(CKValue *)0x10027ed08 Type=Int64 Value=1]
        [(CKString *)0x100282d98 = "username"] -> [(CKString *)0x100282cf8 = "everybodysuncle"]
      }]
      3: [(CKHash *)0x100280b78 = {
        [(CKString *)0x100283888 = "post_count"] -> [(CKValue *)0x10027cb38 Type=Int64 Value=2]
        [(CKString *)0x1002833e8 = "username"] -> [(CKString *)0x100283928 = "Lunatic Angelic"]
      }]
      4: [(CKHash *)0x10026a568 = {
        [(CKString *)0x100282fe8 = "post_count"] -> [(CKValue *)0x10027c678 Type=Int64 Value=1]
        [(CKString *)0x100283b78 = "username"] -> [(CKString *)0x100283ad8 = "maulla"]
      }]
      5: [(CKHash *)0x10023f448 = {
        [(CKString *)0x1002841c8 = "post_count"] -> [(CKValue *)0x10027f298 Type=Int64 Value=1]
        [(CKString *)0x100282f48 = "username"] -> [(CKString *)0x100284268 = "dirge23"]
      }]
      6: [(CKHash *)0x1002895e8 = {
        [(CKString *)0x100282608 = "post_count"] -> [(CKValue *)0x10027eda8 Type=Int64 Value=1]
        [(CKString *)0x100282858 = "username"] -> [(CKString *)0x1002828f8 = "famine101"]
      }]
      7: [(CKHash *)0x100287c28 = {
        [(CKString *)0x100282458 = "post_count"] -> [(CKValue *)0x10027afc8 Type=Int64 Value=1]
        [(CKString *)0x1002826a8 = "username"] -> [(CKString *)0x1002823b8 = "sKetchflow"]
      }]
      8: [(CKHash *)0x100288568 = {
        [(CKString *)0x100281e48 = "post_count"] -> [(CKValue *)0x10027bb18 Type=Int64 Value=1]
        [(CKString *)0x1002802e8 = "username"] -> [(CKString *)0x100282208 = "gmd"]
      }]
      9: [(CKHash *)0x100275038 = {
        [(CKString *)0x100281c98 = "post_count"] -> [(CKValue *)0x1002750a8 Type=Int64 Value=1]
        [(CKString *)0x100281ee8 = "username"] -> [(CKString *)0x100281bf8 = "indosauros"]
      }]
      10: [(CKHash *)0x10026cb78 = {
        [(CKString *)0x100281758 = "post_count"] -> [(CKValue *)0x10026cbe8 Type=Int64 Value=1]
        [(CKString *)0x1002819a8 = "username"] -> [(CKString *)0x100281a48 = "dedgecko"]
      }]
    }]
  }]
}
json tree #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
 
{
    "story_id": 60928,
     "story_name": "Morning Discussion",
     "last_page": 1,
     "page": 1,
     "comments":
    [
        {
            "last_reply_id": 21196942,
             "participants":
            [
                {
                    "username": "Omning",
                     "post_count": 1
                },
                 
                {
                    "username": "trOmblyj",
                     "post_count": 1
                },
                 
                {
                    "username": "Crabs Jarrard",
                     "post_count": 1
                },
                 
                {
                    "username": "everybodysuncle",
                     "post_count": 1
                },
                 
                {
                    "username": "Lunatic Angelic",
                     "post_count": 2
                },
                 
                {
                    "username": "maulla",
                     "post_count": 1
                },
                 
                {
                    "username": "dirge23",
                     "post_count": 1
                },
                 
                {
                    "username": "zakazi",
                     "post_count": 1
                },
                 
                {
                    "username": "spiderfill",
                     "post_count": 1
                },
                 
                {
                    "username": "famine101",
                     "post_count": 1
                },
                 
                {
                    "username": "sKetchflow",
                     "post_count": 1
                },
                 
                {
                    "username": "gmd",
                     "post_count": 1
                },
                 
                {
                    "username": "riptyde",
                     "post_count": 1
                },
                 
                {
                    "username": "breadsticks",
                     "post_count": 1
                },
                 
                {
                    "username": "indosauros",
                     "post_count": 1
                },
                 
                {
                    "username": "dedgecko",
                     "post_count": 1
                }
            ],
             "body": "What happens when you fuck a stranger in the acid\u003Cspan class=\"jt_green\"\u003E?\u003C/span\u003E\u0026#13;\u003Cbr/\u003E\u003Cbr/\u003E\u003Ca target=\"_blank\" href=\"http://www.shackpics.com/viewer.x?file=astrangerintheass_qgc15kmzfzok29cjntkv.jpg\"\u003Ehttp://www.shackpics.com/viewer.x?file=astrangerintheass_qgc15kmzfzok29cjntkv.jpg\u0026#13;\u003C/a\u003E\u003Cbr/\u003E\u003Cbr/\u003Eattn \u003Cspan class=\"jt_sample\"\u003E\u003Cspan class=\"jt_strike\"\u003ECaptain Corvette\u003C/span\u003E\u003C/span\u003E \u003Cspan class=\"jt_yellow\"\u003Egmd\u003C/span\u003E",
             "date": "Oct 20,
             2009 1:19pm CST",
             "category": "stupid",
             "preview": "What happens when you fuck a stranger in the acid? http://www.shackpics.com/viewer.x?file=astrangerintheass_qgc15kmzfzok29cjntkv.jpg attn Captain Corv",
             "author": "Lunatic Angelic",
             "comments":
            [
                {
                    "last_reply_id": null,
                     "body": "\u003Cspan class=\"jt_red\"\u003EO\u003C/span\u003E_\u003Cspan class=\"jt_blue\"\u003Eo\u003C/span\u003E",
                     "date": "Oct 20,
                     2009 1:35pm CST",
                     "category": "ontopic",
                     "preview": "O_o",
                     "author": "everybodysuncle",
                     "comments":
                    [
                    ],
                     "id": 21194992,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "it's a c4 it is ok with me ! what the hell happened though",
                     "date": "Oct 20,
                     2009 1:37pm CST",
                     "category": "ontopic",
                     "preview": "it's a c4 it is ok with me ! what the hell happened though",
                     "author": "gmd",
                     "comments":
                    [
                        {
                            "last_reply_id": null,
                             "body": "I think it's the battery (on the hood) starting a fire when it exploded over the fuel lines,
                             they rolled it out to the street (look at the tire melt)\u003Cspan class=\"jt_green\"\u003E.\u003C/span\u003E",
                             "date": "Oct 20,
                             2009 1:57pm CST",
                             "category": "ontopic",
                             "preview": "I think it's the battery (on the hood) starting a fire when it exploded over the fuel lines,
                             they rolled it out to the street (look at the tire melt).",
                             "author": "Lunatic Angelic",
                             "comments":
                            [
                                {
                                    "last_reply_id": null,
                                     "body": "isn't the battery located on the opposite side?",
                                     "date": "Oct 20,
                                     2009 3:46pm CST",
                                     "category": "ontopic",
                                     "preview": "isn't the battery located on the opposite side?",
                                     "author": "dedgecko",
                                     "comments":
                                    [
                                        {
                                            "last_reply_id": null,
                                             "body": "well it \u003Ci\u003Ewas\u003C/i\u003E \u003Cspan class=\"jt_sample\"\u003E\u003Cspan class=\"jt_sample\"\u003E(no idea)\u003C/span\u003E\u003C/span\u003E",
                                             "date": "Oct 20,
                                             2009 4:31pm CST",
                                             "category": "ontopic",
                                             "preview": "well it was (no idea)",
                                             "author": "zakazi",
                                             "comments":
                                            [
                                            ],
                                             "id": 21196913,
                                             "reply_count": 0
                                        }
                                    ],
                                     "id": 21196482,
                                     "reply_count": 1
                                }
                            ],
                             "id": 21195273,
                             "reply_count": 2
                        }
                    ],
                     "id": 21195002,
                     "reply_count": 3
                },
                 
                {
                    "last_reply_id": null,
                     "body": "they werent kidding about bologna on car paint",
                     "date": "Oct 20,
                     2009 1:37pm CST",
                     "category": "ontopic",
                     "preview": "they werent kidding about bologna on car paint",
                     "author": "indosauros",
                     "comments":
                    [
                    ],
                     "id": 21195008,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "holy shit",
                     "date": "Oct 20,
                     2009 1:38pm CST",
                     "category": "ontopic",
                     "preview": "holy shit",
                     "author": "maulla",
                     "comments":
                    [
                    ],
                     "id": 21195017,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "Viral marketing for next Aliens movie.",
                     "date": "Oct 20,
                     2009 1:40pm CST",
                     "category": "ontopic",
                     "preview": "Viral marketing for next Aliens movie.",
                     "author": "trOmblyj",
                     "comments":
                    [
                    ],
                     "id": 21195036,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "somebody shot a xenomorph on that thing",
                     "date": "Oct 20,
                     2009 1:40pm CST",
                     "category": "ontopic",
                     "preview": "somebody shot a xenomorph on that thing",
                     "author": "dirge23",
                     "comments":
                    [
                    ],
                     "id": 21195043,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "Please tell me someone was dripped on with hot melting face",
                     "date": "Oct 20,
                     2009 1:42pm CST",
                     "category": "ontopic",
                     "preview": "Please tell me someone was dripped on with hot melting face",
                     "author": "sKetchflow",
                     "comments":
                    [
                    ],
                     "id": 21195058,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "\"I just bought that car last week!\"",
                     "date": "Oct 20,
                     2009 2:15pm CST",
                     "category": "ontopic",
                     "preview": "\"I just bought that car last week!\"",
                     "author": "Crabs Jarrard",
                     "comments":
                    [
                    ],
                     "id": 21195462,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "I'm impressed that tire isn't more fucked up than it is.",
                     "date": "Oct 20,
                     2009 3:13pm CST",
                     "category": "ontopic",
                     "preview": "I'm impressed that tire isn't more fucked up than it is.",
                     "author": "famine101",
                     "comments":
                    [
                    ],
                     "id": 21196115,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "Looks like this car had a bad encounter with an Alien.",
                     "date": "Oct 20,
                     2009 4:20pm CST",
                     "category": "ontopic",
                     "preview": "Looks like this car had a bad encounter with an Alien.",
                     "author": "breadsticks",
                     "comments":
                    [
                    ],
                     "id": 21196819,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "fucking recluse spiders!!!!!",
                     "date": "Oct 20,
                     2009 4:22pm CST",
                     "category": "ontopic",
                     "preview": "fucking recluse spiders!!!!!",
                     "author": "spiderfill",
                     "comments":
                    [
                    ],
                     "id": 21196838,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "that'll buff right out",
                     "date": "Oct 20,
                     2009 4:33pm CST",
                     "category": "ontopic",
                     "preview": "that'll buff right out",
                     "author": "riptyde",
                     "comments":
                    [
                    ],
                     "id": 21196934,
                     "reply_count": 0
                },
                 
                {
                    "last_reply_id": null,
                     "body": "\u003Cspan class=\"jt_strike\"\u003Esome acid damage\u003C/span\u003E THIS CAR IS SIZZLING!",
                     "date": "Oct 20,
                     2009 4:34pm CST",
                     "category": "ontopic",
                     "preview": "some acid damage THIS CAR IS SIZZLING!",
                     "author": "Omning",
                     "comments":
                    [
                    ],
                     "id": 21196942,
                     "reply_count": 0
                }
            ],
             "id": 21194810,
             "reply_count": 16
        }
    ]
}