Created
November 17, 2014 09:21
-
-
Save firstspring1845/d56a19812fdb31d69c2c to your computer and use it in GitHub Desktop.
localhost:8000/任意のアドレス?message=ツイート本文
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
server = WEBrick::HTTPServer.new({:Port => 8000}) | |
server.mount_proc('/'){|req,res| | |
q = Hash[*(req.query_string.split('&').map{|s|s.split('=')}.flatten)] | |
if q.include?('message') | |
Service.primary.post(:message => q['message']) | |
end | |
} | |
Thread.new{server.start} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
色々と間違ってるから気が向いたら修正する