Christian Heilmann

GreaseMonkey script to show if a twitter user follows you or not

Wednesday, October 22nd, 2008 at 8:11 pm

As requested by Josh here’s a greasemonkey script that shows if a certain user follows you on twitter by adding a (follows you) to their name on their profile page.

It works – kinda. As there is no way to get a list of all the people a certain twitter user follows on one page (unless I missed something in the API - help please?) the script first checks if you are in the 30 first followers on the page (the thumbs) and if you are not it loads the “friends” page of a certain user and checks if you are in that page. This covers 60 cases, but not all. Oh well…

Source:


// UserScript
// @name Follower
// @namespace twittertools
// @description Shows in an obvious way if a certain twitter user is following you
// @include http://twitter.com/
// /UserScript

(function(){
if(document.getElementById(‘profile_link’)){
var you = document.getElementById(‘profile_link’).href.replace(/.*//,’‘);
var friends = document.getElementById(‘friends’);
var header = document.getElementsByTagName(‘h2’)[0];
var friends = document.getElementById(‘friends’);
if(friends.innerHTML.indexOf(‘/’+you)!==-1){
var side = document.getElementById(‘friends’);
var header = document.getElementsByTagName(‘h2’)[0];
header.innerHTML += ’ (follows you)’;
} else {
var url = window.location.href + ‘/friends’;
var isme = ‘http://twitter.com/’ + you;
GM_xmlhttpRequest({
method: ‘GET’,
url:url,
onload: function(responseDetails) {
if(responseDetails.responseText.indexOf(isme)!==-1){
header.innerHTML += ’ (follows you)’;
}

}
});
}

}
})();

Tags: , , ,

Share on Mastodon (needs instance)

Share on Twitter

Newsletter

Check out the Dev Digest Newsletter I write every week for WeAreDevelopers. Latest issues:

Dev Digest 146: 🥱 React fatigue 📊 Query anything with SQL 🧠 AI News

Why it may not be needed to learn React, why Deepfake masks will be a big problem and your spirit animal in body fat! 

Dev Digest 147: Free Copilot! Panel: AI and devs! RTO is bad! Pi plays!

Free Copilot! Experts discuss what AI means for devs. Don't trust containers. Mandated RTO means brain drain. And Pi plays Pokemon!

Dev Digest 148: Behind the scenes of Dev Digest & end of the year reports.

In 50 editions of Dev Digest we gave you 2081 resources. Join us in looking back and learn about all the trends this year.

Dev Digest 149: Wordpress break, VW tracking leak, ChatGPT vs Google.

Slowly starting 2025 we look at ChatGPT vs Google, Copilot vs. Cursor and the state of AI crawlers to replace web search…

Dev Digest 150: Shifting manually to AI.

Manual coding is becoming less of a skill. How can we ensure the quality of generated code? Also, unpacking an APK can get you an AI model.

My other work: