Skip to content

A JavaScript version of Foodish API to GET a random picture of food dishes.

License

Notifications You must be signed in to change notification settings

surhud004/Foodish_JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍲 Foodish.js 🍛 Website Netlify Status Contributions Welcome

Logo

A JavaScript version of the Foodish API to GET a random picture of food dishes.

Demo

Visit https://foodish-js.netlify.app/

Installation

Step 1

Include the JS scripts in the <head> tag of the HTML -

<script src="https://foodish-js.netlify.app/js/images.js"></script>
<script src="https://foodish-js.netlify.app/js/foodish.js"></script>

Step 2

Add an <img> with id='foodish' to the HTML -

<img id="foodish" alt="foodish" />

Step 3

Add a <script> in the <body> and get a random Foodish with getFoodish() -

<script type="text/javascript">
  getFoodish("random");
</script>

or get a random Foodish from food category -

<script type="text/javascript">
  getFoodish(foodCategory);
</script>

Please visit the demo website to view the list of available food categories.

Example

To get a random burger -

<html>
  <head>
    <script src="https://foodish-js.netlify.app/js/images.js"></script>
    <script src="https://foodish-js.netlify.app/js/foodish.js"></script>
  </head>
  <body>
    <img id="foodish" alt="foodish" />
    <script type="text/javascript">
      getFoodish("burger");
    </script>
  </body>
</html>

Usage

  • You are designing a restaurant website and you want to add random food pictures as placeholders.
  • You are creating a guess the food dish game.
  • You are ordering a pizza but you just want a random choice, visit https://foodish-js.netlify.app/?foodish=pizza because that's fun! Didn't like the pizza? Just hit refresh!
  • You just like to see food pictures (visual hunger) because you eat with your eyes first.
Please note that I do not own any of the Foodish dataset images. All Foodish images and their ownership belong to their original creators.

Support

Please create a new issue for support and issues.

Contributing

Please read the CONTRIBUTING for details on adding images to the Foodish Database.

License

The project is licensed under MIT. Please read the LICENSE for details.


Foodish.js is maintained by surhud004.