Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Last active May 2, 2018 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akkiesoft/6c0e982821259a7d46d82a2e70ff029b to your computer and use it in GitHub Desktop.
Save Akkiesoft/6c0e982821259a7d46d82a2e70ff029b to your computer and use it in GitHub Desktop.
Plugin.create(:mikutter_profile_media) do
user_fragment :usermediatimeline, _("最近の画像つきツイート") do
set_icon File.join(File.dirname(__FILE__), "image.png")
uid = model.id
tw = Enumerator.new{|y| Plugin.filtering(:worlds, y)}
.select{|world| world.class.slug == :twitter }.first
i_timeline = timeline nil do
order do |message|
retweet = message.retweeted_statuses.find{ |r| uid == r.user.id }
(retweet || message)[:created].to_i end end
tw.search(q: "from:#{model[:idname]} filter:images",
count: [UserConfig[:profile_show_tweet_once], 200].min,
include_entities: true).next{ |tl|
tl.each do |message|
if message[:entities][:media]
i_timeline << message
end
end
}.terminate(_("@%{user} の最近のつぶやきが取得できませんでした。見るなってことですかね") % {user: model[:idname]})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment