Git Product home page Git Product logo

getweather's Introduction

This application scrapes the metservice.com website every half an hour for the current temperature with and without windchill, before storing it in an SQL database.

To run this you will need python2.7, sqlite3 and scrapy:

http://doc.scrapy.org/en/latest/intro/install.html#intro-install

Run.py is executed, it uses multiprocessing to start a process which sleeps for half an hour at a time before executing the scrapy shell with a spider targeting the metservice website. This is to save on processing power but also allow user input to quit the application or see how much time is left until the next scrape.

Much more information can be gathered, just modify the wget_spider.py script and the weather_data.db to store the required data. If you want it to point to another location you will have to look for it using your web browsers developer tools while loading the correct metserivce page (it will be named similiarly to metservice.com/publicdata/localObs_porirua). If you're into web scraping at all this won't be hard for you.

The scrapy script recieves a json module in response to GET query and just parses it for the temperature data, and then enters it into the sql data base called weather_data.db.

It's very lightweight, designed to run on a small webserver so that the data from the sql database could be displayed dynamically via a webpage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.