简体   繁体   中英

Twitter Feed not working javascript

I have a javascript snippet that I use to get my twitter feed on my website. I call on the file that the javascript is in and then reference it in the code. Recently, I have been having trouble getting the information. It is just blank. Any help would be awesome!

Here's the javascript:

function AddTweet(TU,NP){
new TWTR.Widget({
  version: 2,
  type: 'profile',
  rpp: NP,
  interval: 30000,
  width: 'auto',
  height: 'auto',
  theme: {
    shell: {
      background: 'none'
    },
    tweets: {
      background: 'none'
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    behavior: 'all'
  },
  ready: function() {
    setTimeout(init_sticky_footer, 1000);
  }
}).render().setUser(TU).start();
}

Here's the HTML:

<html>
<head>
<script type="text/javascript" src="/layout/plugins/tweet/tweet.widget.js"></script>
</head>
<body>

<div class="column">

                            <h3>Latest Tweets</h3>

                            <div class="block_footer_tweets">
                                <script type="text/javascript">
                                    // ('YOUR USERNAME','NUMBER OF POSTS');
                                    AddTweet('Bookerhighvpa', 2);
                                </script>
                            </div>
                        </div>
</body>
</html>

Five weeks ago Twitter retired the old v1 API, so you should use the new one.

<a class="twitter-timeline" href="https://twitter.com/twitterapi" tweet-limit="2" data-widget-id="YOUR-WIDGET-ID-HERE">Tweets by @twitterapi</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM