Last active
November 6, 2018 11:17
-
-
Save Na0ki/9aed7a078ad70a8359d7a14d3f9e5041 to your computer and use it in GitHub Desktop.
すこ〜しも寒くないわ〜
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 'httpclient' | |
Plugin.create(:frozen_toshi_a) do | |
filter_is_toshi_a_frozen? do | |
[Plugin::Toshia.frozen?] | |
end | |
end | |
class Plugin::Toshia | |
class << self | |
def frozen? | |
hey = twitter! | |
ban = stop ? me : premiamu | |
end | |
private | |
def twitter! | |
@current = Plugin.filtering(:world_current, nil).first | |
end | |
def stop | |
return false if !@current.nil? && @current.class.slug == :twitter | |
client = HTTPClient.new | |
res = client.get('https://twitter.com/toshi_a', follow_redirect: false) | |
(res.header['location'] || []).include?('https://twitter.com/account/suspended') | |
rescue | |
false | |
end | |
def me | |
true | |
end | |
def premiamu | |
false | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment