Created
March 20, 2017 06:47
-
-
Save mpyw/6021e70e60ec6677fff59fce9e0d722b 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
Plugin.create(:inmuapi) do | |
[(1..4).to_a, "一二三四".chars].transpose.each do |num, knum| | |
command(:"inmuapi_#{num}", name: "真夏の夜の淫夢 #{knum}章", condition: -> _ { true }, visible: true, role: :postbox) do |opt| | |
res = Net::HTTP.get_response(URI.parse("http://api.yukkurisinai.net/inmu/story/#{num}")) | |
text = JSON.parse(res.body)["Plot"] | |
Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text = text | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment