NamitYadav / imgur-viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

imgur-gallery

Simple web app that allows one to browse the Imgur gallery using React

  1. Show gallery images in a grid of thumbnails and lazy load them
  2. Show image description in the thumbnail, top or bottom
  3. On clicking an image in the gallery, show its details: big image, title, description, upvotes, downvotes, and score

Filters

  1. Filter the images based on: hot, top, user
  2. Include or exclude viral images from the result set
  3. Filter based on window and sort parameters;

APIs used

Initialise Request
var myHeaders = new Headers();
myHeaders.append("Authorization", "Client-ID {{clientId}}");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};
Get Gallery Images
fetch("https://api.imgur.com/3/gallery/{{section}}/{{sort}}/{{window}}/{{page}}?showViral={{showViral}}&mature={{showMature}}&album_previews={{albumPreviews}}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
Get Image
fetch("https://api.imgur.com/3/image/{{imageHash}}", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

About


Languages

Language:TypeScript 60.5%Language:JavaScript 31.6%Language:HTML 6.6%Language:CSS 1.4%