metalx1000

Random User Profile with Photo

Feb 8th, 2022 (edited)
1,393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.26 KB | None | 0 0
  1. #Random User info with Photos
  2. #https://randomuser.me/
  3. #https://randomuser.me/documentation#howto
  4.  
  5. #Get a Random user profile
  6. wget -qO- "https://randomuser.me/api"
  7.  
  8. #request multiple profiles
  9. wget "https://randomuser.me/api/?results=50" -qO-
  10.  
  11. #Get 50 random profile photos
  12. wget "https://randomuser.me/api/?results=50" -qO-|jq .|grep large|cut -d\" -f4
  13.  
  14. #filter results
  15. wget "https://randomuser.me/api/?gender=female"
  16.  
  17.  
  18. #more with jq
  19. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results|keys'
  20.  
  21. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[].gender'
  22. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[0].gender'
  23. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[1].gender'
  24.  
  25. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[].picture'
  26. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[].picture|keys'
  27. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[].picture.large'
  28.  
  29. wget "https://randomuser.me/api/?results=2" -qO-|jq '.results[]|(.name.first,.picture.large)'
  30.  
  31. #fitler results
  32. wget "https://randomuser.me/api/?results=20" -qO-|jq '.results[]|select(.gender=="female")'
  33. wget "https://randomuser.me/api/?results=20" -qO-|jq '.results[]|select(.gender=="female")|(.picture.large)'
Add Comment
Please, Sign In to add comment