flickru 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/geowiki CHANGED
@@ -61,7 +61,7 @@ curl "http://en.wikipedia.org/wiki/$PAGE" -o "$TMP" 2> /dev/null
61
61
  clean_up 1
62
62
  fi
63
63
 
64
- URL=`cat "$TMP" | tr '"' '\n' | grep geohack | head -n 1 | sed -e 's|&|\&|'`
64
+ URL=`cat "$TMP" | tr '"' '\n' | grep geohack | head -n 1 | sed -e 's|^//||' -e 's|&|\&|'`
65
65
 
66
66
  if [ -z "$URL" ]; then
67
67
  error $LINENO "location not found in Wikipedia page '$PAGE'"
@@ -49,7 +49,7 @@ class Location
49
49
  private
50
50
 
51
51
  def Location.parse location
52
- # TODO special characters MAY be escaped
52
+ # TODO special characters MAY be escaped
53
53
  idx_accuracy = location.index('#') ? location.index('#') : location.length
54
54
  idx_place = location.index('@') ? location.index('@') : idx_accuracy
55
55
 
@@ -61,7 +61,7 @@ private
61
61
  end
62
62
 
63
63
  def Location.locate place
64
- the_place = place # needed for RuntimeError reporting
64
+ the_place = place # needed for RuntimeError reporting
65
65
  begin
66
66
  place = Location.geowiki place \
67
67
  if place !~ /^#{COORD_PATTERN}, *#{COORD_PATTERN}$/
@@ -100,9 +100,9 @@ private
100
100
 
101
101
  def Location.geowiki place
102
102
  wiki = open("http://en.wikipedia.org/wiki/#{place}").read
103
- geo = open(wiki.tr("\"", "\n").split("\n").grep(/geohack/)
104
- .first.sub('&','&')).read \
105
- .split("\n").grep(/<span class="geo"/).first
103
+ tool = open(wiki.tr("\"", "\n").split("\n").grep(/geohack/) \
104
+ .first.sub(/^\/\//,'http://').sub('&amp;','&')).read
105
+ geo = tool.split("\n").grep(/<span class="geo"/).first
106
106
  latitude = geo.sub(/^.*"Latitude">/, '').sub(/<\/span>, .*/, '')
107
107
  longitude = geo.sub(/.*"Longitude">/, '').sub(/<\/span>.*$/, '')
108
108
  latitude + ", " + longitude
@@ -1,5 +1,5 @@
1
1
  module Flickru
2
2
  unless defined? VERSION
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: flickru
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jesus Pardillo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-15 00:00:00 Z
13
+ date: 2013-05-02 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 1.0.21
23
+ version: 1.3.5
24
24
  type: :runtime
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency