Coder Social home page Coder Social logo

Comments (27)

ersgonzalo avatar ersgonzalo commented on July 30, 2024

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.

SiteSplat avatar SiteSplat commented on July 30, 2024

yup broken. It just happened. I cant find any reference on their changes though.

from twitter-post-fetcher.

FooseTV avatar FooseTV commented on July 30, 2024

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.

SiteSplat avatar SiteSplat commented on July 30, 2024

https://twitter.com/SiteSplat/status/705421314748764160 tweet and retweet LOL

from twitter-post-fetcher.

minDGarden avatar minDGarden commented on July 30, 2024

I noticed it stopped working today too.

from twitter-post-fetcher.

xecollons avatar xecollons commented on July 30, 2024

Same here. The plugin is getting the widget body, but it seems that the tweets have different classes.

from twitter-post-fetcher.

enkota avatar enkota commented on July 30, 2024

+1 down for me too today.

from twitter-post-fetcher.

FooseTV avatar FooseTV commented on July 30, 2024

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.

ersgonzalo avatar ersgonzalo commented on July 30, 2024

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.

xecollons avatar xecollons commented on July 30, 2024

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.

SiteSplat avatar SiteSplat commented on July 30, 2024

Things changed a bit. here it is: https://blog.twitter.com/2016/coming-soon-an-improved-embedded-timeline

from twitter-post-fetcher.

FooseTV avatar FooseTV commented on July 30, 2024

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.

jasonmayes avatar jasonmayes commented on July 30, 2024

Yep Twitter has changed classes. Will look into this

from twitter-post-fetcher.

xecollons avatar xecollons commented on July 30, 2024

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.

rawksteady avatar rawksteady commented on July 30, 2024

@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.

jasonmayes avatar jasonmayes commented on July 30, 2024

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.

jasonmayes avatar jasonmayes commented on July 30, 2024

@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.

rawksteady avatar rawksteady commented on July 30, 2024

@jasonmayes 402038497487224832 First entry should be a retweet

from twitter-post-fetcher.

jasonmayes avatar jasonmayes commented on July 30, 2024

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.

rawksteady avatar rawksteady commented on July 30, 2024

I did 2 or 3 of them just now.

from twitter-post-fetcher.

azappa avatar azappa commented on July 30, 2024

A little bit off topic, do you have plan to publish your lib on cdnjs.com?

from twitter-post-fetcher.

jasonmayes avatar jasonmayes commented on July 30, 2024

@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.

jasonmayes avatar jasonmayes commented on July 30, 2024

@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.

Joel-Mercier avatar Joel-Mercier commented on July 30, 2024

Thank you so much @jasonmayes for fixing this so quickly !

from twitter-post-fetcher.

rorysmorris avatar rorysmorris commented on July 30, 2024

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.

minDGarden avatar minDGarden commented on July 30, 2024

@jasonmayes Thanks for the quick fix!

from twitter-post-fetcher.

jasonmayes avatar jasonmayes commented on July 30, 2024

No problem. Happy it has helped so many!

from twitter-post-fetcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.