diff --git a/Existing_API_Collection/GameOfThrones_API/README.md b/Existing_API_Collection/GameOfThrones_API/README.md new file mode 100644 index 00000000..4bd72627 --- /dev/null +++ b/Existing_API_Collection/GameOfThrones_API/README.md @@ -0,0 +1,11 @@ +Game Of Thrones_API: +-This API generate random quotes from the series Game Of Thrones. + + +Implementation: +-The JavaScript code contains an HTTP request to the API, it fetches quotes from api and show it to users. + +Tech Stacks used: + - HTML (frontend) + - CSS (styling) + - Javascript (API Implementation) diff --git a/Existing_API_Collection/GameOfThrones_API/app.js b/Existing_API_Collection/GameOfThrones_API/app.js new file mode 100644 index 00000000..6852dbdb --- /dev/null +++ b/Existing_API_Collection/GameOfThrones_API/app.js @@ -0,0 +1,16 @@ +document.addEventListener("DOMContentLoaded", function() { + const quoteElement = document.getElementById("quote"); + const getQuoteBtn = document.getElementById("getQuoteBtn"); + + getQuoteBtn.addEventListener("click", function() { + fetch('https://api.gameofthronesquotes.xyz/v1/random') + .then(response => response.json()) + .then(data => { + quoteElement.textContent = '"' + data.sentence + '"'; + }) + .catch(error => { + console.error('Error fetching quote:', error); + quoteElement.textContent = 'Failed to fetch quote. Please try again later.'; + }); + }); +}); diff --git a/Existing_API_Collection/GameOfThrones_API/index.html b/Existing_API_Collection/GameOfThrones_API/index.html new file mode 100644 index 00000000..0d20e1a4 --- /dev/null +++ b/Existing_API_Collection/GameOfThrones_API/index.html @@ -0,0 +1,59 @@ + + + + + + Game of Thrones + + + +

Game of Thrones

+ + +
+ Game of Thrones +
+ +
+

Click the button below to get a random quote from the Game of Thrones series.

+ + + + + diff --git a/Existing_API_Collection/README.md b/Existing_API_Collection/README.md index f3630788..e93bd675 100644 --- a/Existing_API_Collection/README.md +++ b/Existing_API_Collection/README.md @@ -25,6 +25,7 @@ |[GeoAPI](./GeoAPI/)| GeoAPI is a simple RESTful API that allows you to convert addresses to geographic coordinates (latitude and longitude) and vice versa. This API is built using Node.js and Express.| |[Books API](./Books_API/)| The Google Books API allows developers to access a wealth of information about books, including their titles, authors, publishers, publication dates, and descriptions. | |[Currency Converter API](./Currency_Converter_API/)| Currency_Converter is a simple RESTful API that allows you to convert currency values to different currency| +|[Game Of Throne API](./GameOfThrone_API/)| Game Of Throne_API is a simple RESTful API that generates random quotes from the series| |[Brewery_API](./Brewery_API/)| Brewery Finder API is designed to help you explore the world of breweries by providing detailed information about various breweries across different states.| |[CoinGecko API](./CoinGecko_API/)| This API is use to fetch Top 100 Crypto Currencies and display comprehensive data about them with market capital, price etc.| |[Gemini API](./Gemini_API/)| The Google Gemini API is a powerful tool that leverages cutting-edge generative AI models to assist developers and businesses in various tasks. It provides functionalities such as text generation, content creation, and creative assistance.|