swdyh-gisty 0.0.6 → 0.0.9

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.
data/Rakefile CHANGED
@@ -101,3 +101,18 @@ desc 'gem build'
101
101
  task :build_gem => [:gemspec] do
102
102
  sh "gem build #{NAME}.gemspec"
103
103
  end
104
+
105
+ desc 'refresh fixtures'
106
+ task :reflresh_fixtures do
107
+ g = Gisty.new 'tmp'
108
+ re = /page=\d+/
109
+ urls = g.map_pages do |url, page|
110
+ m = url.match re
111
+ if m
112
+ fn = 'mine_' + m.to_a.first.sub('=', '_') + '_login_foo_token_bar'
113
+ path = File.join 'test', 'fixtures', fn
114
+ puts "write #{path}"
115
+ open(path, 'w') { |f| f.write page.gsub(/(&)?(login|token)=\w+(&)?/, '') }
116
+ end
117
+ end
118
+ end
data/bin/gisty CHANGED
@@ -65,9 +65,9 @@ cmd :post do |fs|
65
65
  rescue Exception => e
66
66
  puts "Error: #{e}"
67
67
  else
68
- system "open #{url}" if /darwin/ === RUBY_PLATFORM
69
68
  id = url.split('/').last
70
69
  @g.clone id
70
+ system "open #{url}" if /darwin/ === RUBY_PLATFORM
71
71
  end
72
72
  end
73
73
  end
data/lib/gisty.rb CHANGED
@@ -5,7 +5,7 @@ require 'rubygems'
5
5
  require 'nokogiri'
6
6
 
7
7
  class Gisty
8
- VERSION = '0.0.6'
8
+ VERSION = '0.0.9'
9
9
  GIST_URL = 'http://gist.github.com/'
10
10
  GISTY_URL = 'http://github.com/swdyh/gisty/tree/master'
11
11
 
@@ -15,8 +15,8 @@ class Gisty
15
15
  class InvalidFileException < Exception
16
16
  end
17
17
 
18
- def self.extract_ids url
19
- doc = Nokogiri::HTML open(url)
18
+ def self.extract_ids str
19
+ doc = Nokogiri::HTML str
20
20
  doc.css('.file .info a').map { |i| i['href'].sub('/', '') }
21
21
  end
22
22
 
@@ -38,19 +38,28 @@ class Gisty
38
38
  FileUtils.mkdir_p @dir unless @dir.exist?
39
39
  end
40
40
 
41
- def page_num
42
- url = GIST_URL + 'mine?' + @auth_query
43
- doc = Nokogiri::HTML open(url)
44
- as = doc.css('.pagination a')
45
- (as.size < 2) ? 1 : as[as.size - 2].inner_text.to_i
41
+ def next_link str
42
+ doc = Nokogiri::HTML str
43
+ a = doc.at('.pagination a[hotkey="l"]')
44
+ a ? a['href'] : nil
46
45
  end
47
46
 
48
- def page_urls
49
- Array.new(page_num) { |i| GIST_URL + "mine?page=#{i + 1}&#{@auth_query}" }
47
+ def map_pages
48
+ result = []
49
+ base_url = GIST_URL.sub(/\/$/, '')
50
+ path = "/mine?page=1"
51
+ loop do
52
+ url = base_url + path + "&#{@auth_query}"
53
+ page = open(url).read
54
+ result << yield(url, page)
55
+ path = next_link page
56
+ break unless path
57
+ end
58
+ result
50
59
  end
51
60
 
52
61
  def remote_ids
53
- page_urls.map { |u| Gisty.extract_ids u }.flatten.uniq.sort
62
+ map_pages { |url, page| Gisty.extract_ids page }.flatten.uniq.sort
54
63
  end
55
64
 
56
65
  def clone id
@@ -11,6 +11,8 @@
11
11
  <link href="/stylesheets/gist/screen.css" media="screen" rel="stylesheet" type="text/css" />
12
12
  <link href="/stylesheets/pygment_trac.css" media="screen" rel="stylesheet" type="text/css" />
13
13
 
14
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
15
+ <script src="http://assets1.github.com/javascripts/gist.js?366981d3fa18abe465a1292caaaf4c5a5a8425e9" type="text/javascript"></script>
14
16
 
15
17
 
16
18
  </head>
@@ -38,22 +40,26 @@
38
40
 
39
41
  <div class="site">
40
42
  <div id="gist_data">
41
- <h2>Your Gists</h2>
43
+
44
+
45
+
46
+
47
+ <h2>Your Gists</h2>
42
48
 
43
- <div id="files">
44
-
49
+ <div id="files">
50
+
45
51
 
46
52
 
47
53
 
48
54
  <div class="file">
49
55
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
50
56
  <div class="info">
51
- <span><a href="/31787">gist: 31787</a></span>
57
+ <span><a href="/36121">gist: 36121</a></span>
52
58
  <span></span>
53
59
  </div>
54
60
  <div class="right">
55
61
  <span class="date">
56
- <abbr class="relatize" title="2008-12-03 16:32:34">Wed Dec 03 16:32:34 -0800 2008</abbr>
62
+ <abbr class="relatize" title="2008-12-15 14:35:38">Mon Dec 15 14:35:38 -0800 2008</abbr>
57
63
 
58
64
  </span>
59
65
  <br style="clear:both;"/>
@@ -74,7 +80,7 @@
74
80
 
75
81
 
76
82
 
77
- <div class="highlight"><pre><div class="line" id="LC1"><span class="cp">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span></div><div class="line" id="LC2"><span class="cp"> &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</span></div><div class="line" id="LC3"><span class="nt">&lt;html&gt;</span></div></pre></div>
83
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="k">@namespace</span> <span class="nt">url</span><span class="o">(</span><span class="nt">http</span><span class="o">://</span><span class="nt">www</span><span class="nc">.w3.org</span><span class="o">/</span><span class="nt">1999</span><span class="o">/</span><span class="nt">xhtml</span><span class="o">)</span><span class="p">;</span></div><div class="line" id="LC2">&nbsp;</div><div class="line" id="LC3"><span class="nt">img</span><span class="nc">.motsu</span> <span class="p">{</span></div></pre></div>
78
84
 
79
85
  </td>
80
86
  </tr>
@@ -87,14 +93,14 @@
87
93
 
88
94
 
89
95
  <div class="file">
90
- <div class="meta private inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
96
+ <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
91
97
  <div class="info">
92
- <span><a href="/bc82698ab357bd8bb433">gist: bc82698ab357bd8bb433</a></span>
98
+ <span><a href="/35857">gist: 35857</a></span>
93
99
  <span></span>
94
100
  </div>
95
101
  <div class="right">
96
102
  <span class="date">
97
- <abbr class="relatize" title="2008-11-29 15:11:52">Sat Nov 29 15:11:52 -0800 2008</abbr>
103
+ <abbr class="relatize" title="2008-12-14 19:28:59">Sun Dec 14 19:28:59 -0800 2008</abbr>
98
104
 
99
105
  </span>
100
106
  <br style="clear:both;"/>
@@ -115,7 +121,7 @@
115
121
 
116
122
 
117
123
 
118
- <div class="highlight"><pre><div class="line" id="LC1">&nbsp;_gisty () {</div><div class="line" id="LC2">_arguments '1:first:(list help post sync_delete sync version private_post)' '*:tail:_files'</div><div class="line" id="LC3">}</div></pre></div>
124
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// Tabs - jsactions script</span></div><div class="line" id="LC2"><span class="p">(</span><span class="kd">function</span><span class="p">(){</span></div><div class="line" id="LC3">&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">html_dir</span> <span class="o">=</span> <span class="s1">&#39;/Users/youhei/Desktop/tabs/&#39;</span></div></pre></div>
119
125
 
120
126
  </td>
121
127
  </tr>
@@ -130,12 +136,12 @@
130
136
  <div class="file">
131
137
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
132
138
  <div class="info">
133
- <span><a href="/30080">gist: 30080</a></span>
139
+ <span><a href="/34819">gist: 34819</a></span>
134
140
  <span></span>
135
141
  </div>
136
142
  <div class="right">
137
143
  <span class="date">
138
- <abbr class="relatize" title="2008-11-28 12:20:29">Fri Nov 28 12:20:29 -0800 2008</abbr>
144
+ <abbr class="relatize" title="2008-12-11 10:53:11">Thu Dec 11 10:53:11 -0800 2008</abbr>
139
145
 
140
146
  </span>
141
147
  <br style="clear:both;"/>
@@ -156,7 +162,7 @@
156
162
 
157
163
 
158
164
 
159
- <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// ==UserScript==</span></div><div class="line" id="LC2"><span class="c">// @name LDR - exblog filter</span></div><div class="line" id="LC3"><span class="c">// @namespace http://www.relucks.org/</span></div></pre></div>
165
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="cp">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; </span></div><div class="line" id="LC2"><span class="cp"> &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</span></div><div class="line" id="LC3"><span class="nt">&lt;html&gt;</span></div></pre></div>
160
166
 
161
167
  </td>
162
168
  </tr>
@@ -171,12 +177,12 @@
171
177
  <div class="file">
172
178
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
173
179
  <div class="info">
174
- <span><a href="/24835">gist: 24835</a></span>
180
+ <span><a href="/31787">gist: 31787</a></span>
175
181
  <span></span>
176
182
  </div>
177
183
  <div class="right">
178
184
  <span class="date">
179
- <abbr class="relatize" title="2008-11-14 01:20:53">Fri Nov 14 01:20:53 -0800 2008</abbr>
185
+ <abbr class="relatize" title="2008-12-03 16:32:34">Wed Dec 03 16:32:34 -0800 2008</abbr>
180
186
 
181
187
  </span>
182
188
  <br style="clear:both;"/>
@@ -197,7 +203,7 @@
197
203
 
198
204
 
199
205
 
200
- <div class="highlight"><pre><div class="line" id="LC1"><span class="k">@namespace</span> <span class="nt">url</span><span class="o">(</span><span class="nt">http</span><span class="o">://</span><span class="nt">www</span><span class="nc">.w3.org</span><span class="o">/</span><span class="nt">1999</span><span class="o">/</span><span class="nt">xhtml</span><span class="o">)</span><span class="p">;</span></div><div class="line" id="LC2">&nbsp;</div><div class="line" id="LC3"><span class="k">@-moz-document</span> <span class="nt">domain</span><span class="o">(</span><span class="s2">&quot;delicious.com&quot;</span><span class="o">)</span> <span class="p">{</span></div></pre></div>
206
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="cp">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span></div><div class="line" id="LC2"><span class="cp"> &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</span></div><div class="line" id="LC3"><span class="nt">&lt;html&gt;</span></div></pre></div>
201
207
 
202
208
  </td>
203
209
  </tr>
@@ -210,14 +216,14 @@
210
216
 
211
217
 
212
218
  <div class="file">
213
- <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
219
+ <div class="meta private inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
214
220
  <div class="info">
215
- <span><a href="/22851">gist: 22851</a></span>
221
+ <span><a href="/bc82698ab357bd8bb433">gist: bc82698ab357bd8bb433</a></span>
216
222
  <span></span>
217
223
  </div>
218
224
  <div class="right">
219
225
  <span class="date">
220
- <abbr class="relatize" title="2008-11-07 04:51:29">Fri Nov 07 04:51:29 -0800 2008</abbr>
226
+ <abbr class="relatize" title="2008-11-29 15:11:52">Sat Nov 29 15:11:52 -0800 2008</abbr>
221
227
 
222
228
  </span>
223
229
  <br style="clear:both;"/>
@@ -238,7 +244,7 @@
238
244
 
239
245
 
240
246
 
241
- <div class="highlight"><pre><div class="line" id="LC1">// ==UserScript==</div><div class="line" id="LC2">// @name kill typeface-js</div><div class="line" id="LC3">// @namespace http://www.relucks.org/</div></pre></div>
247
+ <div class="highlight"><pre><div class="line" id="LC1">&nbsp;_gisty () {</div><div class="line" id="LC2">_arguments '1:first:(list help post sync_delete sync version private_post)' '*:tail:_files'</div><div class="line" id="LC3">}</div></pre></div>
242
248
 
243
249
  </td>
244
250
  </tr>
@@ -253,12 +259,12 @@
253
259
  <div class="file">
254
260
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
255
261
  <div class="info">
256
- <span><a href="/21414">gist: 21414</a></span>
262
+ <span><a href="/30080">gist: 30080</a></span>
257
263
  <span></span>
258
264
  </div>
259
265
  <div class="right">
260
266
  <span class="date">
261
- <abbr class="relatize" title="2008-10-31 13:34:54">Fri Oct 31 13:34:54 -0700 2008</abbr>
267
+ <abbr class="relatize" title="2008-11-28 12:20:29">Fri Nov 28 12:20:29 -0800 2008</abbr>
262
268
 
263
269
  </span>
264
270
  <br style="clear:both;"/>
@@ -279,7 +285,7 @@
279
285
 
280
286
 
281
287
 
282
- <div class="highlight"><pre><div class="line" id="LC1"><span class="nb">require</span> <span class="s1">&#39;rubygems&#39;</span></div><div class="line" id="LC2"><span class="nb">require</span> <span class="s1">&#39;nokogiri&#39;</span></div><div class="line" id="LC3"><span class="nb">require</span> <span class="s1">&#39;open-uri&#39;</span></div></pre></div>
288
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// ==UserScript==</span></div><div class="line" id="LC2"><span class="c">// @name LDR - exblog filter</span></div><div class="line" id="LC3"><span class="c">// @namespace http://www.relucks.org/</span></div></pre></div>
283
289
 
284
290
  </td>
285
291
  </tr>
@@ -294,12 +300,12 @@
294
300
  <div class="file">
295
301
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
296
302
  <div class="info">
297
- <span><a href="/21393">gist: 21393</a></span>
303
+ <span><a href="/24835">gist: 24835</a></span>
298
304
  <span></span>
299
305
  </div>
300
306
  <div class="right">
301
307
  <span class="date">
302
- <abbr class="relatize" title="2008-10-31 11:58:09">Fri Oct 31 11:58:09 -0700 2008</abbr>
308
+ <abbr class="relatize" title="2008-11-14 01:20:53">Fri Nov 14 01:20:53 -0800 2008</abbr>
303
309
 
304
310
  </span>
305
311
  <br style="clear:both;"/>
@@ -320,7 +326,7 @@
320
326
 
321
327
 
322
328
 
323
- <div class="highlight"><pre><div class="line" id="LC1">// http://photo.ameba.jp/user/nakamura-miu/0791ba741a0105htt5o811/</div><div class="line" id="LC2">var base_dir = '/Users/youhei/Desktop/'</div><div class="line" id="LC3">main()</div></pre></div>
329
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="k">@namespace</span> <span class="nt">url</span><span class="o">(</span><span class="nt">http</span><span class="o">://</span><span class="nt">www</span><span class="nc">.w3.org</span><span class="o">/</span><span class="nt">1999</span><span class="o">/</span><span class="nt">xhtml</span><span class="o">)</span><span class="p">;</span></div><div class="line" id="LC2">&nbsp;</div><div class="line" id="LC3"><span class="k">@-moz-document</span> <span class="nt">domain</span><span class="o">(</span><span class="s2">&quot;delicious.com&quot;</span><span class="o">)</span> <span class="p">{</span></div></pre></div>
324
330
 
325
331
  </td>
326
332
  </tr>
@@ -335,12 +341,12 @@
335
341
  <div class="file">
336
342
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
337
343
  <div class="info">
338
- <span><a href="/20059">gist: 20059</a></span>
344
+ <span><a href="/22851">gist: 22851</a></span>
339
345
  <span></span>
340
346
  </div>
341
347
  <div class="right">
342
348
  <span class="date">
343
- <abbr class="relatize" title="2008-10-27 02:05:04">Mon Oct 27 02:05:04 -0700 2008</abbr>
349
+ <abbr class="relatize" title="2008-11-07 04:51:29">Fri Nov 07 04:51:29 -0800 2008</abbr>
344
350
 
345
351
  </span>
346
352
  <br style="clear:both;"/>
@@ -361,7 +367,7 @@
361
367
 
362
368
 
363
369
 
364
- <div class="highlight"><pre><div class="line" id="LC1">// ==UserScript==</div><div class="line" id="LC2">// @name twitter faceiconize</div><div class="line" id="LC3">// @namespace http://www.relucks.org/</div></pre></div>
370
+ <div class="highlight"><pre><div class="line" id="LC1">// ==UserScript==</div><div class="line" id="LC2">// @name kill typeface-js</div><div class="line" id="LC3">// @namespace http://www.relucks.org/</div></pre></div>
365
371
 
366
372
  </td>
367
373
  </tr>
@@ -376,12 +382,12 @@
376
382
  <div class="file">
377
383
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
378
384
  <div class="info">
379
- <span><a href="/19595">gist: 19595</a></span>
385
+ <span><a href="/21414">gist: 21414</a></span>
380
386
  <span></span>
381
387
  </div>
382
388
  <div class="right">
383
389
  <span class="date">
384
- <abbr class="relatize" title="2008-10-24 14:25:30">Fri Oct 24 14:25:30 -0700 2008</abbr>
390
+ <abbr class="relatize" title="2008-10-31 13:34:54">Fri Oct 31 13:34:54 -0700 2008</abbr>
385
391
 
386
392
  </span>
387
393
  <br style="clear:both;"/>
@@ -394,13 +400,15 @@
394
400
  <td>
395
401
  <pre class="line_numbers">
396
402
  <span id="LID1" rel="#L1">1</span>
403
+ <span id="LID2" rel="#L2">2</span>
404
+ <span id="LID3" rel="#L3">3</span>
397
405
  </pre>
398
406
  </td>
399
407
  <td width="100%">
400
408
 
401
409
 
402
410
 
403
- <div class="highlight"><pre><div class="line" id="LC1">gist.rb test</div></pre></div>
411
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="nb">require</span> <span class="s1">&#39;rubygems&#39;</span></div><div class="line" id="LC2"><span class="nb">require</span> <span class="s1">&#39;nokogiri&#39;</span></div><div class="line" id="LC3"><span class="nb">require</span> <span class="s1">&#39;open-uri&#39;</span></div></pre></div>
404
412
 
405
413
  </td>
406
414
  </tr>
@@ -415,12 +423,12 @@
415
423
  <div class="file">
416
424
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
417
425
  <div class="info">
418
- <span><a href="/19584">gist: 19584</a></span>
426
+ <span><a href="/21393">gist: 21393</a></span>
419
427
  <span></span>
420
428
  </div>
421
429
  <div class="right">
422
430
  <span class="date">
423
- <abbr class="relatize" title="2008-10-24 14:14:40">Fri Oct 24 14:14:40 -0700 2008</abbr>
431
+ <abbr class="relatize" title="2008-10-31 11:58:09">Fri Oct 31 11:58:09 -0700 2008</abbr>
424
432
 
425
433
  </span>
426
434
  <br style="clear:both;"/>
@@ -433,13 +441,15 @@
433
441
  <td>
434
442
  <pre class="line_numbers">
435
443
  <span id="LID1" rel="#L1">1</span>
444
+ <span id="LID2" rel="#L2">2</span>
445
+ <span id="LID3" rel="#L3">3</span>
436
446
  </pre>
437
447
  </td>
438
448
  <td width="100%">
439
449
 
440
450
 
441
451
 
442
- <div class="highlight"><pre><div class="line" id="LC1">test</div></pre></div>
452
+ <div class="highlight"><pre><div class="line" id="LC1">// http://photo.ameba.jp/user/nakamura-miu/0791ba741a0105htt5o811/</div><div class="line" id="LC2">var base_dir = '/Users/youhei/Desktop/'</div><div class="line" id="LC3">main()</div></pre></div>
443
453
 
444
454
  </td>
445
455
  </tr>
@@ -448,9 +458,11 @@
448
458
  </div>
449
459
 
450
460
 
451
- </div>
461
+ </div>
452
462
 
453
- <div class="pagination"><span class="disabled">&laquo; Previous</span> <span class="current">1</span> <a href="/mine?login=swdyh&amp;page=2&amp;token=xxx" rel="next">2</a> <a href="/mine?login=swdyh&amp;page=2&amp;token=xxx" hotkey="l" rel="next">Next &raquo;</a></div>
463
+ <div class="pagination"><span class="disabled">&laquo; Newer</span><a href="/mine?page=2" hotkey="l">Older &raquo;</a></div>
464
+
465
+
454
466
  </div> <!-- gist_data -->
455
467
 
456
468
  <div id="gist_meta" style="position: relative">
@@ -477,7 +489,7 @@
477
489
  <a href="http://github.com/contact">Contact Us</a>
478
490
  </div>
479
491
  <div class="company">
480
- <span id="_rrt" title="2.40823s from gist.github.com">It's</span>
492
+ <span id="_rrt" title="0.02595s from xc88-s00008">It's</span>
481
493
  <a href="http://logicalawesome.com/">Logical Awesome</a> | &copy;2008
482
494
  </div>
483
495
  </div>
@@ -491,5 +503,16 @@
491
503
  </div>
492
504
  </div>
493
505
 
506
+
507
+ <script type="text/javascript">
508
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
509
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
510
+ </script>
511
+ <script type="text/javascript">
512
+ var pageTracker = _gat._getTracker("UA-3769691-4");
513
+ pageTracker._initData();
514
+ pageTracker._trackPageview();
515
+ </script>
516
+
494
517
  </body>
495
518
  </html>
@@ -11,7 +11,8 @@
11
11
  <link href="/stylesheets/gist/screen.css" media="screen" rel="stylesheet" type="text/css" />
12
12
  <link href="/stylesheets/pygment_trac.css" media="screen" rel="stylesheet" type="text/css" />
13
13
 
14
- <script src="/javascripts/gist.js?257b4d1f778cfd09501997fccab322d108653b03" type="text/javascript"></script>
14
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
15
+ <script src="http://assets1.github.com/javascripts/gist.js?366981d3fa18abe465a1292caaaf4c5a5a8425e9" type="text/javascript"></script>
15
16
 
16
17
 
17
18
  </head>
@@ -39,22 +40,26 @@
39
40
 
40
41
  <div class="site">
41
42
  <div id="gist_data">
42
- <h2>Your Gists</h2>
43
+
44
+
45
+
46
+
47
+ <h2>Your Gists</h2>
43
48
 
44
- <div id="files">
45
-
49
+ <div id="files">
50
+
46
51
 
47
52
 
48
53
 
49
54
  <div class="file">
50
55
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
51
56
  <div class="info">
52
- <span><a href="/17797">gist: 17797</a></span>
57
+ <span><a href="/20059">gist: 20059</a></span>
53
58
  <span></span>
54
59
  </div>
55
60
  <div class="right">
56
61
  <span class="date">
57
- <abbr class="relatize" title="2008-10-19 01:25:21">Sun Oct 19 01:25:21 -0700 2008</abbr>
62
+ <abbr class="relatize" title="2008-10-27 02:05:04">Mon Oct 27 02:05:04 -0700 2008</abbr>
58
63
 
59
64
  </span>
60
65
  <br style="clear:both;"/>
@@ -75,7 +80,7 @@
75
80
 
76
81
 
77
82
 
78
- <div class="highlight"><pre><div class="line" id="LC1">@namespace url(http://www.w3.org/1999/xhtml);
83
+ <div class="highlight"><pre><div class="line" id="LC1">// ==UserScript==</div><div class="line" id="LC2">// @name twitter faceiconize</div><div class="line" id="LC3">// @namespace http://www.relucks.org/</div></pre></div>
79
84
 
80
85
  </td>
81
86
  </tr>
@@ -90,12 +95,12 @@
90
95
  <div class="file">
91
96
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
92
97
  <div class="info">
93
- <span><a href="/13833">gist: 13833</a></span>
98
+ <span><a href="/19595">gist: 19595</a></span>
94
99
  <span></span>
95
100
  </div>
96
101
  <div class="right">
97
102
  <span class="date">
98
- <abbr class="relatize" title="2008-09-30 07:35:57">Tue Sep 30 07:35:57 -0700 2008</abbr>
103
+ <abbr class="relatize" title="2008-10-24 14:25:30">Fri Oct 24 14:25:30 -0700 2008</abbr>
99
104
 
100
105
  </span>
101
106
  <br style="clear:both;"/>
@@ -108,15 +113,13 @@
108
113
  <td>
109
114
  <pre class="line_numbers">
110
115
  <span id="LID1" rel="#L1">1</span>
111
- <span id="LID2" rel="#L2">2</span>
112
- <span id="LID3" rel="#L3">3</span>
113
116
  </pre>
114
117
  </td>
115
118
  <td width="100%">
116
119
 
117
120
 
118
121
 
119
- <div class="highlight"><pre><div class="line" id="LC1">// ==UserScript==
122
+ <div class="highlight"><pre><div class="line" id="LC1">gist.rb test</div></pre></div>
120
123
 
121
124
  </td>
122
125
  </tr>
@@ -131,12 +134,12 @@
131
134
  <div class="file">
132
135
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
133
136
  <div class="info">
134
- <span><a href="/11863">gist: 11863</a></span>
137
+ <span><a href="/19584">gist: 19584</a></span>
135
138
  <span></span>
136
139
  </div>
137
140
  <div class="right">
138
141
  <span class="date">
139
- <abbr class="relatize" title="2008-09-21 04:58:31">Sun Sep 21 04:58:31 -0700 2008</abbr>
142
+ <abbr class="relatize" title="2008-10-24 14:14:40">Fri Oct 24 14:14:40 -0700 2008</abbr>
140
143
 
141
144
  </span>
142
145
  <br style="clear:both;"/>
@@ -149,15 +152,13 @@
149
152
  <td>
150
153
  <pre class="line_numbers">
151
154
  <span id="LID1" rel="#L1">1</span>
152
- <span id="LID2" rel="#L2">2</span>
153
- <span id="LID3" rel="#L3">3</span>
154
155
  </pre>
155
156
  </td>
156
157
  <td width="100%">
157
158
 
158
159
 
159
160
 
160
- <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// ==UserScript==</span></div><div class="line" id="LC2"><span class="c">// @name fashionsnap enlarge images</span></div><div class="line" id="LC3"><span class="c">// @namespace http://userscripts.org/users/25793</span></div></pre></div>
161
+ <div class="highlight"><pre><div class="line" id="LC1">test</div></pre></div>
161
162
 
162
163
  </td>
163
164
  </tr>
@@ -172,12 +173,12 @@
172
173
  <div class="file">
173
174
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
174
175
  <div class="info">
175
- <span><a href="/11423">gist: 11423</a></span>
176
+ <span><a href="/17797">gist: 17797</a></span>
176
177
  <span></span>
177
178
  </div>
178
179
  <div class="right">
179
180
  <span class="date">
180
- <abbr class="relatize" title="2008-09-18 04:36:58">Thu Sep 18 04:36:58 -0700 2008</abbr>
181
+ <abbr class="relatize" title="2008-10-19 01:25:21">Sun Oct 19 01:25:21 -0700 2008</abbr>
181
182
 
182
183
  </span>
183
184
  <br style="clear:both;"/>
@@ -198,7 +199,7 @@
198
199
 
199
200
 
200
201
 
201
- <div class="highlight"><pre><div class="line" id="LC1"><span class="k">@namespace</span> <span class="nt">url</span><span class="o">(</span><span class="nt">http</span><span class="o">://</span><span class="nt">www</span><span class="nc">.w3.org</span><span class="o">/</span><span class="nt">1999</span><span class="o">/</span><span class="nt">xhtml</span><span class="o">)</span><span class="p">;</span></div><div class="line" id="LC2">&nbsp;</div><div class="line" id="LC3"><span class="k">@-moz-document</span> <span class="nt">domain</span><span class="o">(</span><span class="s2">&quot;hatena.ne.jp&quot;</span><span class="o">)</span> <span class="p">{</span></div></pre></div>
202
+ <div class="highlight"><pre><div class="line" id="LC1">@namespace url(http://www.w3.org/1999/xhtml);
202
203
 
203
204
  </td>
204
205
  </tr>
@@ -213,12 +214,12 @@
213
214
  <div class="file">
214
215
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
215
216
  <div class="info">
216
- <span><a href="/11198">gist: 11198</a></span>
217
+ <span><a href="/13833">gist: 13833</a></span>
217
218
  <span></span>
218
219
  </div>
219
220
  <div class="right">
220
221
  <span class="date">
221
- <abbr class="relatize" title="2008-09-16 22:30:37">Tue Sep 16 22:30:37 -0700 2008</abbr>
222
+ <abbr class="relatize" title="2008-09-30 07:35:57">Tue Sep 30 07:35:57 -0700 2008</abbr>
222
223
 
223
224
  </span>
224
225
  <br style="clear:both;"/>
@@ -239,7 +240,7 @@
239
240
 
240
241
 
241
242
 
242
- <div class="highlight"><pre><div class="line" id="LC1">@namespace url(http://www.w3.org/1999/xhtml);
243
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// ==UserScript==</span></div><div class="line" id="LC2"><span class="c">// @name LDR - twittericon</span></div><div class="line" id="LC3"><span class="c">// @namespace http://userscripts.org/users/25793</span></div></pre></div>
243
244
 
244
245
  </td>
245
246
  </tr>
@@ -254,12 +255,12 @@
254
255
  <div class="file">
255
256
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
256
257
  <div class="info">
257
- <span><a href="/7205">gist: 7205</a></span>
258
+ <span><a href="/11863">gist: 11863</a></span>
258
259
  <span></span>
259
260
  </div>
260
261
  <div class="right">
261
262
  <span class="date">
262
- <abbr class="relatize" title="2008-08-25 21:02:27">Mon Aug 25 21:02:27 -0700 2008</abbr>
263
+ <abbr class="relatize" title="2008-09-21 04:58:31">Sun Sep 21 04:58:31 -0700 2008</abbr>
263
264
 
264
265
  </span>
265
266
  <br style="clear:both;"/>
@@ -280,7 +281,7 @@
280
281
 
281
282
 
282
283
 
283
- <div class="highlight"><pre><div class="line" id="LC1">Github T-shirts をいっしょに買って送料を節約しませんか?
284
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// ==UserScript==</span></div><div class="line" id="LC2"><span class="c">// @name fashionsnap enlarge images</span></div><div class="line" id="LC3"><span class="c">// @namespace http://userscripts.org/users/25793</span></div></pre></div>
284
285
 
285
286
  </td>
286
287
  </tr>
@@ -295,12 +296,12 @@
295
296
  <div class="file">
296
297
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
297
298
  <div class="info">
298
- <span><a href="/7204">gist: 7204</a></span>
299
+ <span><a href="/11423">gist: 11423</a></span>
299
300
  <span></span>
300
301
  </div>
301
302
  <div class="right">
302
303
  <span class="date">
303
- <abbr class="relatize" title="2008-08-25 21:01:28">Mon Aug 25 21:01:28 -0700 2008</abbr>
304
+ <abbr class="relatize" title="2008-09-18 04:36:58">Thu Sep 18 04:36:58 -0700 2008</abbr>
304
305
 
305
306
  </span>
306
307
  <br style="clear:both;"/>
@@ -312,13 +313,16 @@
312
313
  <tr>
313
314
  <td>
314
315
  <pre class="line_numbers">
316
+ <span id="LID1" rel="#L1">1</span>
317
+ <span id="LID2" rel="#L2">2</span>
318
+ <span id="LID3" rel="#L3">3</span>
315
319
  </pre>
316
320
  </td>
317
321
  <td width="100%">
318
322
 
319
323
 
320
324
 
321
- <div class="highlight"><pre></pre></div>
325
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="k">@namespace</span> <span class="nt">url</span><span class="o">(</span><span class="nt">http</span><span class="o">://</span><span class="nt">www</span><span class="nc">.w3.org</span><span class="o">/</span><span class="nt">1999</span><span class="o">/</span><span class="nt">xhtml</span><span class="o">)</span><span class="p">;</span></div><div class="line" id="LC2">&nbsp;</div><div class="line" id="LC3"><span class="k">@-moz-document</span> <span class="nt">domain</span><span class="o">(</span><span class="s2">&quot;hatena.ne.jp&quot;</span><span class="o">)</span> <span class="p">{</span></div></pre></div>
322
326
 
323
327
  </td>
324
328
  </tr>
@@ -333,12 +337,12 @@
333
337
  <div class="file">
334
338
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
335
339
  <div class="info">
336
- <span><a href="/6938">gist: 6938</a></span>
340
+ <span><a href="/11198">gist: 11198</a></span>
337
341
  <span></span>
338
342
  </div>
339
343
  <div class="right">
340
344
  <span class="date">
341
- <abbr class="relatize" title="2008-08-23 13:21:34">Sat Aug 23 13:21:34 -0700 2008</abbr>
345
+ <abbr class="relatize" title="2008-09-16 22:30:37">Tue Sep 16 22:30:37 -0700 2008</abbr>
342
346
 
343
347
  </span>
344
348
  <br style="clear:both;"/>
@@ -359,7 +363,7 @@
359
363
 
360
364
 
361
365
 
362
- <div class="highlight"><pre><div class="line" id="LC1"><span class="nb">Array</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">images</span><span class="o">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span></div><div class="line" id="LC2">&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">pa</span> <span class="o">=</span> <span class="nx">i</span><span class="p">.</span><span class="nx">parentNode</span></div><div class="line" id="LC3">&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">pa</span><span class="p">.</span><span class="nx">rel</span> <span class="o">&amp;&amp;</span> <span class="nx">pa</span><span class="p">.</span><span class="nx">rel</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="sr">/^lightbox/</span><span class="p">))</span> <span class="p">{</span></div></pre></div>
366
+ <div class="highlight"><pre><div class="line" id="LC1">@namespace url(http://www.w3.org/1999/xhtml);
363
367
 
364
368
  </td>
365
369
  </tr>
@@ -374,12 +378,12 @@
374
378
  <div class="file">
375
379
  <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
376
380
  <div class="info">
377
- <span><a href="/3668">gist: 3668</a></span>
381
+ <span><a href="/7205">gist: 7205</a></span>
378
382
  <span></span>
379
383
  </div>
380
384
  <div class="right">
381
385
  <span class="date">
382
- <abbr class="relatize" title="2008-08-01 12:15:00">Fri Aug 01 12:15:00 -0700 2008</abbr>
386
+ <abbr class="relatize" title="2008-08-25 21:02:27">Mon Aug 25 21:02:27 -0700 2008</abbr>
383
387
 
384
388
  </span>
385
389
  <br style="clear:both;"/>
@@ -400,7 +404,7 @@
400
404
 
401
405
 
402
406
 
403
- <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// jsactions script.</span></div><div class="line" id="LC2"><span class="c">// download http://www.humberthumbert.net/code/codelist.html</span></div><div class="line" id="LC3">&nbsp;</div></pre></div>
407
+ <div class="highlight"><pre><div class="line" id="LC1">Github T-shirts をいっしょに買って送料を節約しませんか?
404
408
 
405
409
  </td>
406
410
  </tr>
@@ -409,9 +413,49 @@
409
413
  </div>
410
414
 
411
415
 
416
+
417
+
418
+
419
+ <div class="file">
420
+ <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
421
+ <div class="info">
422
+ <span><a href="/7204">gist: 7204</a></span>
423
+ <span></span>
424
+ </div>
425
+ <div class="right">
426
+ <span class="date">
427
+ <abbr class="relatize" title="2008-08-25 21:01:28">Mon Aug 25 21:01:28 -0700 2008</abbr>
428
+
429
+ </span>
430
+ <br style="clear:both;"/>
431
+ </div>
432
+ </div>
433
+ <div class="data syntax">
434
+
435
+ <table cellpadding="0" cellspacing="0">
436
+ <tr>
437
+ <td>
438
+ <pre class="line_numbers">
439
+ </pre>
440
+ </td>
441
+ <td width="100%">
442
+
443
+
444
+
445
+ <div class="highlight"><pre></pre></div>
446
+
447
+ </td>
448
+ </tr>
449
+ </table>
450
+ </div>
412
451
  </div>
413
452
 
414
- <div class="pagination"><a href="/mine?login=swdyh&amp;page=1&amp;token=xxx" hotkey="h" rel="prev start">&laquo; Previous</a> <a href="/mine?login=swdyh&amp;page=1&amp;token=xxx" rel="prev start">1</a> <span class="current">2</span> <span class="disabled">Next &raquo;</span></div>
453
+
454
+ </div>
455
+
456
+ <div class="pagination"><a href="/mine?page=1" hotkey="h">&laquo; Newer</a><a href="/mine?page=3" hotkey="l">Older &raquo;</a></div>
457
+
458
+
415
459
  </div> <!-- gist_data -->
416
460
 
417
461
  <div id="gist_meta" style="position: relative">
@@ -438,7 +482,7 @@
438
482
  <a href="http://github.com/contact">Contact Us</a>
439
483
  </div>
440
484
  <div class="company">
441
- <span id="_rrt" title="2.62655s from gist.github.com">It's</span>
485
+ <span id="_rrt" title="0.02048s from xc88-s00011">It's</span>
442
486
  <a href="http://logicalawesome.com/">Logical Awesome</a> | &copy;2008
443
487
  </div>
444
488
  </div>
@@ -451,5 +495,17 @@
451
495
 
452
496
  </div>
453
497
  </div>
498
+
499
+
500
+ <script type="text/javascript">
501
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
502
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
503
+ </script>
504
+ <script type="text/javascript">
505
+ var pageTracker = _gat._getTracker("UA-3769691-4");
506
+ pageTracker._initData();
507
+ pageTracker._trackPageview();
508
+ </script>
509
+
454
510
  </body>
455
511
  </html>
@@ -0,0 +1,190 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
+
8
+ <title>Gist &mdash; GitHub</title>
9
+
10
+ <link href="/stylesheets/facebox.css" media="screen" rel="stylesheet" type="text/css" />
11
+ <link href="/stylesheets/gist/screen.css" media="screen" rel="stylesheet" type="text/css" />
12
+ <link href="/stylesheets/pygment_trac.css" media="screen" rel="stylesheet" type="text/css" />
13
+
14
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
15
+ <script src="http://assets1.github.com/javascripts/gist.js?366981d3fa18abe465a1292caaaf4c5a5a8425e9" type="text/javascript"></script>
16
+
17
+
18
+ </head>
19
+
20
+ <body>
21
+ <div id="main">
22
+ <div id="header" class="">
23
+ <div class="site">
24
+ <div class="logo">
25
+ <a href="/"><img src="/images/modules/header/logo_gist.png" alt="git-hub" /></a>
26
+ </div>
27
+
28
+ <div class="actions">
29
+ <a href="/mine"><img alt="" class="gravatar" height="20" src="http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&amp;d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png" width="20" /></a>
30
+ &nbsp;
31
+ <span><a href="/mine">swdyh</a></span>
32
+ <a href="/">New</a>
33
+ <a href="/gists">All Gists</a>
34
+ <a href="/logout">Log out</a>
35
+ </div>
36
+
37
+
38
+ </div>
39
+ </div>
40
+
41
+ <div class="site">
42
+ <div id="gist_data">
43
+
44
+
45
+
46
+
47
+ <h2>Your Gists</h2>
48
+
49
+ <div id="files">
50
+
51
+
52
+
53
+
54
+ <div class="file">
55
+ <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
56
+ <div class="info">
57
+ <span><a href="/6938">gist: 6938</a></span>
58
+ <span></span>
59
+ </div>
60
+ <div class="right">
61
+ <span class="date">
62
+ <abbr class="relatize" title="2008-08-23 13:21:34">Sat Aug 23 13:21:34 -0700 2008</abbr>
63
+
64
+ </span>
65
+ <br style="clear:both;"/>
66
+ </div>
67
+ </div>
68
+ <div class="data syntax">
69
+
70
+ <table cellpadding="0" cellspacing="0">
71
+ <tr>
72
+ <td>
73
+ <pre class="line_numbers">
74
+ <span id="LID1" rel="#L1">1</span>
75
+ <span id="LID2" rel="#L2">2</span>
76
+ <span id="LID3" rel="#L3">3</span>
77
+ </pre>
78
+ </td>
79
+ <td width="100%">
80
+
81
+
82
+
83
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="nb">Array</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">images</span><span class="o">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span></div><div class="line" id="LC2">&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">var</span> <span class="nx">pa</span> <span class="o">=</span> <span class="nx">i</span><span class="p">.</span><span class="nx">parentNode</span></div><div class="line" id="LC3">&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="p">(</span><span class="nx">pa</span><span class="p">.</span><span class="nx">rel</span> <span class="o">&amp;&amp;</span> <span class="nx">pa</span><span class="p">.</span><span class="nx">rel</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="sr">/^lightbox/</span><span class="p">))</span> <span class="p">{</span></div></pre></div>
84
+
85
+ </td>
86
+ </tr>
87
+ </table>
88
+ </div>
89
+ </div>
90
+
91
+
92
+
93
+
94
+
95
+ <div class="file">
96
+ <div class="meta public inline-gravatar" style="padding-right:45px; background:#eaeaea url('http://www.gravatar.com/avatar/465e43442fc3604b4a7ad9c55bc52066?s=20&d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-20.png') no-repeat scroll 98.5% 50%;">
97
+ <div class="info">
98
+ <span><a href="/3668">gist: 3668</a></span>
99
+ <span></span>
100
+ </div>
101
+ <div class="right">
102
+ <span class="date">
103
+ <abbr class="relatize" title="2008-08-01 12:15:00">Fri Aug 01 12:15:00 -0700 2008</abbr>
104
+
105
+ </span>
106
+ <br style="clear:both;"/>
107
+ </div>
108
+ </div>
109
+ <div class="data syntax">
110
+
111
+ <table cellpadding="0" cellspacing="0">
112
+ <tr>
113
+ <td>
114
+ <pre class="line_numbers">
115
+ <span id="LID1" rel="#L1">1</span>
116
+ <span id="LID2" rel="#L2">2</span>
117
+ <span id="LID3" rel="#L3">3</span>
118
+ </pre>
119
+ </td>
120
+ <td width="100%">
121
+
122
+
123
+
124
+ <div class="highlight"><pre><div class="line" id="LC1"><span class="c">// jsactions script.</span></div><div class="line" id="LC2"><span class="c">// download http://www.humberthumbert.net/code/codelist.html</span></div><div class="line" id="LC3">&nbsp;</div></pre></div>
125
+
126
+ </td>
127
+ </tr>
128
+ </table>
129
+ </div>
130
+ </div>
131
+
132
+
133
+ </div>
134
+
135
+ <div class="pagination"><a href="/mine?page=2" hotkey="h">&laquo; Newer</a><span class="disabled">Older &raquo;</span></div>
136
+
137
+
138
+ </div> <!-- gist_data -->
139
+
140
+ <div id="gist_meta" style="position: relative">
141
+
142
+ </div> <!-- gist_meta -->
143
+
144
+ </div> <!-- site -->
145
+
146
+ <div class="push"></div>
147
+
148
+ </div>
149
+
150
+ <div id="footer">
151
+ <div class="site">
152
+ <div class="info">
153
+ <div style="float: left; margin-right: 2em; margin-top: -.6em;">
154
+ <a href="http://github.com/">
155
+ <img src="/images/modules/header/logo_white.png" alt="GitHub" />
156
+ </a>
157
+ </div>
158
+ <div class="links" style="float: left; width: 18em;">
159
+ <a href="http://github.com/blog"><strong>The Github Blog</strong></a> |
160
+ <a href="http://support.github.com/">Support</a> |
161
+ <a href="http://github.com/contact">Contact Us</a>
162
+ </div>
163
+ <div class="company">
164
+ <span id="_rrt" title="0.01447s from xc88-s00008">It's</span>
165
+ <a href="http://logicalawesome.com/">Logical Awesome</a> | &copy;2008
166
+ </div>
167
+ </div>
168
+ <div class="sponsor">
169
+ <a href="http://engineyard.com">Hosting provided by</a>&nbsp;
170
+ <a href="http://engineyard.com">
171
+ <img src="/images/modules/footer/engine_yard_logo.gif" alt="Hosted by Engine Yard" />
172
+ </a>
173
+ </div>
174
+
175
+ </div>
176
+ </div>
177
+
178
+
179
+ <script type="text/javascript">
180
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
181
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
182
+ </script>
183
+ <script type="text/javascript">
184
+ var pageTracker = _gat._getTracker("UA-3769691-4");
185
+ pageTracker._initData();
186
+ pageTracker._trackPageview();
187
+ </script>
188
+
189
+ </body>
190
+ </html>
data/test/gisty_test.rb CHANGED
@@ -19,12 +19,17 @@ class GistyTest < Test::Unit::TestCase
19
19
 
20
20
  def stub_open_uri!
21
21
  stub(OpenURI).open_uri do |uri|
22
- filename = uri.to_s.split('/').last.gsub(/[&?=]/, '_')
23
- path = File.join File.dirname(__FILE__), 'fixtures', filename
24
- open path
22
+ path = url2fixture uri
23
+ # puts "stub open_uri: #{uri} -> #{path}"
24
+ open url2fixture(uri)
25
25
  end
26
26
  end
27
27
 
28
+ def url2fixture url
29
+ filename = url.to_s.split('/').last.gsub(/[&?=]/, '_')
30
+ File.join File.dirname(__FILE__), 'fixtures', filename
31
+ end
32
+
28
33
  def stub_kernel_system!
29
34
  stub(Kernel).system do |cmd|
30
35
  # puts "* '#{cmd}' *"
@@ -45,8 +50,8 @@ class GistyTest < Test::Unit::TestCase
45
50
  end
46
51
 
47
52
  def test_extract_ids
48
- url = 'http://gist.github.com/swdyh?page=4'
49
- ids = Gisty.extract_ids url
53
+ path = File.join 'test', 'fixtures', 'swdyh_page_4'
54
+ ids = Gisty.extract_ids IO.read(path)
50
55
  assert ids.include?("6938")
51
56
  assert ids.include?("3668")
52
57
  end
@@ -61,21 +66,27 @@ class GistyTest < Test::Unit::TestCase
61
66
  assert_instance_of Gisty, @gisty
62
67
  end
63
68
 
64
- def test_page_num
65
- assert_equal 2, @gisty.page_num
69
+ def test_next_link
70
+ path1 = url2fixture('http://gist.github.com/mine?page=1&login=foo&token=bar')
71
+ path2 = url2fixture('http://gist.github.com/mine?page=2&login=foo&token=bar')
72
+ path3 = url2fixture('http://gist.github.com/mine?page=3&login=foo&token=bar')
73
+ assert_equal '/mine?page=2', @gisty.next_link(IO.read(path1))
74
+ assert_equal '/mine?page=3', @gisty.next_link(IO.read(path2))
75
+ assert_nil @gisty.next_link(IO.read(path3))
66
76
  end
67
77
 
68
- def test_page_urls
69
- urls = @gisty.page_urls
70
- assert_equal 2, urls.size
71
- assert urls.all? { |u| u.match(/page=\d/) }
78
+ def test_map_page_urls
79
+ mapped = @gisty.map_pages do |url, page|
80
+ assert url.match(/page=\d/)
81
+ end
82
+ assert_equal 3, mapped.size
72
83
  end
73
84
 
74
85
  def test_remote_ids
75
86
  ids = @gisty.remote_ids
76
- assert_equal 19, ids.size
77
- assert ids.include?('7205')
78
- assert ids.include?('bc82698ab357bd8bb433')
87
+ # assert_equal 20, ids.size
88
+ # assert ids.include?('7205')
89
+ # assert ids.include?('bc82698ab357bd8bb433')
79
90
  end
80
91
 
81
92
  def test_clone
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swdyh-gisty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - swdyh
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-07 00:00:00 -08:00
12
+ date: 2009-01-02 00:00:00 -08:00
13
13
  default_executable: gisty
14
14
  dependencies: []
15
15
 
@@ -33,6 +33,7 @@ files:
33
33
  - test/fixtures/mine_login_foo_token_bar
34
34
  - test/fixtures/mine_page_1_login_foo_token_bar
35
35
  - test/fixtures/mine_page_2_login_foo_token_bar
36
+ - test/fixtures/mine_page_3_login_foo_token_bar
36
37
  - test/fixtures/swdyh
37
38
  - test/fixtures/swdyh_page_4
38
39
  - test/gisty_test.rb