Comments (4)
I've been looking into this as I noticed the icons disappearing in the middle of the day yesterday as well. I traced back to the JSON used to populate the Twitter widgets and I think Twitter changed the HTML format specifically on the user icons. I never looked at this code in detail before but it appears that the element used on the icons no longer has an "src" attribute. Instead there are 2 "data-src" attributes pointing to different sized icons. I'm assuming this is for displaying higher resolution icons on high pixel density displays. I need to dig further but they may be using a new script to display the icon on their actual widget(s) as they still seem to be working.
Here's whats showing up in the TwitterFetch output:
img alt="" data-src-1x="https://pbs.twimg.com/profile_images/576399716302393345/o6pG9qqE_normal.jpeg" data-src-2x="https://pbs.twimg.com/profile_images/576399716302393345/o6pG9qqE_bigger.jpeg" data-scribe="element:avatar"
Which corresponds to the raw JSON:
\u003Cimg class=\"u-photo avatar\" alt=\"\"\n data-src-1x=\"https:\/\/pbs.twimg.com\/profile_images\/576399716302393345\/o6pG9qqE_normal.jpeg\" data-src-2x=\"https:\/\/pbs.twimg.com\/profile_images\/576399716302393345\/o6pG9qqE_bigger.jpeg\"\n data-scribe=\"element:avatar\"\u003E\n
Here's an example of what's on the Twitter widget now:
img class="u-photo avatar" alt="" data-src-1x="https://pbs.twimg.com/profile_images/576399716302393345/o6pG9qqE_normal.jpeg" data-src-2x="https://pbs.twimg.com/profile_images/576399716302393345/o6pG9qqE_bigger.jpeg" data-scribe="element:avatar" src="https://pbs.twimg.com/profile_images/576399716302393345/o6pG9qqE_normal.jpeg"
I was using a standard 1080p monitor so i believe Twitter's widget detected it as a 1x display and wrote the "src" element via a script. I'm looking now to see what script they are using so I can make a quick fix until TwitterFetch can be updated to account for this.
from twitter-post-fetcher.
Quick workaround, depending upon what version of the script you're using.
If you're using the minified script, replace -
f[b].innerHTML
with
f[b].innerHTML.replace('data-src-2x','src')
and similarly for f[b].innerText and f[b].textContent
If using the non-minified version, replace -
strip(authors[n].innerHTML)
with
strip(authors[n].innerHTML.replace('data-src-2x','src'))
and similarly for authors[n].innerText and authors[n].textContent
from twitter-post-fetcher.
Yeah, I found a similar solution - by swapping the data-src-1x (or 2x) value into the image source by default. It means the image loads like normal with a 1x/2x src (but also that the user never gets the other version either).
Edit - I've sent through a PR that I think fixes this. Let me know if it's helpful (or if I should change anything about it, etc). #58
from twitter-post-fetcher.
This is now fixed #58
from twitter-post-fetcher.
Related Issues (20)
- AdBlock blocks the library HOT 2
- MIME type is not executable HOT 4
- Example 2 is not working when you enable "showImages" HOT 4
- Make 18.0.3 an official "Release" HOT 1
- Urls are not properly formatting, it is moving them next to the last line of text in the tweet HOT 1
- No tweets showing HOT 5
- Fetching Tweets HOT 1
- There should be a way to show link to tweeted picture
- showImages option is missing from exampleUsage.js HOT 1
- Emoji is completely missing from tweets HOT 3
- Followers number etc HOT 2
- Hide Replies? HOT 3
- Render quoted tweet HOT 1
- In firefox it is not working HOT 2
- Include Alt Text for images from Twitter
- Firefox support HOT 1
- does not show emojis :( HOT 1
- Twitter likes is sorted by date not by recently liked HOT 1
- handleTweets doesn't accept an a tag as the tweet container
- Plugin no longer working HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter-post-fetcher.