Skip to content

Instantly share code, notes, and snippets.

@moguno
Created November 14, 2016 16:02
Show Gist options
  • Save moguno/0be08257358aaf85c17e589a81bc2944 to your computer and use it in GitHub Desktop.
Save moguno/0be08257358aaf85c17e589a81bc2944 to your computer and use it in GitHub Desktop.
あっきぃさんちを流すmikutterデータソースプラグイン
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