myweatherfeed 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/myweatherfeed.rb +14 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5da3fd08e1c0d6dcaa01a9f55711661779c0bd0
|
4
|
+
data.tar.gz: a70ba60de0d2f4139459bb38e2732ee63726c61b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eef81f2587ade2c8c074a8a9480cb85b4b01c95f71f353b524728a181800a4318194b5414e96ad20f69c881de5425b1f520025514d8923ef32275455a80720b9
|
7
|
+
data.tar.gz: 4930cdbc269cfbf6096f9c4de31b2cf2a98eac34bc9b85ed562f8b8689ce7443c442e553a1973ab864359a1b93208358328892bb94127b911d3d92f484f3efd3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/myweatherfeed.rb
CHANGED
@@ -24,7 +24,7 @@ class MyWeatherFeed < DailyNotices
|
|
24
24
|
# set the time last updated in the hidden scratch file if refreshrate set
|
25
25
|
|
26
26
|
@datafile = File.join(@filepath, '.myweatherfeed')
|
27
|
-
@refreshrate = refreshrate
|
27
|
+
@refreshrate = refreshrate.to_i
|
28
28
|
|
29
29
|
if refreshrate then
|
30
30
|
|
@@ -33,6 +33,10 @@ class MyWeatherFeed < DailyNotices
|
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
36
|
+
|
37
|
+
def start()
|
38
|
+
loop { self.update; sleep(@refreshrate * 60) }
|
39
|
+
end
|
36
40
|
|
37
41
|
def update()
|
38
42
|
|
@@ -44,6 +48,7 @@ class MyWeatherFeed < DailyNotices
|
|
44
48
|
return if notice == @h[:notice]
|
45
49
|
|
46
50
|
self.add notice, uid: Time.now.strftime('%H%M')
|
51
|
+
on_change(w.now)
|
47
52
|
|
48
53
|
if @refreshrate then
|
49
54
|
|
@@ -54,4 +59,12 @@ class MyWeatherFeed < DailyNotices
|
|
54
59
|
|
55
60
|
end
|
56
61
|
|
62
|
+
# override this method for your own custom notifier, callback, or webhook etc.
|
63
|
+
#
|
64
|
+
def on_change(now)
|
65
|
+
|
66
|
+
yield(now)
|
67
|
+
|
68
|
+
end
|
69
|
+
|
57
70
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|