Skip to content

Instantly share code, notes, and snippets.

@itolosa
Created December 26, 2014 04:36
Show Gist options
  • Save itolosa/a128aa28a8efda9745fb to your computer and use it in GitHub Desktop.
Save itolosa/a128aa28a8efda9745fb to your computer and use it in GitHub Desktop.
ufollow.js
//unfollow twitter
boxes = document.getElementsByClassName('ProfileCard-content');
for (var i = 0; i < boxes.length; i++) {
box = boxes[i];
try {
r = box.getElementsByClassName('FollowStatus')[0].innerHTML;
if (!(r === "te sigue")) {
throw "failed";
}
} catch (err) {
follow_btn = box.getElementsByClassName('button-text following-text')[0];
display_value = window.getComputedStyle(follow_btn).getPropertyValue('display');
if (!(display_value === "none")) {
btn = box.getElementsByClassName('user-actions-follow-button')[0];
btn.click();
}
}
}
//follow twitter
boxes = document.getElementsByClassName('ProfileCard-content');
for (var i = 0; i < boxes.length; i++) {
box = boxes[i];
try {
r = box.getElementsByClassName('FollowStatus')[0].innerHTML;
if (!(r === "te sigue")) {
throw "failed";
}
} catch (err) {
follow_btn = box.getElementsByClassName('button-text following-text')[0];
display_value = window.getComputedStyle(follow_btn).getPropertyValue('display');
if (display_value === "none") {
btn = box.getElementsByClassName('user-actions-follow-button')[0];
btn.click();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment