Skip to content

Commit

Permalink
began omweather-hko-gov-hk-stations-db
Browse files Browse the repository at this point in the history
  • Loading branch information
vasvlad committed Apr 28, 2012
1 parent 8008682 commit 8baf228
Show file tree
Hide file tree
Showing 13 changed files with 1,172 additions and 0 deletions.
1 change: 1 addition & 0 deletions omweather-hko-gov-hk-stations-db/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Vlad Vasilyeu <[email protected]>
5 changes: 5 additions & 0 deletions omweather-hko-gov-hk-stations-db/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
You will need Maemo/Meego/Tizen develoment environment to build deb-package




30 changes: 30 additions & 0 deletions omweather-hko-gov-hk-stations-db/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# vim: set sw=4 ts=4 et:
#
# This file is part of omweather-hko-gov-hk-source
#
# Copyright (C) 2012 Vlad Vasilyeu
# for the code
#
# This software is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this software; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

SUBDIRS = src data

EXTRA_DIST = autogen.sh \
debian/changelog \
debian/compat \
debian/copyright \
debian/control \
debian/rules
3 changes: 3 additions & 0 deletions omweather-hko-gov-hk-stations-db/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OMWeather(MeeCast) hko.gov.hk source library

Copyright(c) 2012 Vlad Vasilyeu
Binary file not shown.
12 changes: 12 additions & 0 deletions omweather-hko-gov-hk-stations-db/data/hko.gov.hk.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<source xmlns="https://garage.maemo.org/projects/omweather/">
<name>hko.gov.hk</name>
<logo>foreca.com.png</logo>
<base>hko.gov.hk.db</base>
<forecast url="http://www.hko.gov.hk/textonly/forecast/nday.htm" />
<detail url="http://www.hko.gov.hk/textonly/forecast/englishwx2.htm" />
<search url="http://xoap.weather.com/search/search?where=%s" />
<library>libomweather-hko-gov-hk-source.so</library>
<binary>/opt/com.meecast.omweather/lib/hkogovhk</binary>
<showurl url="http://www.hko.gov.hk/contente.htm" />
</source>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#-------------------------------------------------
#
# Project created by QtCreator 2010-11-03T21:01:40
#
#-------------------------------------------------


TARGET = hkogovhk
TEMPLATE = app



HEADERS += src/meego-main.h \
src/hash.h

SOURCES += src/meego-main.c \
src/hash.c

FORMS +=

OTHER_FILES += \


CONFIG = link_pkgconfig -qt
PKGCONFIG += libxml-2.0 \
glib-2.0

db.files = data/=hko.gov.hk.db
db.path = /opt/com.meecast.omweather/share/db/

source.files = data/hko.gov.hk.xml
source.path = /opt/com.meecast.omweather/share/sources/

#install
target.path = /opt/com.meecast.omweather/lib
INSTALLS += target db source


75 changes: 75 additions & 0 deletions omweather-hko-gov-hk-stations-db/src/englishwx2.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<HTML>
<HEAD>
<TITLE>Current Weather</TITLE>
<META http-equiv="Content-Type" content="text/html; CHARSET=Big5-HKSCS">
<meta name="Page Description" content="Current Weather" />
<meta name="Page Keywords" content="Current Weather" />

</HEAD>
<BODY bgcolor="#FFFFFF">
<link rel="SHORTCUT ICON" href="/Logo.ico">
<p align="center"><img src="../../images_e/logo_dblue.gif" alt="Hong Kong Observatory Logo" width="333" height="65">
<h1 align="center">Current Weather</h1><p>
<I>Bulletin updated at 23:02 HKT 28/Apr/2012</I>
</p>
<!--Current Weather-->
<pre>
At 11 p.m. at Hong Kong Observatory :
Air Temperature : 25 degrees Celsius
Relative Humidity : 97 per cent
Weather Cartoon : No. 62 - LIGHT RAIN


The air temperatures at other places were:

King's Park 25 degrees;
Wong Chuk Hang 26 degrees;
Ta Kwu Ling 24 degrees;
Lau Fau Shan 26 degrees;
Tai Po 24 degrees;
Sha Tin 25 degrees;
Tuen Mun 25 degrees;
Tseung Kwan O 24 degrees;
Sai Kung 24 degrees;
Cheung Chau 24 degrees;
Chek Lap Kok 27 degrees;
Tsing Yi 25 degrees;
Shek Kong 27 degrees;
Tsuen Wan Ho Koon 24 degrees;
Tsuen Wan Shing Mun Valley 25 degrees;
Hong Kong Park 25 degrees;
Shau Kei Wan 24 degrees;
Kowloon City 25 degrees;
Happy Valley 27 degrees;
Wong Tai Sin 26 degrees;
Stanley 25 degrees;
Kwun Tong 25 degrees;
Sham Shui Po 25 degrees.

Between 9:45 and 10:45 p.m., the maximum rainfall recorded
in various regions were:

Sha Tin 4 mm;
Tuen Mun 3 mm;
Eastern District 2 mm;
Kowloon East 2 mm;
Kowloon West 2 mm;
Lantau Island 2 mm;
Sai Kung 2 mm;
Southern District 2 mm;
Wan Chai 2 mm;
Yuen Long 2 mm;
Central & Western District 1 mm;
Kwai Tsing 1 mm;
North District 1 mm;
Tsuen Wan 1 mm.

</pre>
<!--/Current Weather-->
<hr>
| <a href="../readme.htm">Copyright and Disclaimer</a> | <a href="../index.htm">Home</a> |
<a href="chinesewx2.htm">Chinese Version / ¤¤¤åª©¥»</a> | <a href="http://rss.weather.gov.hk/rss/CurrentWeather.xml"><img src="/img/rss3.gif" alt="Current Weather Report RSS" border="0"/></a> | <br/>
<link rel="alternate" type="application/rss+xml" title="Current Weather Report" href="http://rss.weather.gov.hk/rss/CurrentWeather.xml">

</BODY>
</HTML>
73 changes: 73 additions & 0 deletions omweather-hko-gov-hk-stations-db/src/hash.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/* vim: set sw=4 ts=4 et: */
/* This file is part of Other Maemo Weather(omweather)
*
* Copyright (C) 2011 Vlad Vasiliev
* for the code
*
* Copyright (C) 2008 Andrew Zhilin
* [email protected]
* for default icon set (Glance)
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#include <glib.h>
#include <stdio.h>
#include "hash.h"
#ifdef RELEASE
#undef DEBUGFUNCTIONCALL
#endif
/*******************************************************************************/
GHashTable *hash_icons_forecacom_table_create(void) {
GHashTable *hash = NULL;
#ifdef DEBUGFUNCTIONCALL
START_FUNCTION;
#endif
hash = g_hash_table_new(g_str_hash, g_str_equal);
#include "hash_icons.data"
return hash;
}

/*******************************************************************************/
gpointer
hash_forecacom_table_find(GHashTable *hash, gpointer key, gboolean search_short_name) {
gpointer orig_key, search_text,
value = NULL,
result = NULL;
gchar buffer[512];
#ifdef DEBUGFUNCTIONCALL
START_FUNCTION;
#endif
if (search_short_name) {
buffer[0] = 0;
snprintf(buffer, sizeof(buffer) - 1, "%s_short", (gchar *)key);
search_text = buffer;
} else
search_text = key;
if (g_hash_table_lookup_extended(hash,
search_text, &orig_key, &value))
result = value;
else{
result = key;
fprintf(stderr,"Not found %s\n",(gchar *)key);
}
#ifdef DEBUGFUNCTIONCALL
END_FUNCTION;
#endif
return result;
}

/*******************************************************************************/
35 changes: 35 additions & 0 deletions omweather-hko-gov-hk-stations-db/src/hash.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* vim: set sw=4 ts=4 et: */
/*
* This file is part of Other Maemo Weather(omweather)
*
* Copyright (C) 2012 Vlad Vasilyeu
* for the code
*
* Copyright (C) 2008 Andrew Zhilin
* [email protected]
* for default icon set (Glance)
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
/*******************************************************************************/
#ifndef _hash_h
#define _hash_h 1
/*******************************************************************************/
/*******************************************************************************/
GHashTable* hash_icons_forecacom_table_create(void);
gpointer hash_forecacom_table_find(GHashTable *hash, gpointer key, gboolean search_short_name);
/*******************************************************************************/
#endif
56 changes: 56 additions & 0 deletions omweather-hko-gov-hk-stations-db/src/hash_icons.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

g_hash_table_insert(hash, "d000.png", "32");
g_hash_table_insert(hash, "n000.png", "31");
g_hash_table_insert(hash, "d100.png", "34");
g_hash_table_insert(hash, "n100.png", "33");
g_hash_table_insert(hash, "d210.png", "39");
g_hash_table_insert(hash, "d220.png", "39");
g_hash_table_insert(hash, "d221.png", "5");
g_hash_table_insert(hash, "d222.png", "28");
g_hash_table_insert(hash, "n222.png", "46");
g_hash_table_insert(hash, "n312.png", "13");
g_hash_table_insert(hash, "d412.png", "13");
g_hash_table_insert(hash, "n412.png", "13");
g_hash_table_insert(hash, "d200.png", "28");
g_hash_table_insert(hash, "n200.png", "29");
g_hash_table_insert(hash, "d211.png", "5");
g_hash_table_insert(hash, "d212.png", "28");
g_hash_table_insert(hash, "n432.png", "16");
g_hash_table_insert(hash, "d432.png", "16");
g_hash_table_insert(hash, "d300.png", "26");
g_hash_table_insert(hash, "n300.png", "26");
g_hash_table_insert(hash, "d310.png", "39");
g_hash_table_insert(hash, "d311.png", "5");
g_hash_table_insert(hash, "d312.png", "30");
g_hash_table_insert(hash, "d320.png", "39");
g_hash_table_insert(hash, "d321.png", "5");
g_hash_table_insert(hash, "d322.png", "13");
g_hash_table_insert(hash, "d400.png", "26");
g_hash_table_insert(hash, "n400.png", "26");
g_hash_table_insert(hash, "n410.png", "11");
g_hash_table_insert(hash, "d410.png", "11");
g_hash_table_insert(hash, "d411.png", "5");
g_hash_table_insert(hash, "n411.png", "5");
g_hash_table_insert(hash, "d421.png", "5");
g_hash_table_insert(hash, "d420.png", "11");
g_hash_table_insert(hash, "d422.png", "14");
g_hash_table_insert(hash, "d430.png", "12");
g_hash_table_insert(hash, "d431.png", "5");
g_hash_table_insert(hash, "n431.png", "5");

















Loading

0 comments on commit 8baf228

Please sign in to comment.