This commit is contained in:
r888888888
2017-06-14 16:30:19 -07:00
parent b2245349b3
commit f27d065e1f
2 changed files with 16 additions and 1 deletions

View File

@@ -52,7 +52,11 @@ class TwitterService
end
def extract_urls_for_card(attrs)
url = attrs.urls.map {|x| x.expanded_url}.reject {|x| x.host == "twitter.com"}.first
urls = attrs.urls.map {|x| x.expanded_url}
url = urls.reject {|x| x.host == "twitter.com"}.first
if url.nil?
url = urls.first
end
[extract_og_image_from_page(url)].compact
end