Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
マクドナルドのクーポンを表示するmikutterプラグイン
#-*- 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
You can’t perform that action at this time.