[go: up one dir, main page]

Skip to content

Weather web scraping script for my dad, but in C++๐ŸŒฆ๐Ÿ’จ๐Ÿƒ

License

Notifications You must be signed in to change notification settings

Hornflakes/cpp-weather-scraping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

fast-weather-scraping

This repo contains a weather web scraping C++ script (code and .bat) I made for my dad.

He records and analyzes weather data for our orchard. ๐Ÿ‡๐ŸŒณ๐Ÿ๐Ÿ‘๐ŸŽ๐Ÿ’

Original Python version repo ๐Ÿ

This C++ version is also an attempt at adopting (dys)functional programming principles.

What does it do?

  • extracts weather data from freemeteo.ro
  • exports the data into Excel

Setup

Make sure the excel files are in the same folder from which you run the script (be it .exe or .bat).

Dev:

ย ย ย ย ย ย  I used MinGW64 and MSYS2.

ย ย ย ย ย ย  Install packages: curl gumbo xlnt

ย ย ย ย ย ย  Compile to .exe: g++ -o weather_script main.cc -lcurl -lgumbo -lxlnt

ย ย ย ย ย ย  or use your preferred build system

User:

  1. download Weather_Scraping.zip from Releases

    or copy what's inside the dist folder

  2. replace weather_data.xlsx with your own excel

    or use it (skip the next 2 steps)

  3. add the date (dd.mm.yyyy) after which you want to get data

  4. update config.xlsx

    • your excel name
    • your sheet name
    • the letter(s) header of the first (date) column
  5. run weather_script.bat and wait for the console window to close

  6. PROFIT ๐Ÿ“ˆ๐Ÿ“ˆ๐Ÿ“ˆ

The CA certificate for the data request can expire. In that case, you can replace it.

The certificate is in the certs folder. You can download certificates here.

About

Weather web scraping script for my dad, but in C++๐ŸŒฆ๐Ÿ’จ๐Ÿƒ

Topics

Resources

License

Stars

Watchers

Forks

Languages