Last active
December 15, 2015 00:39
-
-
Save penguin2716/5174946 to your computer and use it in GitHub Desktop.
マクドナルドのクーポンを表示するmikutterプラグイン
This file contains 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
#-*- coding: utf-8 -*- | |
Plugin.create :show_mcdonalds_coupon do | |
command(:show_mcdonalds_coupon, | |
name: 'マクドナルドのクーポンを表示', | |
condition: lambda{ |opt| true }, | |
icon: 'http://www.mcdonalds.co.jp/common/graphic_files/global_navigation/image_01.gif', | |
visible: true, | |
role: :window) do |opt| | |
baseurl = 'http://www.mcdonalds.co.jp/sales/new/smileplus/index.php' | |
Plugin.call(:update, nil, [Message.new(message: "ブラウザでマクドナルドのクーポンを表示します", system: true)]) | |
Gtk::openurl (baseurl + ("?control=coupon&" + open(baseurl).read.scan(/value='([0-9]+)'/).flatten.map{|n| "coupon[]=" + n}.join("&"))) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment