diff --git a/New_APIs/Zomato API/README.md b/New_APIs/Zomato API/README.md new file mode 100644 index 0000000..2c06697 --- /dev/null +++ b/New_APIs/Zomato API/README.md @@ -0,0 +1,14 @@ +# Zomato API Viewer App + +A simple web application to interact with the Zomato API and display restaurant data. + +## Features +- Fetch and display random restaurant details + +## Installation +1. Clone the repository: + ```bash + git clone https://github.com/username/ZomatoAPIApp.git + +## Contributor +### Revanth \ No newline at end of file diff --git a/New_APIs/Zomato API/index.html b/New_APIs/Zomato API/index.html new file mode 100644 index 0000000..59d276d --- /dev/null +++ b/New_APIs/Zomato API/index.html @@ -0,0 +1,25 @@ + + +
+ + + +Cuisine: ${restaurant.cuisines}
+Address: ${restaurant.location.address}
+Rating: ${restaurant.user_rating.aggregate_rating} (${restaurant.user_rating.rating_text})
+Cost for Two: ${restaurant.currency} ${restaurant.average_cost_for_two}
+ View on Zomato + `; +} + +function displayError(message) { + const restaurantDiv = document.getElementById('restaurant'); + restaurantDiv.innerHTML = `${message}
`; +} diff --git a/New_APIs/Zomato API/package-lock.json b/New_APIs/Zomato API/package-lock.json new file mode 100644 index 0000000..e6bb010 --- /dev/null +++ b/New_APIs/Zomato API/package-lock.json @@ -0,0 +1,45 @@ +{ + "name": "zomato-api-app", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-G7fYv8zS0D7ftu3gnLsOniwhgLU4k9v+1NEtFPP07/Oa8XJ51FtdUKLqIvsTcZo5ua23NO4s9Hr77BM19DOf1g==", + "requires": { + "accepts": "1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.6", + "qs": "6.7.0", + "range-parser": "1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "1.5.0", + "type-is": "1.6.18", + "utils-merge": "1.0.1", + "vary": "1.1.2" + } + } + } + } + \ No newline at end of file diff --git a/New_APIs/Zomato API/package.json b/New_APIs/Zomato API/package.json new file mode 100644 index 0000000..5b44cd2 --- /dev/null +++ b/New_APIs/Zomato API/package.json @@ -0,0 +1,15 @@ +{ + "name": "zomato-api-app", + "version": "1.0.0", + "description": "A simple app to view restaurant data from the Zomato API", + "main": "index.js", + "scripts": { + "start": "node server.js" + }, + "author": "Revanth", + "license": "ISC", + "dependencies": { + "express": "^4.17.1" + } + } + \ No newline at end of file diff --git a/New_APIs/Zomato API/style.css b/New_APIs/Zomato API/style.css new file mode 100644 index 0000000..1119f11 --- /dev/null +++ b/New_APIs/Zomato API/style.css @@ -0,0 +1,70 @@ +body { + font-family: 'Arial', sans-serif; + background: linear-gradient(135deg, #ff8c00, #ffc107); + color: #333; + margin: 0; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 100vh; +} + +header { + text-align: center; + margin-bottom: 20px; +} + +header h1 { + font-size: 3em; + color: #fff; +} + +main { + background: rgba(255, 255, 255, 0.9); + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + text-align: center; +} + +section { + margin-bottom: 20px; +} + +h2 { + font-size: 2em; + margin-bottom: 10px; + color: #ff8c00; +} + +button { + padding: 10px 20px; + font-size: 1em; + color: #fff; + background-color: #ff8c00; + border: none; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; +} + +button:hover { + background-color: #e07b00; +} + +#restaurant-info { + margin-top: 20px; +} + +#restaurant { + font-size: 1.2em; + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +#restaurant p { + margin: 10px 0; +}