Last active
October 13, 2016 11:55
-
-
Save shutingrz/adc388e2890522affa84a129487c68d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'openssl' | |
def write(msg) | |
token = '' # token | |
url = URI.parse('https://notify-api.line.me/api/notify') | |
req = Net::HTTP::Post.new(url.path) | |
http = Net::HTTP.new(url.host, url.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
req['Authorization'] = 'Bearer ' + token | |
req.set_form_data({'message' => msg}, ';') | |
http.start do |h| | |
http.request(req) | |
end | |
end | |
write("5秒かぞえま~すwww") | |
for num in 1..5 do | |
write(num) | |
sleep 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment