Project

ui_faces

0.01
No commit activity in last 3 years
No release in over 3 years
UIFaces is a great website to find user pictures to mockup your app. With this gems you can now implement more easily a pictures in your web app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

UiFaces

This gem uses UIfaces.com ( https://www.uifaces.com/ ) to fake user pictures on your app. You would like to use real user images for your app. This gem might be right you need. All the images comes from the 'authorized' section from uifaces and all images are real Twitter users images or avatar that previously agreeded to share their images.

Installation

Add this line to your application's Gemfile:

gem 'ui_faces'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ui_faces

Usage

#####RETRIEVE A RANDOM USER

link = UiFaces.face
puts link
=> https://s3.amazonaws.com/uifaces/faces/twitter/guinslym/128.jpg

#####FIND A SPECIFIC USER

link = UiFaces.face(true, 'larrygerard')
puts link
=> https://s3.amazonaws.com/uifaces/faces/twitter/larrygerard/128.jpg

#####RETRIEVE A USER BY GENRE

link = UiFaces.sex('woman')
woman = UiFaces.woman
man = UiFaces.man

#####RETRIEVE A HASH with different pictures size

link = UiFaces.faces
puts link
=> {
:bigger=>"https://s3.amazonaws.com/uifaces/faces/twitter/guiiipontes/73.jpg", 
:normal=>"https://s3.amazonaws.com/uifaces/faces/twitter/guiiipontes/48.jpg", 
:epic=>"https://s3.amazonaws.com/uifaces/faces/twitter/guiiipontes/128.jpg", 
:mini=>"https://s3.amazonaws.com/uifaces/faces/twitter/guiiipontes/24.jpg"
}
puts link[:bigger]
=> https://s3.amazonaws.com/uifaces/faces/twitter/guiiipontes/73.jpg
SPECIFYING the image size
link = UiFaces.face(false, 'random', 'normal')
=> https://s3.amazonaws.com/uifaces/faces/twitter/anton0kurilov/48.jpg
RUBY ON RAILS
#db/seeds.rb
#I'm using the gem 'faker' for the name
10.times do 
	Employee.find_or_create_by(
	:name  => Faker::Name.name.to_s,
	:image => UiFaces.face
	)
end

#app/view/employees/show.html
<%= image_tag @employee.image, class: "yourclass" %>

#<!-- or within a link -->
<%= link_to href: 'http://uifaces.com/guinslym' do %>
    <%= image_tag @employee.image,  alt: 'a face that is unnervingly happy'%>
<% end %>

guinslym

Contributing

  1. Star it :)
  2. Fork it ( https://github.com/guinslym/Uifaces/fork )
  3. Create your feature branch (git checkout -b my-new-feature)
  4. Test it
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create a new Pull Request