Skip to content

This programs is getting of weather from accuweather. And this data store to database(using mysql).

Notifications You must be signed in to change notification settings

kokoax/weatherScripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Installation

Please execute as root user on mariadb.

  • MariaDB> CREATE DATABASE weather;
  • MariaDB> CREATE TABLE weather.daily(HiLo VARCHAR(8), Precip INT(4), Snow INT(4), Icon VARCHAR(4), Cond VARCHAR(64), Avg VARCHAR(8), YMD INT(8));
  • MariaDB> CREATE USER 'weather'@'localhost' IDENTIFIED BY 'weather';
  • MariaDB> GRANT select,update,insert ON weather.daily TO 'weather'@'localhost';

Usage

weatherGetter script

The weatherGetter is getting of weather data from accuweather between from this month first to end. Find city_name from http://www.accuweather.com/en/jp/japan-weather

$ W_CITY=$(city_name) ruby weatherGetter.rb

weather script

The weather is getting of weather data from database got by the weatherGetter.

$ ruby weather.rb -(first option) -(second option)

options

first option

  • date
  -0 is today
  -1 is tomorrow
  -2 ....

second option

  • data's kind
  -day  :  day of specific date
  -lt   :  large temprature of specific date
  -st   :  small temprature of specific date
  -pre  :  precip probability of specific date
  -snow :  snow probability of specific date
  -i    :  number of weather icon in site of accuweather of specific date
  -c    :  weather context of specific date
  -alt  :  average large temprature of specific date
  -ast  :  average small temprature of specific date

Example

$ W_CITY=morioka-shi ruby weatherGetter.rb

When, weather data store to your database(using mysql). After you exec of

$ ruby weather -0 -lt

You will getting of today's large temprature

About

This programs is getting of weather from accuweather. And this data store to database(using mysql).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages