Module: Fetcher::Microdata::Review::Twitter

Defined in:
lib/fetcher/microdata/review/twitter/coercer.rb

Constant Summary collapse

Coercer =
proc { |retweet, viewer|
  {
    :id             => retweet["id"],
    :additionalType => "http://getfetcher.net/Item",
    :reviewBody    => retweet["text"],
    :author         => PersonUser.new(:twitter, retweet["user"]),
    :viewer         => PersonUser.new(:twitter, viewer),
    :dateCreated    => Fetcher::Microdata::Twitter::Service.instance.created_at_to_timestamp(retweet["created_at"]),
    :provider       => ["twitter", retweet["source"]],
    :url            => "https://twitter.com/#{retweet["user"]["screen_name"]}/status/#{retweet["id"]}",
    :itemReviewed => ArticleSmall.new(:twitter, retweet["retweeted_status"], retweet["retweeted_status"]["user"])
  }
}