@@ -49,41 +49,6 @@ func notifyTelegram(message string) {
49
49
log .Print ("Telegram notified" )
50
50
}
51
51
52
- /*
53
- # Line Notify
54
-
55
- Parameters:
56
- - message
57
-
58
- Environment variables:
59
- - NOTIFY_LINE_NOTIFY_TOKEN
60
- */
61
- func notifyLineNotify (message string ) {
62
- // Load environment variables
63
- lineNotifyToken , ok := os .LookupEnv ("NOTIFY_LINE_NOTIFY_TOKEN" )
64
- if ! ok {
65
- log .Fatal ("NOTIFY_LINE_NOTIFY_TOKEN environment variable is unset" )
66
- }
67
-
68
- endpoint := "https://notify-api.line.me/api/notify"
69
- data := url.Values {"message" : {message }}
70
- body := strings .NewReader (data .Encode ())
71
-
72
- req , err := http .NewRequest ("POST" , endpoint , body )
73
- req .Header .Set ("Content-Type" , "application/x-www-form-urlencoded" )
74
- req .Header .Set ("Authorization" , fmt .Sprintf ("Bearer %s" , lineNotifyToken ))
75
-
76
- client := & http.Client {}
77
- resp , err := client .Do (req )
78
- if err != nil {
79
- panic (err )
80
- }
81
- defer resp .Body .Close ()
82
-
83
- ioutil .ReadAll (resp .Body )
84
- log .Print ("Line Notify notified" )
85
- }
86
-
87
52
/*
88
53
# Hangouts Chat
89
54
@@ -185,9 +150,6 @@ func main() {
185
150
telegramCmd := flag .NewFlagSet ("telegram" , flag .ExitOnError )
186
151
telegramMessage := telegramCmd .String ("message" , "This is a test message" , "message" )
187
152
188
- lineNotifyCmd := flag .NewFlagSet ("linenotify" , flag .ExitOnError )
189
- lineNotifyMessage := lineNotifyCmd .String ("message" , "This is a test message" , "message" )
190
-
191
153
hangoutsChatCmd := flag .NewFlagSet ("hangoutschat" , flag .ExitOnError )
192
154
hangoutsChatMessage := hangoutsChatCmd .String ("message" , "This is a test message" , "message" )
193
155
@@ -198,17 +160,14 @@ func main() {
198
160
discordMessage := discordCmd .String ("message" , "This is a test message" , "message" )
199
161
200
162
if len (os .Args ) < 2 {
201
- log .Println ("Expected 'telegram', 'linenotify', ' hangoutschat', 'slack', or 'discord'" )
163
+ log .Println ("Expected 'telegram', 'hangoutschat', 'slack', or 'discord'" )
202
164
os .Exit (1 )
203
165
}
204
166
205
167
switch os .Args [1 ] {
206
168
case "telegram" :
207
169
telegramCmd .Parse (os .Args [2 :])
208
170
notifyTelegram (* telegramMessage )
209
- case "linenotify" :
210
- lineNotifyCmd .Parse (os .Args [2 :])
211
- notifyLineNotify (* lineNotifyMessage )
212
171
case "hangoutschat" :
213
172
hangoutsChatCmd .Parse (os .Args [2 :])
214
173
notifyHangoutsChat (* hangoutsChatMessage )
@@ -219,7 +178,7 @@ func main() {
219
178
discordCmd .Parse (os .Args [2 :])
220
179
notifyDiscord (* discordMessage )
221
180
default :
222
- log .Println ("Expected 'telegram', 'linenotify', ' hangoutschat', 'slack', or 'discord'" )
181
+ log .Println ("Expected 'telegram', 'hangoutschat', 'slack', or 'discord'" )
223
182
os .Exit (1 )
224
183
}
225
184
}
0 commit comments