flickru 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/geowiki +10 -10
  3. data/lib/flickru/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c641eabc69a8f6f0468787ccced844d1d7187ba4
4
- data.tar.gz: 5e323694a178ed962a97985fe59ed7f850c8d12f
3
+ metadata.gz: 6a232ff981265c75b9600596b486f6df9b14cb66
4
+ data.tar.gz: f44447d52df46409e781cac65f242ed53a6876f0
5
5
  SHA512:
6
- metadata.gz: c9326f96f99f3c9c7d5edd3eaeb0d13e90270f9c9f713142036454790e7f5c7187dc3a78da66dbf50eddf7bede4a50f5eba8840efac820348443ce6a6217623f
7
- data.tar.gz: 74b88a1f3d6b6defb0989670de53f26c0135b872c5b8da02f29f91a49603ca82bdc16394cd8d4470b8b63da3acb2b64de837f99151dc74e34ba680aa0b0158a5
6
+ metadata.gz: 2da1b2b790679d03aff92a3518fc5725faa891194d85982f74d61345028db19b546a9322cdcee5aeb5474a666eec0dc5b5aa8ab80fd93ec6e7ec1d40924549e0
7
+ data.tar.gz: '049ebfd5474fe867f865a6fabb0c175f2ba7e9ab1fcb86cc75ff8088dbf67cba95f2b84ab4aa116c9112493f450821754b6c3d4e7240c89d5fc18d2aab73bbf5'
@@ -11,13 +11,13 @@ PAGE=`echo "$1" | tr ' ' '_'`
11
11
  # Functions #
12
12
  #############
13
13
 
14
- function usage {
14
+ function usage() {
15
15
  echo "$APP_NAME - find coordinates of a place described by Wikipedia"
16
16
  echo "usage: $APP_NAME <place Wikipedia page>"
17
17
  echo "example: $APP_NAME 'Mille-Isles, Quebec'"
18
18
  }
19
19
 
20
- function error {
20
+ function error() {
21
21
  echo -e "\033[31m$APP_NAME:$1: $2\033[0m" 1>&2
22
22
  }
23
23
 
@@ -25,10 +25,10 @@ function error {
25
25
  # Preconditions #
26
26
  #################
27
27
 
28
- if [ "$1" == "-h" -o "$1" == "--help" ]; then
28
+ if [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
29
29
  usage
30
30
  exit
31
- elif [ $# -ne 1 ]; then
31
+ elif [[ $# -ne 1 ]]; then
32
32
  usage
33
33
  error $LINENO "wrong number of arguments"
34
34
  exit 1
@@ -39,12 +39,12 @@ fi
39
39
  #########
40
40
 
41
41
  # temporal file management
42
- if [ -d /tmp ]; then
42
+ if [[ -d /tmp ]]; then
43
43
  TMP="/tmp/$PAGE.tmp.$$.$RANDOM.html"
44
44
  else
45
45
  TMP="$PAGE.tmp.html"
46
46
  fi
47
- function clean_up {
47
+ function clean_up() {
48
48
  rm -f "$TMP"
49
49
  exit $1
50
50
  }
@@ -54,23 +54,23 @@ trap clean_up SIGHUP SIGINT SIGTERM
54
54
  # Main #
55
55
  ########
56
56
 
57
- curl "http://en.wikipedia.org/wiki/$PAGE" -o "$TMP" 2> /dev/null
57
+ wget -o /dev/null -O "$TMP" "http://en.wikipedia.org/wiki/$PAGE"
58
58
 
59
- if [ $? -ne 0 ]; then
59
+ if [[ $? -ne 0 ]]; then
60
60
  error $LINENO "Wikipedia page '$PAGE' not found"
61
61
  clean_up 1
62
62
  fi
63
63
 
64
64
  URL=`cat "$TMP" | tr '"' '\n' | grep geohack | head -n 1 | sed -e 's|^//||' -e 's|&amp;|\&|'`
65
65
 
66
- if [ -z "$URL" ]; then
66
+ if [[ -z "$URL" ]]; then
67
67
  error $LINENO "location not found in Wikipedia page '$PAGE'"
68
68
  clean_up 1
69
69
  fi
70
70
 
71
71
  curl "$URL" -o "$TMP" 2> /dev/null
72
72
 
73
- if [ $? -ne 0 ]; then
73
+ if [[ $? -ne 0 ]]; then
74
74
  error $LINENO "GeoHack URL '$URL' not found"
75
75
  clean_up 1
76
76
  fi
@@ -1,5 +1,5 @@
1
1
  module Flickru
2
2
  unless defined? VERSION
3
- VERSION = "0.4.3"
3
+ VERSION = "0.4.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesus Pardillo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2016-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler