Advertisement
renix1

Wallpaperize

Dec 12th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let getWallpaper = (term) => {
  2.     const config = {
  3.         "method": "GET"
  4.     }
  5.  
  6.     const CLIENT_ID = '';
  7.     const url = `https://api.unsplash.com/photos/random?query=${term}&client_id=${CLIENT_ID}`;
  8.  
  9.     fetch(url, config)
  10.         .then(response => {
  11.             response.json()
  12.                 .then(data => {
  13.                     return data.urls.regular;
  14.                 })
  15.         })
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement