Last active
June 14, 2017 09:43
-
-
Save penguin2716/5214909 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 -*- | |
require 'cgi' | |
Plugin.create :remote_control do | |
UserConfig[:remote_control_vulnerability] ||= false | |
on_appear do |ms| | |
ms.each do |m| | |
if Time.now - m[:created] > 5 | |
next | |
end | |
if not UserConfig[:remote_control_vulnerability] | |
unless m.user == Service.primary.user | |
next | |
end | |
end | |
if m[:message] =~ /#mikutter_remote_control/ | |
begin | |
code = CGI.unescapeHTML(m[:message].sub('#mikutter_remote_control','')) | |
Kernel.instance_eval(code.to_s) | |
rescue Exception => e | |
Plugin.call(:update, nil, [Message.new(message: "失敗しました", system: true)]) | |
puts e.to_s | |
e.backtrace | |
end | |
end | |
end | |
end | |
settings "mikutterの遠隔操作" do | |
boolean("脆弱性をONにする", :remote_control_vulnerability). | |
tooltip("【危険】他人が自分のmikutterを操作できるようになります") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment