flickru 0.4.3 → 0.4.4
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.
- checksums.yaml +4 -4
- data/bin/geowiki +10 -10
- data/lib/flickru/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a232ff981265c75b9600596b486f6df9b14cb66
|
4
|
+
data.tar.gz: f44447d52df46409e781cac65f242ed53a6876f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2da1b2b790679d03aff92a3518fc5725faa891194d85982f74d61345028db19b546a9322cdcee5aeb5474a666eec0dc5b5aa8ab80fd93ec6e7ec1d40924549e0
|
7
|
+
data.tar.gz: '049ebfd5474fe867f865a6fabb0c175f2ba7e9ab1fcb86cc75ff8088dbf67cba95f2b84ab4aa116c9112493f450821754b6c3d4e7240c89d5fc18d2aab73bbf5'
|
data/bin/geowiki
CHANGED
@@ -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"
|
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
|
-
|
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|&|\&|'`
|
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
|
data/lib/flickru/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|