Created
November 14, 2016 16:02
-
-
Save moguno/0be08257358aaf85c17e589a81bc2944 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
Plugin.create(:mikutter_datasource_akkie_new_house) { | |
filter_extract_datasources { |datasources| | |
datasources[:mikutter_datasource_akkie_new_house] = _("あっきぃさんち") | |
[datasources] | |
} | |
on_period { |service| | |
if service == Service.primary | |
if Time.now.min % 5 == 0 | |
filename = (Time.now - 60 * 5).strftime("%Y%m%d-%H%M") | |
message = Message.new(:message => "http://shrimp.marokun.net/newhouse/data/#{filename}.jpg", :system => true) | |
message[:subparts_images] = ["http://shrimp.marokun.net/newhouse/data/#{filename}.jpg"] | |
Plugin.call(:extract_receive_message, :mikutter_datasource_akkie_new_house, Messages.new([message])) | |
end | |
end | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment