fc-reminder 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5ce7bf3d6d953a9e54908ae34a2bd2396baf817
4
- data.tar.gz: bcdc3d656757ae1435d8d0ffe91ef6994727cc0b
3
+ metadata.gz: 46f8b9493f347fb82cd5b4c1b564fae30bf9dec2
4
+ data.tar.gz: 99d6eba3ca72a76bb1ad00f25dee554955a9e564
5
5
  SHA512:
6
- metadata.gz: 534d323b3629151c2f241ce61db8bd44df904192f587023dfcbf654f23f3fb21a7eafc872ebefb77a808ab4813e83039c0996e409ea40c4c17c0a6fe2c8ead6d
7
- data.tar.gz: 41f6f401684ace0fae51de6e0aa4b7bb53cb188a9293447cbc481e26dd9c88f86a246db0d4962c80d13b752de5c8d3ea86c198241710008abe38c2d4571c3992
6
+ metadata.gz: 2df74391defed1413c731f4f43119ecf6bff31b602e4ca94a9e749f0df1848fc028630df1d4364a6a30f188717e4c107fd92fd74c27fe10244a9bb76b6aa7304
7
+ data.tar.gz: 0a2af39818d43b8c228ee91abf1779156887a8c15ff829cfda93f3830adcaf246d4c707ae5d1b735a6e86a19fe61e1e12ce57344862630ba93efbc09fde45f67
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.0-preview1
data/README.md CHANGED
@@ -1,7 +1,74 @@
1
1
  fc-reminder
2
2
  ===========
3
3
 
4
- Football Continuous Reminder
4
+ [![Build Status](https://travis-ci.org/kiela/fc-reminder.png)](https://travis-ci.org/kiela/fc-reminder)
5
+ [![Code Climate](https://codeclimate.com/github/kiela/fc-reminder.png)](https://codeclimate.com/github/kiela/fc-reminder)
6
+
7
+ Have you ever had a situation in which you forgot about an upcoming football match? Or any other match? Or event? Unfortunately me too.. That's why I created Football Continous Reminder - a standalone application which uses [Twilio](https://www.twilio.com/) to sent you a reminder SMS with a date of the next match of your favourite team!
8
+
9
+ ## Instalation
10
+
11
+ As usual:
12
+
13
+ $ gem install fc-reminder
14
+
15
+ ## Usage
16
+
17
+ Before using the gem, you need to create an account on [Twilio](https://www.twilio.com/) and set system variables:
18
+
19
+ ``` console
20
+ TWILIO_ACCOUNT_SID=<account_sid>
21
+ TWILIO_AUTH_TOKEN=<auth_token>
22
+ TWILIO_PHONE_NUMBER=<phone_number>
23
+ ```
24
+
25
+ After installing the fc-reminder gem, you should be able to start it by simply running `fc-reminder` on the command line.
26
+
27
+ $ fc-reminder [options] start|stop|restart|run
28
+
29
+ ### One start
30
+
31
+ If you want just check how it works type:
32
+
33
+ $ fc-reminder -t Barcelona -r +1234567890 start
34
+
35
+ In order to stop application, just hit `CTRL + C`
36
+
37
+ ### Daemon mode
38
+
39
+ However, if you like how it works and want to use it for some time, type:
40
+
41
+ $ fc-reminder -t Barcelona -r +1234567890 -c 15:00 -D -l start
42
+
43
+ It starts fc-reminder as a `daemon` which exactly at `15:00` every day checks if `Barcelona` plays any match that day, sends SMS to `+1234567890` if yes and log everything to `~/fcreminder/log`
44
+
45
+ If you are tired of being informed all the time (or just do not like that team any more), just type:
46
+
47
+ $ fc-reminder -t Barcelona stop
48
+
49
+ ## Options
50
+
51
+ fc-reminder takes a number of options:
52
+
53
+ ``` console
54
+ Usage: fc-reminder [options] start|stop|restart|run
55
+ -t, --team STRING Team name (required)
56
+ -r, --recipient STRING Recipient data (required)
57
+ -c, --check HH:MM Time at which presence of a match will be checked (default: 12:00)
58
+ -D, --daemon Daemonize process (default: false)
59
+ -d, --dir DIR Directory to change to once the process starts (default: ~/fcreminder)
60
+ -i, --identifier STRING An identifier for the process (default: value of --team)
61
+ -l, --log Redirect both STDOUT and STDERR to a logfile named FCReminder.<team>.output in the directory defined in --log-dir (default: false)
62
+ --log-dir DIR A specific directory to put the log files into (default: ~/fcreminder/log
63
+ -m, --monitor Start monitor process (default: false)
64
+
65
+ ```
66
+
67
+ ## TODO
68
+
69
+ * Add ability to config fc-reminder by using ~/.fc-reminder.conf or any other file
70
+ * Add more providers (sites from which scores can be fetched)
71
+ * Add ability to "send snitch" which will be sending SMS after a starting or finishing match/scoring gol/getting card in real time
5
72
 
6
73
  ## Copyright and License
7
74
 
@@ -3,7 +3,7 @@ module FCReminder
3
3
  class Base
4
4
  attr_accessor :config
5
5
 
6
- def send(recipient:, data:)
6
+ def send(recipient: _, data: _)
7
7
  end
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ require 'twilio-ruby'
3
3
  module FCReminder
4
4
  module Gateways
5
5
  class Twilio < Base
6
- def send(recipient:, data:)
6
+ def send(recipient: recipient, data: data)
7
7
  client = ::Twilio::REST::Client.new(
8
8
  config[:account_sid],
9
9
  config[:auth_token]
@@ -15,7 +15,7 @@ module FCReminder
15
15
  ""
16
16
  end
17
17
 
18
- def run(team_name:)
18
+ def run(team_name: _)
19
19
  Hash.new
20
20
  end
21
21
  end
@@ -7,14 +7,14 @@ module FCReminder
7
7
  "#{BASE_URL}/soccer/#{Time.now.strftime("%Y-%m-%d")}"
8
8
  end
9
9
 
10
- def run(team_name:)
10
+ def run(team_name: team_name)
11
11
  cell = search(page: client.get(url), team_name: team_name.downcase)
12
12
  cell.nil? ? super : prepare_output_from(cell)
13
13
  end
14
14
 
15
15
  private
16
16
 
17
- def search(page:, team_name:)
17
+ def search(page: page, team_name: team_name)
18
18
  page.search(".content table.league-table td").find do |td|
19
19
  has_team?(td) and team_match?(td, team_name)
20
20
  end
@@ -35,7 +35,7 @@ module FCReminder
35
35
  r
36
36
  end
37
37
 
38
- def fetch(attrs:, source:)
38
+ def fetch(attrs: attrs, source: source)
39
39
  attrs.inject({}) { |h,(k,v)| h[k] = source.search(v).text.strip; h }
40
40
  end
41
41
 
@@ -1,3 +1,3 @@
1
1
  module FCReminder
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fc-reminder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kamil Kieliszczyk
@@ -14,126 +14,126 @@ dependencies:
14
14
  name: mechanize
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 2.7.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.7.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: twilio-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 3.11.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 3.11.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mixlib-cli
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.3.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: daemons
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: 1.1.9
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.1.9
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: clockwork
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.7.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.7.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '1.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.3'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: 3.0.0.beta1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
124
  version: 3.0.0.beta1
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: fakeweb
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ">="
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  description: Simple reminder about an upcoming football game
@@ -144,8 +144,9 @@ executables:
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
- - ".gitignore"
148
- - ".rspec"
147
+ - .gitignore
148
+ - .rspec
149
+ - .travis.yml
149
150
  - Gemfile
150
151
  - LICENSE
151
152
  - README.md
@@ -181,12 +182,12 @@ require_paths:
181
182
  - lib
182
183
  required_ruby_version: !ruby/object:Gem::Requirement
183
184
  requirements:
184
- - - ">="
185
+ - - '>='
185
186
  - !ruby/object:Gem::Version
186
187
  version: '0'
187
188
  required_rubygems_version: !ruby/object:Gem::Requirement
188
189
  requirements:
189
- - - ">="
190
+ - - '>='
190
191
  - !ruby/object:Gem::Version
191
192
  version: 1.3.6
192
193
  requirements: []