Skip to content

Instantly share code, notes, and snippets.

@firstspring1845
Created November 17, 2014 09:21
Show Gist options
  • Save firstspring1845/d56a19812fdb31d69c2c to your computer and use it in GitHub Desktop.
Save firstspring1845/d56a19812fdb31d69c2c to your computer and use it in GitHub Desktop.
localhost:8000/任意のアドレス?message=ツイート本文
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}
@firstspring1845
Copy link
Author

色々と間違ってるから気が向いたら修正する

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment