Comments (27)
Yeah, it seems like Twitter changed the way that their tweets are outputted from their widget. I'm looking into it for my own site as well.
from twitter-post-fetcher.
yup broken. It just happened. I cant find any reference on their changes though.
from twitter-post-fetcher.
It was working as of yesterday evening as I was working with a new page and this script. Something happened between last night and this morning. I've confirmed that the Twitter account I'm using is generating widgets and using the same id codes but there's a disconnect between the script and the widgets.
from twitter-post-fetcher.
https://twitter.com/SiteSplat/status/705421314748764160 tweet and retweet LOL
from twitter-post-fetcher.
I noticed it stopped working today too.
from twitter-post-fetcher.
Same here. The plugin is getting the widget body, but it seems that the tweets have different classes.
from twitter-post-fetcher.
+1 down for me too today.
from twitter-post-fetcher.
I concur. I believe Twitter changed all the class names of the HTML elements on the widget. Nothing matches the classes the script is trying to grab.
from twitter-post-fetcher.
Yeah, I have a working demo that I used with inspiration from ng-tweets, which also used jQuery. sorry It's working on my site now but jasonmayes' fetcher was built using vanilla. If you replace some of the classes then it will work again.
if (data._body) {
els = $(data._body.body)[0].getElementsByClassName('timeline-Tweet');
for (x = 0; x < els.length; x++) {
el = els[x];
tweet = {};
tweet.retweet = (el.getElementsByClassName('timeline-Tweet-retweetCredit').length > 0);
tweet.id = el.getAttribute('data-tweet-id');
tmp = el.getElementsByClassName('timeline-Tweet-text')[0];
tweet.title = tmp.innerHTML;
tweet.text = tmp.textContent || tmp.innerText; // IE8 doesn't support textContent
tmp = el.getElementsByClassName('timeline-Tweet-author')[0];
tweet.author = {
url: tmp.getElementsByClassName('TweetAuthor-link')[0].getAttribute('href'),
avatar: tmp.getElementsByClassName('Avatar')[0].getAttribute('data-src-1x'),
fullName: tmp.getElementsByClassName('TweetAuthor-name')[0].innerText,
nickName: tmp.getElementsByClassName('TweetAuthor-screenName')[0].innerText
};
tweet.updated = el.getElementsByClassName('dt-updated')[0].innerText;
tweet.link = el.getElementsByClassName('timeline-Tweet-timestamp')[0].getAttribute('href');
if (el.getElementsByClassName('timeline-Tweet-media')[0]) {
tweet.inlineMedia = el.getElementsByClassName('timeline-Tweet-media')[0].innerHTML;
}
response.tweets.push(tweet);
}
}
You can check my full gist here for help: https://gist.github.com/ersgonzalo/05108bf7550e2f8e4b6f
from twitter-post-fetcher.
Finishing my function too, very very simple(only last tweet, no rts, no images) for my site, will post the code here later.
from twitter-post-fetcher.
Things changed a bit. here it is: https://blog.twitter.com/2016/coming-soon-an-improved-embedded-timeline
from twitter-post-fetcher.
It also appears they changed they way media is displayed as well. There seems to be a series of new "MediaCard" classes.
from twitter-post-fetcher.
Yep Twitter has changed classes. Will look into this
from twitter-post-fetcher.
Ok, at the end, for the people like me, that doesn't need images, it's a simple change of classes in the source code:
class 'tweet' = 'timeline-Tweet'
class 'e-entry-title' = 'timeline-Tweet-text'
class 'p-author' = 'timeline-Tweet-author'
class 'permalink' = 'timeline-Tweet-timestamp'
With that, I have made it work. I still have to look how to adapt twitter links with elipsis and so.
from twitter-post-fetcher.
@jasonmayes Great to hear. If I'm not being too pushy, would this be a good time to maybe looking into this #48 as well?
from twitter-post-fetcher.
This is now fixed and code has been updated in a number of places. Please grab v15 from github. Thanks guys for your support and suggestions.
from twitter-post-fetcher.
@rawksteady Hey can you give me a widget id which has some retweets in? I almost never retweet myself :-) I can see what this produces.
from twitter-post-fetcher.
@jasonmayes 402038497487224832 First entry should be a retweet
from twitter-post-fetcher.
It is not, it is a regular tweet. If you could do a few retweets so I can check that would be helpful. Thanks.
from twitter-post-fetcher.
I did 2 or 3 of them just now.
from twitter-post-fetcher.
A little bit off topic, do you have plan to publish your lib on cdnjs.com?
from twitter-post-fetcher.
@rawksteady Ive just realised using advanced example where by you ask for dataOnly you can discover if rt or not and then simply add a class yourself. This is possible already:
var config = {
"id": '502160051226681344',
"dataOnly": true,
"customCallback": populateTpl,
"maxTweets": 5
};
twitterFetcher.fetch(config);
function populateTpl(tweets){
console.log(tweets);
}
from twitter-post-fetcher.
@azappa I did not, but feel free to request to add it if you want it there via their request form.
from twitter-post-fetcher.
Thank you so much @jasonmayes for fixing this so quickly !
from twitter-post-fetcher.
Thanks for the fast fix. Now, to push this new JS file to 100+ sites!
Maybe we should deliver plugins like this from a CDN. Any suggestions anyone?
from twitter-post-fetcher.
@jasonmayes Thanks for the quick fix!
from twitter-post-fetcher.
No problem. Happy it has helped so many!
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.