ercumentlacin / Weather-App-With-Web-Scrapping

This application is a simple weather app that uses web scrapping to get the weather data from the website

Home Page:https://weather-app-elacin.herokuapp.com/api/ankara

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weather App With Web Scrapping

This application is a simple weather app that uses web scrapping to get the weather data from the website Hava durumu 15 gunluk.

This application is getting the 15 days weather by city name. The city name is getting from the user input.

The purpose of this application is to show how to use web scrapping in a simple way. Because people are do not have to deal with the API's and they can get the data from the website.

Installation

Use the package manager npm to install the dependencies.

npm install
npm run api

Usage

Your frontend application will fetch the data from the backend application.

const response = await fetch('http://localhost:8080/api/:cityName');
const data = await response.json();

or

const response = await fetch(
  'https://weather-app-elacin.herokuapp.com/api/:cityName'
);
const data = await response.json();

Response data type is an array of objects.

const data = [
  {
    date: '2022-09-18',
    day: 'Pazar',
    imgSrc: '/images/imgs/2.jpg',
    description: 'Az Bulutlu',
    degrees: {
      morning: '33°C',
      night: '17°C',
    },
  },
];

To use the image, you have to add the image path. For example:

<img src="https://www.havadurumu15gunluk.net${data.imgSrc}" alt="...">

About

This application is a simple weather app that uses web scrapping to get the weather data from the website

https://weather-app-elacin.herokuapp.com/api/ankara


Languages

Language:TypeScript 98.9%Language:JavaScript 1.0%Language:Procfile 0.1%