我从@Sebastiaan Ordelman那里修改了这段代码,并加入了一些注释(参考旧API的值)。这是我在短时间内尝试匹配旧API的努力。将此代码放置在您从新版Twitter小部件中复制并粘贴代码后。
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script>
var hideTwitterAttempts = 0;
function hideTwitterBoxElements() {
setTimeout( function() {
if ( $('[id*=twitter]').length ) {
$('[id*=twitter]').each( function(){
var ibody = $(this).contents().find( 'body' );
if ( ibody.find( '.timeline .stream .h-feed li.tweet' ).length ) {
ibody.find( '.customisable-border' ).css( 'border', 0 );
ibody.find( '.timeline' ).css( 'background-color', '#004A7B' );
ibody.find( 'ol.h-feed' ).css( 'background-color', '#0575A1' );
ibody.find( 'ol.h-feed' ).css( 'border-radius', '5px 5px 5px 5px' );
ibody.find( 'li.tweet' ).css( 'border-bottom', '1px dotted #FFFFFF' );
ibody.find( 'li.tweet' ).css( 'color', '#FFFFFF' );
ibody.find( '.customisable:link' ).css( 'color', '#07E0EB' );
ibody.find( '.footer' ).css( 'visibility', 'hidden' );
ibody.find( '.footer' ).css( 'min-height', 0 );
ibody.find( '.footer' ).css( 'height', 0 );
ibody.find( '.avatar' ).css( 'height', 0 );
ibody.find( '.avatar' ).css( 'width', 0 );
ibody.find( '.p-nickname' ).css( 'font-size', 0 );
ibody.find( '.p-nickname' ).css( 'visibility', 'hidden' );
ibody.find( '.e-entry-content' ).css( 'margin', '-25px 0px 0px 0px' );
ibody.find( '.dt-updated' ).css( 'color', '#07E0EB' );
ibody.find( '.full-name' ).css( 'margin', '0px 0px 0px -35px' );
ibody.find( 'h1.summary' ).replaceWith( '<h1 class="summary"><a class="customisable-highlight" title="Tweets from fundSchedule" href="https://twitter.com/fundschedule" style="color: #FFFFFF;">fundSchedule</a></h1>' );
ibody.find( '.p-name' ).css( 'color', '#07E0EB' );
}
else {
$(this).hide();
}
});
}
hideTwitterAttempts++;
if ( hideTwitterAttempts < 3 ) {
hideTwitterBoxElements();
}
}, 1500);
}
hideTwitterBoxElements();
</script>
变化的形象:http://img837.imageshack.us/img837/1139/btjc.png
(Note:此处为一段HTML代码,无法直接翻译)