Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lauti7/image-extractor-api
Given the URL of the page, list all the images that are being used and allow the user to download them.
https://github.com/lauti7/image-extractor-api
express nodejs scrapping typescript
Last synced: 23 days ago
JSON representation
Given the URL of the page, list all the images that are being used and allow the user to download them.
- Host: GitHub
- URL: https://github.com/lauti7/image-extractor-api
- Owner: lauti7
- License: mit
- Created: 2021-08-24T15:39:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-24T12:47:22.000Z (over 2 years ago)
- Last Synced: 2024-11-05T17:58:38.377Z (2 months ago)
- Topics: express, nodejs, scrapping, typescript
- Language: TypeScript
- Homepage:
- Size: 210 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Image Extractor - API [![Build Status](https://app.travis-ci.com/lauti7/image-extractor-api.svg?branch=main)](https://app.travis-ci.com/lauti7/image-extractor-api)
API for [Image Extractor - Client](https://github.com/lauti7/image-extractor-client)
Given the URL of the page, list all the images that are being used and allow the user to download them.
API is online [here](https://image-extractor-api.herokuapp.com/api/status) and its browser client is online [here](https://lauti7.github.io/image-extractor-client/)
## Built with:
Typescript, Express, and Cheerio (will be replaced for Puppeteer). I am using TravisCI for CI/CD
## API allows user to:
- Get all images from any public website (server side render).
- Download an image from its link## API:
### Get all images links from website
#### Request
`POST /api/extract/`
#### Response
Array of links
{"images": []}
### Download single image
#### Request
`GET /api/download/single?weburl={IMAGE_LINK}`
#### Response
Returns the image. If you make a request from your browser, the image will be displayed.
In order to force downloading:
#### Request
`GET /api/download/single?weburl={IMAGE_LINK}&forceDownload=true`
#### Response
Image will be automatically downloaded.
## Instalation
You should have Node JS and NPM installed on your PC.
```bash
git clone https://github.com/lauti7/image-extractor-api.git
``````bash
cd image-extractor-api
``````bash
npm install
``````bash
touch .envvim .env
NODE_ENV=development
PORT={YOUR_PORT}```
## TODOs:
- [ ] Replace Cheerio for Puppeteer.
- [x] Support for client side render sites.
- [x] Add endpoints for downloading scrapped images.
- [ ] Allow users to download an optimized version of each scrapped image.
- [x] Add tests.
- [ ] Add Redis cache.
- [ ] Dockerize it.