Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Eugene-Chatbot/Visualize recipe nutrition.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
28 lines (20 sloc)
785 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#code so we can visualise the nutrient information of a recipe using the spoonacular api documentation | |
import discord | |
from discord.ext import commands | |
client.run = ('NjM1NDY4MDIwNzM4OTQ5MTIw.XaxfwA.Pb6TxUeIHEhvAaiC7_M5VbecIH8') | |
var unirest = require("unirest"); | |
var req = unirest("POST", "https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/visualizeNutrition"); | |
req.headers({ | |
"x-rapidapi-host": "spoonacular-recipe-food-nutrition-v1.p.rapidapi.com", | |
"x-rapidapi-key": "SIGN-UP-FOR-KEY", | |
"accept": "text/html", | |
"content-type": "application/x-www-form-urlencoded" | |
}); | |
req.form({ | |
"ingredientList": "3 oz flour", | |
"servings": "2" | |
}); | |
req.end(function (res) { | |
if (res.error) throw new Error(res.error); | |
console.log(res.body); | |
}); |