Skip to content

Instantly share code, notes, and snippets.

@toshia
Created August 6, 2014 08:52
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 toshia/ee2c358b70ee7f690e82 to your computer and use it in GitHub Desktop.
Save toshia/ee2c358b70ee7f690e82 to your computer and use it in GitHub Desktop.
Plugin.create(:mikutter_profile_media) do
profiletab :usermediatimeline, _("最近の画像つきツイート") do
set_icon Skin.get("aclog.png")
uid = user.id
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
Service.primary.search(q: "from:#{user[: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: user[:idname]})
timeline_storage[i_timeline.slug] = user end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment