Line-notify
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| line = "https://notify-api.line.me/api/notify"
to = ARGV[0]
msg = ARGV[1]
image = ARGV[2]
case to
when "me"
token = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
end
if image and File.exist?(image)
cmd = "curl -X POST -H 'Authorization: Bearer #{token}' -F 'message=#{msg}' -F 'imageFile=@#{image}' #{line}"
elsif image == nil
cmd = "curl -X POST -H 'Authorization: Bearer #{token}' -F 'message=#{msg}' #{line}"
else
cmd = "curl -X POST -H 'Authorization: Bearer #{token}' -F 'message=file cant find' #{line}"
end
system cmd
|