Q:

How to setup the timeout before a refresh on Twitter embedded timelines?

How can I setup the timeout before a refresh on Twitter embedded timelines?
I need change the timeout time to update the twitter timelines on my site.
Currently each second the twitter API do a ajax request to update the timelines.
But on browser with slow engines of JS (in other words: IE), causes the browser becomes slow or sometimes causes the browser to stop working.
To fix this I want setup the timeout before a refresh on Twitter timelines
I didn't found any reference on API about how I can do this.
I'm using the follow JS code to import the timeline:
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p='https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p "://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

To show the timelines I'm using a HTML like code shown below:
<div class="box-twitter">
<p class="title-box"><span class="icon"></span>WHAT'S HAPPENING ON TWITTER </p>
<a class="twitter-timeline"  href="https://twitter.com/search?q=from:dev include:retweets"  data-widget-id="394816085830025216"><img src="preloader.gif" style="margin-left: 132px; margin-top: 20px;"/></a>

Someone know how can  I solve this problem?
Thanks.

A:

After do a reverse engineering, on widget.js file, provided by Twitter.
I've found a method called 'schedulePolling', with the code below:
schedulePolling: function(e) {
var t = this;
if (this.pollInterval === null) return;
e = twttr.widgets.poll || e || this.pollInterval || 1e4, e > -1 && window.setTimeout(function() {
    this.isUpdating || t.update(), t.schedulePolling()
}, e)

To increase the timeout I've added a fixed value on this code.
schedulePolling: function(e) {
var t = this;
if (this.pollInterval === null) return;
e = 60000 || e || this.pollInterval || 1e4, e > -1 && window.setTimeout(function() {
    this.isUpdating || t.update(), t.schedulePolling()
}, e)}

I've replaced the code twttr.widgets.poll
for the time that I wanted '60000';
After do this a save the widget.js with my customized code.
So, after this customization I've modify the line where the Twitter API was imported, changing the default value //platform.twitter.com/widgets.js to the path of my customized file my-site/js/customized_widgets.js.
This is the result.
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p='https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"/my-site/js/customized_widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

