Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.19 KB

File metadata and controls

55 lines (37 loc) · 1.19 KB

RandomUserApi

Build Status

Small and useful library, which use API of http://randomuser.me to generate random users.

Hex link

Installation

To install this app, just add it in your list of dependencies in mix.exs:

def deps do
  [
    {:random_user_api, "~> 1.2.1"}
  ]
end

Documentation is available here.

Instruction

Usage is very straightforward. In many cases simple call for single user would be enough.

alias RandomUserApi.Engine

# get single user
Engine.get_users()

# get 10 users
 Engine.get_users [number: 10]
 
# get one female
Engine.get users [gender: :female]

# get three men
Engine.get_users [number: 3, gender: :male]

# get one Brazilian
Engine.get_users [nat: "BR"]

TODO:

  • Included / excluded fields
  • list of values

I rewrited this library to use HTTPoison, because HTTPotion had issues with SSL.

Note:

If nationality you put is not known by the API, it will be ignored. Same story with gender.

Enjoy!