Created
April 11, 2011 22:56
-
-
Save TheDahv/914557 to your computer and use it in GitHub Desktop.
My main feed is mixed with friend activity and jquery activity. I want friend activity highlighted.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ASSUMPTION: jQuery is already loaded on the GitHub home page | |
// ASSUMPTION: Your username is TheDahv ;) | |
// JQUERY, I SUMMON YOU TO DO MY BIDDING WITH THIS HORRENDOUS ONE-LINER (FORMATTED FOR CONVENIENCE!!!) | |
$.get('https://github.com/TheDahv/following', | |
function (data) { | |
var members = $(data).find('.members > li').map(function(i,m) { return m.children[0].getAttribute('href').replace(/\//,""); }); | |
$('.news > div.alert').each( | |
function(i,a) { | |
var title = a.children[0].children[0]; | |
if($.inArray(title.children[0].getAttribute('href').replace(/\//, ""), members) != -1) { | |
$(a).css('background-color', '#AFDCEC'); | |
} | |
}); | |
}); | |
// TODO: Roll this into a GreaseMonkey/equivalent script | |
// TODO: Find a good way to generalize the username. Or just let people fork the gist and customize it themselves | |
// TODO: Trigger this function again when the the user requests for older feed entries. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment