Skip to content

Instantly share code, notes, and snippets.

@alexandregz
Last active August 29, 2015 13:56
Show Gist options
  • Save alexandregz/9012471 to your computer and use it in GitHub Desktop.
Save alexandregz/9012471 to your computer and use it in GitHub Desktop.
put avatars in the news feed page from github
// ==UserScript==
// @name faces2newsgithub.js
// @namespace https://github.com/alexandregz/
// @version 0.1
// @description put avatars in the news feed page from github
// @match https://github.com/
// @copyright 2014+, Alexandre Espinosa Menor
// ==/UserScript==
// ToDo
// check to make only one ajax petition for user
// be careful with css and html
// more useful (not only for news feed, for example)
$('.news .alert .body .simple .title a:not(".css-truncate")').each(function(){
var l = $(this).parent();
$.ajax({
url: $(this).html(),
success: function(data) {
l.prepend( '<img src="' +$(data).filter('meta[property="og\:image"]').attr('content')+ '" width=20 height=20 /> ' );
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment