Last active
April 7, 2017 21:57
-
-
Save ryzalyusoff/b3d77c220342aea17916c1f0b0b7bab4 to your computer and use it in GitHub Desktop.
Generate random avatars from Facebook users
This file contains hidden or 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
<html> | |
<body> | |
<script> | |
function getRandomInt() { | |
return Math.floor(Math.random() * (10000 - 5)) + 4; | |
} | |
for(var i=0; i<100; i++) { | |
imgUrl = "http://graph.facebook.com/v2.5/" + getRandomInt() + "/picture?height=200&height=200"; | |
elem = document.createElement("img"); | |
elem.setAttribute("src", imgUrl); | |
elem.setAttribute("width", 200); | |
elem.setAttribute("height", 200); | |
document.body.appendChild(elem); | |
} | |
</script> | |
</body> | |
</html> | |
<!-- Then can use https://www.mockaroo.com to integrate all the avatar --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment