Skip to content

Instantly share code, notes, and snippets.

@ElmahdiMahmoud
Created September 2, 2013 14:15
Show Gist options
  • Save ElmahdiMahmoud/6413336 to your computer and use it in GitHub Desktop.
Save ElmahdiMahmoud/6413336 to your computer and use it in GitHub Desktop.
js: Customize twitter feed
// Customize twitter feed
var hideTwitterAttempts = 0;
function hideTwitterBoxElements() {
setTimeout( function() {
if ( $('[id*=twitter]').length ) {
$('[id*=twitter]').each( function(){
if ( $(this).width() == 220 ) {
$(this).width( 220 );
$(this).height( 425 );
}
var ibody = $(this).contents().find( 'body' );
ibody.width( $(this).width() + 20 );
if ( ibody.find( '.timeline .stream .h-feed li.tweet' ).length ) {
ibody.find( '.timeline' ).css( 'border', 0 );
ibody.find( '.timeline .stream' ).css( 'overflow-x', 'hidden' );
ibody.find( '.timeline .stream' ).css( 'overflow-y', 'scroll' );
ibody.find( '.timeline-header').hide();
ibody.find( '.timeline-footer').hide();
ibody.find( '.u-photo.avatar').hide();
ibody.find( '.footer.customisable-border, .retweet-credit').remove();
ibody.find( '.var-narrow .tweet .header').css('padding','0');
ibody.find( '.profile .p-name, .customisable').css('color','#e12329');
}
else {
$(this).hide();
}
});
}
hideTwitterAttempts++;
if ( hideTwitterAttempts < 3 ) {
hideTwitterBoxElements();
}
}, 50);
}
hideTwitterBoxElements();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment