Skip to content

Instantly share code, notes, and snippets.

@Na0ki
Last active November 6, 2018 11:17
Show Gist options
  • Save Na0ki/9aed7a078ad70a8359d7a14d3f9e5041 to your computer and use it in GitHub Desktop.
Save Na0ki/9aed7a078ad70a8359d7a14d3f9e5041 to your computer and use it in GitHub Desktop.
すこ〜しも寒くないわ〜
# -*- 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