Skip to content

Instantly share code, notes, and snippets.

@vanakenm
Created December 27, 2017 14:08
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 vanakenm/b722f8eb13d9b9ff3c0d84a34c90bef1 to your computer and use it in GitHub Desktop.
Save vanakenm/b722f8eb13d9b9ff3c0d84a34c90bef1 to your computer and use it in GitHub Desktop.
tweets.each do |t|
next unless t.media && t.media.first && t.media.first.uri
image_url = t.media.first.media_uri
tweet_url = t.uri
next if EffinQuote.find_by(url: image_url.to_s)
EffinQuote.create(url: image_url.to_s, twitter_url: tweet_url.to_s)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment