diff --git a/omweather-hko-gov-hk-stations-db/examples/englishwx2.htm b/omweather-hko-gov-hk-stations-db/examples/englishwx2.htm new file mode 100644 index 000000000..be834974b --- /dev/null +++ b/omweather-hko-gov-hk-stations-db/examples/englishwx2.htm @@ -0,0 +1,84 @@ + + + +Current Weather + + + + + + + + + + + +

Hong Kong Observatory Logo

+

Current Weather

+Bulletin updated at 09:02 HKT 12/Jul/2013 +

+ +
+At 9 a.m. at Hong Kong Observatory :
+Air Temperature : 28 degrees Celsius
+Relative Humidity : 82 per cent
+Weather Cartoon : No. 50 - SUNNY 
+
+During the past hour the mean UV Index recorded at King's Park : 3
+Intensity of UV radiation : moderate
+   
+Please be reminded that:
+
+The Very Hot Weather Warning is now in force. Hot weather
+might cause adverse health effects. Members of the public
+should take care to avoid heatstroke.
+
+ 
+
+The air temperatures at other places were:
+
+King's Park                     29 degrees;
+Wong Chuk Hang                  30 degrees;
+Ta Kwu Ling                     30 degrees;
+Lau Fau Shan                    29 degrees;
+Tai Po                          29 degrees;
+Sha Tin                         30 degrees;
+Tuen Mun                        31 degrees;
+Tseung Kwan O                   30 degrees;
+Sai Kung                        31 degrees;
+Cheung Chau                     29 degrees;
+Chek Lap Kok                    30 degrees;
+Tsing Yi                        29 degrees;
+Shek Kong                       30 degrees;
+Tsuen Wan Ho Koon               28 degrees;
+Tsuen Wan Shing Mun Valley      30 degrees;
+Hong Kong Park                  29 degrees;
+Shau Kei Wan                    30 degrees;
+Kowloon City                    31 degrees;
+Happy Valley                    31 degrees;
+Wong Tai Sin                    31 degrees;
+Stanley                         30 degrees;
+Kwun Tong                       30 degrees;
+Sham Shui Po                    30 degrees.
+
+Between midnight and 9 a.m. the minimum temperature was 27.5
+degrees Celsius at the Hong Kong Observatory.
+
+
+ +
+| Copyright and Disclaimer | Home | +Chinese Version / 中文版本 | Current Weather Report RSS |
+ + + \ No newline at end of file diff --git a/omweather-hko-gov-hk-stations-db/examples/nday.htm b/omweather-hko-gov-hk-stations-db/examples/nday.htm new file mode 100644 index 000000000..769dae762 --- /dev/null +++ b/omweather-hko-gov-hk-stations-db/examples/nday.htm @@ -0,0 +1,111 @@ + + + +7-day Weather Forecast + + + + + + + + + + + +

Hong Kong Observatory Logo

+

7-day Weather Forecast

+

Bulletin updated at 06:45 HKT 12/Jul/2013

+ +
+7-Day Weather Forecast
+
+General Situation:
+As Severe Typhoon Soulik edges closer to the vicinity of
+Taiwan, its outer subsiding air and the continental
+airstream will bring hazy and very hot weather to Guangdong
+today and tomorrow. Under the influence of a maritime
+airstream, there will be showers over the coastal areas of
+Guangdong early next week.
+
+Date/Month 12/7 (Friday)
+Wind: West force 2 to 3.
+Weather: Fine and very hot. Isolated showers and some haze
+later.
+Temp Range: 27 - 34 C
+R.H. Range: 60 - 90 Per Cent
+
+Date/Month 13/7(Saturday)
+Wind: West to southwest force 4.
+Weather: Mainly fine and very hot with some haze. A few
+showers later.
+Temp Range: 28 - 33 C
+R.H. Range: 60 - 90 Per Cent
+
+Date/Month 14/7(Sunday)
+Wind: South to southwest force 4.
+Weather: A few showers. Sunny intervals during the day.
+Temp Range: 27 - 31 C
+R.H. Range: 70 - 90 Per Cent
+
+Date/Month 15/7(Monday)
+Wind: South to southeast force 3.
+Weather: Hot with sunny periods. A few showers.
+Temp Range: 28 - 32 C
+R.H. Range: 70 - 90 Per Cent
+
+Date/Month 16/7(Tuesday)
+Wind: Southeast force 3.
+Weather: A few showers. Sunny intervals during the day.
+Temp Range: 27 - 31 C
+R.H. Range: 75 - 95 Per Cent
+
+Date/Month 17/7(Wednesday)
+Wind: Southeast force 3.
+Weather: Hot with sunny periods. A few showers.
+Temp Range: 28 - 32 C
+R.H. Range: 70 - 90 Per Cent
+
+Date/Month 18/7(Thursday)
+Wind: Southeast force 3.
+Weather: Mainly fine and hot apart from one or two isolated
+showers.
+Temp Range: 28 - 32 C
+R.H. Range: 65 - 90 Per Cent
+
+Sea surface temperature at 2 p.m.11/7/2013 at North Point
+was 26.5 degrees C.
+
+Soil temperatures at 7 a.m.11/7/2013 at the Hong Kong
+Observatory:
+0.5 M below surface was 29.8 degrees C.
+1.0 M below surface was 29.2 degrees C.
+
+Weather Cartoons for 7-day weather forecast
+Day 1 cartoon no. 90 - Hot
+Day 2 cartoon no. 90 - Hot
+Day 3 cartoon no. 54 - Sunny Intervals with Showers
+Day 4 cartoon no. 53 - Sunny Periods with A Few Showers
+Day 5 cartoon no. 54 - Sunny Intervals with Showers
+Day 6 cartoon no. 53 - Sunny Periods with A Few Showers
+Day 7 cartoon no. 51 - SUNNY PERIODS
+
+ + +
+| Copyright and Disclaimer | Home | +Chinese Version / 中文版本 | 7-day Weather Forecast RSS |
+ + + + \ No newline at end of file diff --git a/omweather-hko-gov-hk-stations-db/omweather-hko-gov-hk-stations-db.pro b/omweather-hko-gov-hk-stations-db/omweather-hko-gov-hk-stations-db.pro index c2832834f..48c4fb11b 100644 --- a/omweather-hko-gov-hk-stations-db/omweather-hko-gov-hk-stations-db.pro +++ b/omweather-hko-gov-hk-stations-db/omweather-hko-gov-hk-stations-db.pro @@ -24,17 +24,17 @@ OTHER_FILES += \ CONFIG = link_pkgconfig -qt PKGCONFIG += libxml-2.0 -system(pkg-config --exists glib-2.0){ - PKGCONFIG += glib-2.0 - message(GLIB-2.0 is exist) - CONFIG += -qt - DEFINES += GLIB -}else{ - message(GLIB-2.0 is not exist) +#system(pkg-config --exists glib-2.0){ +# PKGCONFIG += glib-2.0 +# message(GLIB-2.0 is exist) +# CONFIG += -qt +# DEFINES += GLIB +#}else{ +# message(GLIB-2.0 is not exist) CONFIG += qt QT += core - DEFINES += QT -} +# DEFINES += QT +#} db.files = data/hko.gov.hk.db diff --git a/omweather-hko-gov-hk-stations-db/src/hash.cpp b/omweather-hko-gov-hk-stations-db/src/hash.cpp index a945190b8..11d3c798b 100644 --- a/omweather-hko-gov-hk-stations-db/src/hash.cpp +++ b/omweather-hko-gov-hk-stations-db/src/hash.cpp @@ -1,7 +1,7 @@ /* vim: set sw=4 ts=4 et: */ /* This file is part of Other Maemo Weather(omweather) - MeeCast * - * Copyright (C) 2012 Vlad Vasilyeu + * Copyright (C) 2012 - 2013 Vlad Vasilyeu * for the code * * Copyright (C) 2008 Andrew Zhilin @@ -33,6 +33,14 @@ #undef DEBUGFUNCTIONCALL #endif +xmlHashTablePtr +hash_icons_hko_table_create(){ + xmlHashTablePtr hash; + hash = xmlHashCreate(6); +#include "hash_icons.data" + return hash; +} + #ifdef GLIB /*******************************************************************************/ GHashTable *hash_hko_table_create(void) { diff --git a/omweather-hko-gov-hk-stations-db/src/hash.h b/omweather-hko-gov-hk-stations-db/src/hash.h index 152b9b381..f4d104052 100644 --- a/omweather-hko-gov-hk-stations-db/src/hash.h +++ b/omweather-hko-gov-hk-stations-db/src/hash.h @@ -2,7 +2,7 @@ /* * This file is part of Other Maemo Weather(omweather) - MeeCast * - * Copyright (C) 2012 Vlad Vasilyeu + * Copyright (C) 2012- 2013 Vlad Vasilyeu * for the code * * Copyright (C) 2008 Andrew Zhilin @@ -28,6 +28,10 @@ #ifndef _hash_h #define _hash_h 1 /*******************************************************************************/ + +#include +#include +xmlHashTablePtr hash_icons_hko_table_create(); #ifdef GLIB GHashTable* hash_hko_table_create(void); gpointer hash_hko_table_find(GHashTable *hash, gpointer key, gboolean search_short_name); diff --git a/omweather-hko-gov-hk-stations-db/src/hash_icons.data b/omweather-hko-gov-hk-stations-db/src/hash_icons.data index fe49a2d83..7ab45e9f4 100644 --- a/omweather-hko-gov-hk-stations-db/src/hash_icons.data +++ b/omweather-hko-gov-hk-stations-db/src/hash_icons.data @@ -7,6 +7,7 @@ #endif + #define hash_insert(hash, s2, s3) xmlHashAddEntry(hash, (const xmlChar *)s2, (void *)strdup(s3)); hash_insert(hash, "62", "11"); hash_insert(hash, "63", "11"); hash_insert(hash, "53", "39"); diff --git a/omweather-hko-gov-hk-stations-db/src/meego-main.cpp b/omweather-hko-gov-hk-stations-db/src/meego-main.cpp index da3c9d414..a23808cee 100644 --- a/omweather-hko-gov-hk-stations-db/src/meego-main.cpp +++ b/omweather-hko-gov-hk-stations-db/src/meego-main.cpp @@ -2,7 +2,7 @@ /* * This file is part of omweather-hko-gov-hk-stations-db - MeeCast * - * Copyright (C) 2012 Vlad Vasilyeu + * Copyright (C) 2012 - 2013 Vlad Vasilyeu * for the code * * This software is free software; you can redistribute it and/or @@ -38,7 +38,7 @@ static QHash *hash_for_icons; QHash *hash_hko_table_create(void); #endif - +static xmlHashTablePtr hash_for_icons; /*******************************************************************************/ #ifdef GLIB gchar* @@ -97,7 +97,7 @@ parse_forecast_weather(const char *detail_path_data, const char *result_file){ if (strstr(buffer,"Weather Cartoons for 7-day weather forecast")) break; } - hash_for_icons = hash_hko_table_create(); + hash_for_icons = hash_icons_hko_table_create(); while(fgets(buffer, sizeof(buffer), file_in)){ if (strstr(buffer,"Bulletin updated")) @@ -231,7 +231,7 @@ parse_current_weather(const char *detail_path_data, const char *result_file){ if (!file_in) return; - hash_for_icons = hash_hko_table_create(); + hash_for_icons = hash_icons_hko_table_create(); while(fgets(buffer, sizeof(buffer), file_in)){ if (strstr(buffer,"Bulletin updated")) if (comma = strstr(buffer, "at ")){ diff --git a/omweather-hko-gov-hk-stations-db/src/meego-main.h b/omweather-hko-gov-hk-stations-db/src/meego-main.h index d4c6d4d2d..0d4d97af5 100644 --- a/omweather-hko-gov-hk-stations-db/src/meego-main.h +++ b/omweather-hko-gov-hk-stations-db/src/meego-main.h @@ -40,6 +40,7 @@ #include #include #include +#include "hash.h" /*******************************************************************************/ int source_init(void); diff --git a/omweather-hko-gov-hk-stations-db/test.sh b/omweather-hko-gov-hk-stations-db/test.sh new file mode 100755 index 000000000..130282980 --- /dev/null +++ b/omweather-hko-gov-hk-stations-db/test.sh @@ -0,0 +1,2 @@ +#!/bin/bash + ./hkogovhk ./examples/nday.htm ./examples/out.xml ./examples/englishwx2.htm