Skip to content

Instantly share code, notes, and snippets.

View 3DGEOM's full-sized avatar

Chris Leggett 3DGEOM

View GitHub Profile
@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@skhatri
skhatri / Unfriend.java
Created November 11, 2011 11:15
unfollow the unfollowers
try {
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.setOAuthAccessToken("configure")
.setOAuthAccessTokenSecret("these")
.setOAuthConsumerKey("params")
.setOAuthConsumerSecret("in twitter");
//twitter4j
Twitter twitter = new TwitterFactory(builder.build()).getInstance();
// go to https://twitter.com/your-username, and enter the following into the developer console:
for(var i = 1; i < 500; i++){ // just do it a bunch
// Un retweet
document.getElementsByClassName("ProfileTweet-actionButtonUndo")[i].click();
document.getElementsByClassName("js-close")[0].click();
// Delete tweets
document.getElementsByClassName("js-actionDelete")[i].childNodes[1].click();
document.getElementsByClassName("delete-action")[0].click()
}