A few days/weeks ago, some of my sites\' twitter widgets stopped pulling through data properly. Turns out Version 2 twitter widget is deprecated, and the new embedded timeli
This is working for me
function twitterfix() {
if(typeof $("#twitter-widget-0").contents().find(".load-more").html() == 'undefined') {
setTimeout(twitterfix, 500);
}
else {
var head = $("#twitter-widget-0").contents().find("head");
head.append('<link type="text/css" rel="stylesheet" href="wp-content/themes/mywordpresstheme/style.css">');
head.append('<style>.h-entry.tweet.with-expansion.customisable-border {border-bottom: 1px solid #EFEEEE;}</style>');
}
}
$(document).ready(function () {
twitterfix();
});
wiki.workassis.com
If you take a look at widgets.js and look for this line:
e.appendStyleSheet(twttr.widgets.config.assetUrl() + "/" + r("embed/timeline.css"))).then(p.bind(function() {
You can copy timeline.css and modify both files however you like.
See "client side options" here. But basically, you can slap the whole thing in a styled div, remove the header & footer & make the background transparent. I'm personally still searching for a way to limit the number of tweets & get rid of the user icon.
Here's our code (Drupal block): ok, I can't get the code to show nicely.
In the Microsoft MVC world there are helpers in the Microsoft.Web.Helpers library, specifically using:
@Twitter.Profile(...
The above is just a wrapper around the V2 widget, but indicates there is a high usage of that particular widget.
I've looked into your question for a while now (in fact when the deprecation message started appearing) and I have come to the following conclusions:
The timeline inserts an iframe into the page, so why not just get the contents of the iframe and do whatever with it?
Here is how its done with jquery for example:
$($('#IFRAME_ID').contents().find('body'))
You now have the complete twitter feed as a DOM tree, do whatever you want.
I can at least help with limiting the tweets and removing the scroll bar.
From the documentation:
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.
And
Chrome: Control the widget layout and chrome by using the data-chrome="nofooter transparent" attribute on the embed code. Use a space-separated set of the following options: noheader, nofooter, noscrollbar, transparent.
Still looking at the styling.