2

I'm using the Twitter embedded Timeline Widget on the login page for a single-page Backbone application. When the user logins in, I change the page via Backbone routing and the Twitter widget is no longer displayed. However, if you look at the Network panel of the browser developer tools, there are requests to http://syndication.twimg.com/widgets/timelines/paged/... every 15 seconds or so. How can I stop these requests?

If I delete window.twittr, I get 6 "Uncaught ReferenceError: twttr is not defined" errors from timeout callbacks...which works, but doesn't seem very clean. Is there a better way?

1

I believe setting a Tweet limit could be an option.

Tweet limit: To fix the size of a timeline to a preset number of Tweets, use the data-tweet-limit="5" attribute with any value between 1 and 20 Tweets. The timeline will render the specified number of Tweets from the timeline, expanding the height of the widget to display all Tweets without scrolling. Since the widget is of a fixed size, it will not poll for updates when using this option.

https://dev.twitter.com/docs/embedded-timelines

e.g.

<a class="twitter-timeline" href="https://twitter.com/twitterapi" data-widget-id="YOUR-WIDGET-ID-HERE" data-chrome="nofooter" data-tweet-limit="3">Tweets by @twitterapi</a>

And then if desired you could update your widgets manually, by removing them reinserting the html then calling.

twttr.widgets.load()

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.