Skip to content

Commit

Permalink
feat: add supported-hosts api
Browse files Browse the repository at this point in the history
  • Loading branch information
steve192 committed Jan 23, 2022
1 parent bbbf7b1 commit d0b6620
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
23 changes: 22 additions & 1 deletion README.md
Expand Up @@ -28,7 +28,7 @@ services:

### Routes
```GET /api/v1/scrape-recipe?url=<url to your recipe>```\
responds with
responds with a recipe
```json
{
"author": "AuthorHere",
Expand Down Expand Up @@ -59,3 +59,24 @@ responds with
}

```

```GET /api/v1/scrape-recipe/supported-hosts```\
responds with a list of supported hosts
```json
[
"acouplecooks.com",
"claudia.abril.com.br",
"afghankitchenrecipes.com",
"allrecipes.com",
"alltommat.se",
"amazingribs.com",
.
.
.
"yemek.com",
"yummly.com",
"zeit.de",
"zenbelly.com"
]

```
7 changes: 6 additions & 1 deletion src/app.py
@@ -1,5 +1,5 @@
from flask import Flask, jsonify, request
from recipe_scrapers import scrape_me
from recipe_scrapers import scrape_me, SCRAPERS
import logging


Expand All @@ -11,6 +11,11 @@
app.run(debug=False, host='0.0.0.0')


@app.get("/api/v1/scrape-recipe/supported-hosts")
def get_supported_hosts():
return jsonify(list(SCRAPERS.keys())), 200


@app.get("/api/v1/scrape-recipe")
def import_recipe():
scrape_url = request.args.get("url")
Expand Down

0 comments on commit d0b6620

Please sign in to comment.