social-feed
social-feed copied to clipboard
Twitter don't show images in the feed
Twitter feed doesn't show images which are added into the tweets, like @audi have images in the tweet attached, but feed don't show images.
Maybe my pull request (#240) solves the problem. Can you test that branch? If it works I'll merge the pull request.
It show images, but now all, some images are missing from the tweets, also i noticed, it also show those tweets which i've relied to, (the replied tweets), if i only want to show the tweets i've tweeted not replied tweets, any option for that? like i just only want to show my tweets not the replies i've made to others. i hope you got my point, what im trying to say.
Did the replies appear after you applied #240 or did you already have that problem. If the last is the case you need to open a new issue, because that's off topic
No I already have that problem, but back to the topic, i've added the tweet_mode also changed the script you changed in #240 but no success not all the images shows up, some images are still missing.
Did you set set tweet_mode
to extended
?
both, compatibility and extended
I had the same problem. Some tweets show images some don't even though they have images. I did some research and found out enabling extended mode is half the solution. After that you need to use extended_entities
under retweeted_status
in API response to access media of extended retweets. I'm not sure about extended non-retweets.
Hi @taylankasap how can i use extended_entities please help me with it
@mutiullah7 you'll need to manually change the jquery.socialfeed.js file. Find the Feed.twitter.utility.unifyPostData
function body. There is an ìf block (options.show_media === true
) there. Since I only needed to use extended mode I'm not sure if this still works with compatibility mode so if you need to use both modes you may need to modify it. Here is the code I used inside that if block:
var elementEntities = {};
if (element.entities.media && element.entities.media.length > 0) {
elementEntities = element.entities;
} else if (element.retweeted_status && element.retweeted_status.extended_entities && element.retweeted_status.extended_entities.media && element.retweeted_status.extended_entities.media.length > 0) {
elementEntities = element.retweeted_status.extended_entities;
}
if (elementEntities.media && elementEntities.media.length > 0) {
var image_url = elementEntities.media[0].media_url;
if (image_url) {
post.attachment = '<img class="attachment" src="' + image_url + '" />';
}
}
Doesn't help, no images still after adding the code as you suggested.
@martijngastkemper Thanks dude, your solution has solved it, just got your updated jquery.socialfeed.js file as is replaced the old one with it, then I used tweet_mode: 'extended' in the calling function and it worked as expected :)