boston-stitch 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/boston-stitch +26 -0
  2. metadata +26 -10
@@ -36,6 +36,32 @@ def process(url)
36
36
  next: nexturl }
37
37
  end
38
38
 
39
+
40
+ if ARGV[0] =~ /^g/
41
+ html = open("http://boston.com").read
42
+ doc = Nokogiri::HTML html
43
+ puts "Getting galleries on boston.com home page"
44
+ links = []
45
+ doc.search("a").select {|x| x[:href] =~ %r{/gallery/}}.each_with_index do |a, i|
46
+ title = a.inner_text.strip.gsub(/\s{2,}/, ' ')
47
+ if title !~ /\w/
48
+ title = a[:href]
49
+ end
50
+ links << [a[:href], title]
51
+ puts "#{i + 1} %s" % title
52
+ end
53
+ print "Your choice: "
54
+ n = STDIN.gets.chomp
55
+ unless n =~ /\d/
56
+ puts "Goodbye"
57
+ exit
58
+ end
59
+ href, title = links[n.to_i - 1]
60
+ puts "Getting \"#{title}\""
61
+ ARGV.unshift href
62
+ end
63
+
64
+
39
65
  start_url = ARGV.first
40
66
 
41
67
  if start_url.nil? || start_url !~ /^http/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boston-stitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-29 00:00:00.000000000Z
12
+ date: 2012-04-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: haml
16
- requirement: &14543400 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *14543400
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: nokogiri
27
- requirement: &14540900 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *14540900
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: sinatra
38
- requirement: &14521120 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,7 +53,12 @@ dependencies:
43
53
  version: '0'
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *14521120
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  description: Stitch together all the pages of a Boston.com gallery
48
63
  email:
49
64
  - dhchoi@gmail.com
@@ -52,7 +67,8 @@ executables:
52
67
  extensions: []
53
68
  extra_rdoc_files: []
54
69
  files:
55
- - bin/boston-stitch
70
+ - !binary |-
71
+ YmluL2Jvc3Rvbi1zdGl0Y2g=
56
72
  homepage: http://github.com/danchoi/boston-stitch
57
73
  licenses: []
58
74
  post_install_message:
@@ -73,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
89
  version: '0'
74
90
  requirements: []
75
91
  rubyforge_project: boston-stitch
76
- rubygems_version: 1.8.10
92
+ rubygems_version: 1.8.19
77
93
  signing_key:
78
94
  specification_version: 3
79
95
  summary: Stitch together all the pages of a Boston.com gallery