6 ms·
API for creating random users in your application
- BetaCygni 13y agoIsn't parsing the JSON and converting to your own data format more work than just generating random users yourself?
- chrisbridgett 13y agoDoesn't seem like much work at all to me, compared to creating random users. Then again, maybe it's just me that isn't creative enough to be able to come up with names other than "Test User", "Another User", "Somebody Else", etc. :-p
- gog 13y agoThere is a library called Faker that can do this for you. It exists for perl, ruby, php and probably other languages. I am interested in where do this pictures come from? Did these people give their permission to be used like this?
- C1D 13y agoIf you scroll to the bottom of the page you can see he got them from Greg Peverill-Conti's 1,000 faces project, which is licensed under Creative Commons BY-NC-SA 2.0,
- aram 13y agoI don't think so; it's pretty trivial to decode the JSON and make it a native object/array/whatever in almost any programming language. So far I always did a "user[count]" or "user[timestamp]" thing and it was time consuming, dull and most of all didn't do the best job at presenting the app to the clients.
- hk__2 13y agoFor simple placeholders you can use a client-side templates engine and pass it the JSON directly.
- martin-adams 13y agoBeyond 3 or 4 fake users, I think you'll soon realise how difficult it can be to be a) motivated, and b) original.
- chrisbridgett 13y agoNeat little API. Would be cool if there were a way to generate users with a particular locale - e.g. so I could generate UK users with UK addresses, telephone numbers, etc.
- rhizome 13y agoNasty negative left margin.
- Chetane 13y agoCool idea! Btw, your Ajax code snippet won't work, 'return' is a reserved keyword :) I would suggest using 'data' or 'response' instead for your variable name.
- jokull 13y agoVery cool! Limited to US only though. Check out behindthename.com/api/ if you need country distribution. Had to map country codes to groups of names. Let me know if you need this data. I’ve got some scripts to generate random users, although not address or picture data.
- jlebrech 13y agocool, I could make a dating site with this ;)
- C1D 13y agoEven though the pictures are under Creative Commons BY-NC-SA 2.0 I do feel right using them and it seems like a lot of work to parse the data into your own website, there are server side libraries that can do this for you.
- patio11 13y agoSo a lesson from when I was young and stupid: If you make fake data, it's often advantageous to make it obviously fake data. If, in a fit of boredom, you decide to do something clever and e.g. generate plausible names and birthdates for fake students by using government lists for the most common names and surnames for people born that year, and you e.g. hypothetically leave 6 pages of no-actual-human-involved fake data sitting on an office printer, you might hypothetically end up in a very awkward conversation with the local person in charge of regulated data breaches.
- masklinn 13y ago> So a lesson from when I was young and stupid: If you make fake data, it's often advantageous to make it obviously fake data. A second one: if you make fake data, it's aways advantageous to make it edge-case fake data. Your generator should break more or less every falsehood programmers believe about names[0] [0] http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-b...
- mkenyon 13y agoMasklinn, I have to point out that patio11 wrote the article to which you linked!
- w3pm 13y agoFair enough, but it's also advantageous to make it non-obviously fake. Consider the recent stories about services faking traffic/users in order to gain real traffic/users (ebay, reddit, dating sites, etc).
- lazerwalker 13y agoYou have a very fair point, but it's tangential to the one patio11 is making; creating testing data for development purposes (that's never going to be seen by users, short of an accident) and creating faked data for marketing/growth/etc purposes (which is solely for the purpose of presenting to users) are unrelated.
- deleted 13y ago[deleted]
- um304 13y agogender: "male", name: { title: "mrs", first: "james", last: "ramirez" }, Never knew "mrs" can be used as a male title.
- polymatter 13y agoNever assume anything about names. Never attempt to validate them. It is probably a good edge case (depending on the system in question). I think a sibling comment has mentioned this, but it deserves repeating (http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-b...)
- deleted 13y ago[deleted]
- Aarvay 13y agoI use Faker :) http://faker.rubyforge.org/ http://faker.rubyforge.org/
- rabino 13y agoOr the PHP port which is awesome: https://github.com/fzaninotto/Faker https://github.com/fzaninotto/Faker
- aram 13y agoDisclaimer: I'm not the creator and I'm not associated in any way with the project. Just found it interesting and posted here.
- paulnechifor 13y agoI did a similar thing for Romanian identities [1]. Then I discovered that some are way more extensive [2] [3]. [1] http://minimul.ro/identitate-falsa http://minimul.ro/identitate-falsa [2] http://fakenamegenerator.com http://fakenamegenerator.com [3] http://www.datafakegenerator.com/generador.php http://www.datafakegenerator.com/generador.php
- martin-adams 13y agoVery nice idea. Anyone know of an equivalent for fake e-commerce product data?
- andyhmltn 13y agoOn the example, it displays the gender as male and the title as 'mrs' - Is this a typo or an actual response?
- andyhmltn 13y agoJust to help: The title isn't being updated on the ajax call :-) Everything else is so 50% of the time it's correct 50% it's wrong haha
- theandym 13y agoFor Rails Rumble last year I created a Rails app for generating test data in various formats. It definitely isn't as polished as this (only had 48 hours), but allows for the user to specify their own format. After the competition I cleaned it up a bit more and converted the data generation functionality into a standalone Ruby gem. I'd appreciate any feedback... App: http://proglipsum.com/ http://proglipsum.com/ Gem: https://github.com/theandym/mannequin https://github.com/theandym/mannequin
- emeraldd 13y agoHuh, it looks like the api is ignoring the gender option entirely. It seems to return a random gender no matter what the value of the gender parameter ....
- deleted 13y ago[deleted]
- cdcarter 13y agoProviding an md5 hash of the example password is just asking for bad password models in new apps! Users, don't use the provided hashes, instead run the user and password through the exact sign-up method real user data will go through.
- nirmel 13y agoall users are caucasian middle-aged people with anglo names? that's not so random.
- ismaelc 13y agoTest console for easy testing - https://www.mashape.com/community/random-user-generator#!documentation https://www.mashape.com/community/random-user-generator#!doc...
- pdq 13y agoYou don't have permissions to see or consume this API.