mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-31 22:20:12 +00:00
Adding support for Twitter animated gifs.
This commit is contained in:
parent
00f0e451bc
commit
d3035fb67d
2 changed files with 8 additions and 6 deletions
|
@ -2778,6 +2778,11 @@ body {
|
||||||
|
|
||||||
/* See http://www.newsblur.com/site/1031643/le-21me for width: auto, height: auto */
|
/* See http://www.newsblur.com/site/1031643/le-21me for width: auto, height: auto */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.NB-feed-story .NB-feed-story-content video {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.NB-feed-story {
|
.NB-feed-story {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,9 +225,8 @@ class TwitterFetcher:
|
||||||
tweet_text = tweet_text.replace(media['url'], replacement)
|
tweet_text = tweet_text.replace(media['url'], replacement)
|
||||||
replaced[media['url']] = True
|
replaced[media['url']] = True
|
||||||
entities += "<img src=\"%s\"> <hr>" % media['media_url_https']
|
entities += "<img src=\"%s\"> <hr>" % media['media_url_https']
|
||||||
if 'photo' not in categories:
|
categories.add('photo')
|
||||||
categories.add('photo')
|
if media['type'] == 'video' or media['type'] == 'animated_gif':
|
||||||
if media['type'] == 'video':
|
|
||||||
if media.get('url') and media['url'] in tweet_text:
|
if media.get('url') and media['url'] in tweet_text:
|
||||||
tweet_title = tweet_title.replace(media['url'], media['display_url'])
|
tweet_title = tweet_title.replace(media['url'], media['display_url'])
|
||||||
replacement = "<a href=\"%s\">%s</a>" % (media['expanded_url'], media['display_url'])
|
replacement = "<a href=\"%s\">%s</a>" % (media['expanded_url'], media['display_url'])
|
||||||
|
@ -244,10 +243,8 @@ class TwitterFetcher:
|
||||||
chosen_variant = variant
|
chosen_variant = variant
|
||||||
if chosen_variant:
|
if chosen_variant:
|
||||||
entities += "<video src=\"%s\" autoplay loop muted playsinline> <hr>" % chosen_variant['url']
|
entities += "<video src=\"%s\" autoplay loop muted playsinline> <hr>" % chosen_variant['url']
|
||||||
if 'video' not in categories:
|
categories.add(media['type'])
|
||||||
categories.add('video')
|
|
||||||
|
|
||||||
|
|
||||||
for url in content_tweet['entities'].get('urls', []):
|
for url in content_tweet['entities'].get('urls', []):
|
||||||
if url['url'] in tweet_text:
|
if url['url'] in tweet_text:
|
||||||
replacement = "<a href=\"%s\">%s</a>" % (url['expanded_url'], url['display_url'])
|
replacement = "<a href=\"%s\">%s</a>" % (url['expanded_url'], url['display_url'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue