4

I'm trying to create 1000 random profile pics of people defined by demographics. e.g : 85% Women, aged - 20 - 29 , Nationality : American and so on...

Does anyone know any services that'll do this for me? If not does anyone have any good ideas on how to do it with an emphasis on realistic profile pictures and their names?

Thanks

Tal
  • 69
  • 1
  • 1
  • 2
  • what for? for privacy reasons, you would not be allowed to use those pics for anything. – andyrandy Nov 02 '14 at 09:16
  • I'm creating an MVP and need to see how users will react to it. My assumption is that I'll get significantly better results by creating lots of fake profiles for the start like Reddit did. – Tal Nov 02 '14 at 13:07
  • so you want to take real user profile pics from facebook from users who never authorized you to use their pic, to create fake profiles? – andyrandy Nov 02 '14 at 13:10
  • ...or do you want to generate random pics without facebook connection? like a lorem ipsum for avatars? – andyrandy Nov 02 '14 at 13:25
  • This sounds unethical, why not use colorized stick figures – Manuel Hernandez Mar 29 '19 at 10:19

6 Answers6

11

Of course it would not be allowed to grab pictures/profiles from Facebook without the users knowing about it, but there are several generators out there for this:

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • 1
    These sites are very good but if I understand how to use them currectly they don't scale up to 1000 different profile pics. Do you know of some other way or other services that have larger scale? – Tal Nov 02 '14 at 13:54
  • are you sure they don´t scale up? i don´t know of any limits, so you can just grab them in a loop, i guess. after all you only need to do it once and store the images. – andyrandy Nov 02 '14 at 14:16
  • doing it in a loop results in duplicate pics which is a problem for me. randomuser.me has a bank of 200 possible users and lorempixel doesn't return pics by demographic value. tnx anyway – Tal Nov 02 '14 at 14:29
7

see https://developers.facebook.com/docs/graph-api/reference/user/picture/

<html>
  <body>

    <script>
      function getRandomInt() {
        return Math.floor(Math.random() * (10000 - 5)) + 4;
      }
      for(var i=0; i<10; 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>
Meiko Rachimow
  • 4,664
  • 2
  • 25
  • 43
  • this is not the full answer, but answers the duplicate marked question http://stackoverflow.com/questions/35767458/how-do-i-get-200-random-facbook-user-profile-photos – Meiko Rachimow Mar 03 '16 at 09:36
1

<html>
  <body>

    <script>
      function getRandomInt() {
        return Math.floor(Math.random() * (10000 - 5)) + 4;
      }
      for(var i=0; i<10; 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>
Saiful Ex
  • 11
  • 1
0

https://avatars2.githubusercontent.com/u/12345?s=360

Just replace the value after /u/ with any number. There are several million photos. I suppose you can guess who picture #1 belongs to. Optionally, you can set the size using the s parameter. In this example it is 360 pixels in height and width.

But please don't go hog wild and start downloading thousands of images in a short period of time, otherwise Github will probably notice that and start to implement limits which will ruin it for all developers. If you keep it to a thousand and avoid repeatedly calling their server, you will not get noticed as though you were a bot. A better solution is to perform a one-time download of all the images you need and cache them and use them from your own device or server rather than constantly hitting Github's server.

Better yet, there's a free API at:

https://fakedata.dev/

It allows you to generate about a million random users or 1,000 non-random users.

Johann
  • 27,536
  • 39
  • 165
  • 279
0

enter link description here

enter link description here

it gives gender-specific pictures

More :- https://randomuser.me/

Bhargav Sejpal
  • 1,352
  • 16
  • 23
-1

<html>
  <body>

    <script>
      function getRandomInt() {
        return Math.floor(Math.random() * (10000 - 5)) + 6;
      }
      for(var i=0; i<10; i++) {
        imgUrl = "http://graph.facebook.com/v2.5/" + getRandomInt() + "/picture?height=350&height=350";
        elem = document.createElement("img");
        elem.setAttribute("src", imgUrl);
        elem.setAttribute("width", 350);
        elem.setAttribute("height", 350);
        document.body.appendChild(elem);
      }
    </script>
  </body>
</html>