Created
June 4, 2016 14:19
-
-
Save Helias/14e9ea7c0143f411140c6c631a2567fe to your computer and use it in GitHub Desktop.
fb-parser
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
<script> | |
/* structure sql | |
CREATE TABLE extracted ( | |
profile VARCHAR(255) NOT NULL, | |
done BIT(1) NOT NULL DEFAULT b'0', | |
PRIMARY KEY (profile) | |
) | |
ENGINE=InnoDB; | |
*/ | |
function getprofiles() | |
{ | |
var a = document.getElementsByTagName("a"); | |
var b = ""; | |
var tmp = ""; | |
for (var i = 0; i < a.length; i++) | |
{ | |
tmp = a[i].getAttribute("href"); | |
if (tmp != "#" && tmp.indexOf("/browse/mutual_friends/?uid=") == -1 && a[i].innerHTML.indexOf("<img") == -1) | |
{ | |
tmp = tmp.replace("&fref=pb&hc_location=profile_browser", ""); | |
tmp = tmp.replace("?fref=pb&hc_location=profile_browser", ""); | |
tmp = tmp.replace("https://www.facebook.com/profile.php?id=", ""); | |
tmp = tmp.replace("https://www.facebook.com/", ""); | |
b += "INSERT IGNORE INTO extracted (profile, done) VALUES ('http://facebook.com/"+tmp+"', 0);<br>"; | |
} | |
} | |
document.write(b); | |
}getprofiles(); | |
/* | |
INSERT IGNORE INTO extracted (profile, done) VALUES ('LINK-PROFILE-EXTRACTED', 0) | |
*/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment