SlideShare a Scribd company logo
1 of 30
Download to read offline
從 hk0weather 到 Open Data, Open Government

    From hk0weather to Open Data, Open
              Government


               Sammy Fung
             BarCampHK 2013

         http://slidesha.re/11ZPKvx
Sammy Fung
●   Blogger: sammy.hk
●   Coder: perl -> php -> python
●   Linux User: server + desktop
●   “Cloud”: OpenStack.
●   Smartphone: iPhone 3G -> Android
●   Organizer: Linux/Open Source Communities
Agenda
●   My Products: WeatherHK, TCTrack
●   My new opensource projects: hk0weather
●   My comments to Open Data and Open
    Government
●   Q&A, Open Discussion to Floor.
My Products
●   WeatherHK
●   TCTrack
WeatherHK
●   http://twitter.com/weatherhk
●   Interview by MetroPop in 2009.
WeatherHK
●   http://twitter.com/weatherhk
●   Backend: Python + Scrapy + Database +
    Twitter + NNTP......
●   Frontend: Twitter + Newsgroup
●   hourly current weather report
●   weather forecast report
●   tropical signal warning
My Products
●   WeatherHK
●   TCTrack
TCTrack
●   http://sammy.hk/projects/tctrack/tctrack.php
●   http://twitter.com/tctrack
●   Plot TC current and forecast tracks over
    Google Map.
●   Tweet JTWC updates for Northwest Pacific.
●   Source: JTWC, HKO.
TCTrack
●   http://sammy.hk/projects/tctrack/tctrack.php
●   http://twitter.com/tctrack
●   Probably first tctrack map in HK using
    GoogleMap
●   Use of GMap: TCTrack -> Weather
    Underground Hong Kong -> HKO
g0v.tw
●   g0v.tw 台灣零時政府
●   clkao 高嘉良 suggested to implement open
    source weather tools for Hong Kong.
hk0weather
●   https://github.com/sammyfung/hk0weather
●   Open Source Hong Kong Weather Project.
●   convert to JSON data from HKO webpages.
●   python + scrapy
●   1st version: from current weather report,
    extracting temperture and humidity from 20+
    weather stations, export in json format.
hk0weather
●   https://github.com/sammyfung/hk0weather
●   $ virtualenv hk0weatherenv
●   $ source hk0weatherenv/bin/activate
●   $ pip install scrapy
●   $ git clone
    https://github.com/sammyfung/hk0weather.git
●   $ cd hk0weather
●   $ scrapy crawl currwx -t json -o testresult
hk0weather
[{"humidity": 80, "station": "hko", "temperture": 17, "time": 1360785720},
{"station": "kingspark", "temperture": 16, "time": 1360785720},
{"station": "wongchukhang", "temperture": 17, "time": 1360785720},
{"station": "takwuling", "temperture": 16, "time": 1360785720},
{"station": "laufaushan", "temperture": 15, "time": 1360785720},
{"station": "taipo", "temperture": 16, "time": 1360785720},
{"station": "shatin", "temperture": 17, "time": 1360785720},
{"station": "tuenmun", "temperture": 17, "time": 1360785720},
{"station": "tseungkwano", "temperture": 16, "time": 1360785720},
{"station": "saikung", "temperture": 16, "time": 1360785720},
{"station": "cheungchau", "temperture": 17, "time": 1360785720},
{"station": "cheungchau", "temperture": 17, "time": 1360785720},
{"station": "tsingyi", "temperture": 17, "time": 1360785720},
{"station": "shekkong", "temperture": 15, "time": 1360785720},
{"station": "tsuenwanhokoon", "temperture": 15, "time": 1360785720},
{"station": "tsuenwanshingmunvalley", "temperture": 17, "time": 1360785720},
{"station": "hongkongpark", "temperture": 17, "time": 1360785720},
{"station": "shaukeiwan", "temperture": 16, "time": 1360785720},
{"station": "kowlooncity", "temperture": 16, "time": 1360785720},
{"station": "happyvalley", "temperture": 18, "time": 1360785720},
{"station": "wongtaisin", "temperture": 17, "time": 1360785720},
{"station": "stanley", "temperture": 16, "time": 1360785720},
{"station": "kwuntong", "temperture": 15, "time": 1360785720},
{"station": "shamshuipo", "temperture": 17, "time": 1360785720}]
hk0weather
●   Future Planning:
●   Add more weather reports.
●   Getting ideas and/or cooperate with 'pro'
    Weather hobbists.
●   Remarks:
●   Development of hk0weather is started from
    ZERO, its code is different than my twitter
    @weatherhk.
Why python + scrapy ?
●   python: my current favourite programming
    language for few years.
●   scrapy: web crawling framework written in
    Python.
Scrapy
●   scrapy: web crawling framework written in
    Python.
●   HtmlXPathSelector
●   Output: built-in JSON, CSV, XML.
●   Python: import re
Items.py
class Hk0WeatherItem(Item):
 time = Field()
 station = Field()
 temperture = Field()
 humidity = Field()
 pass
Items.py
class Hk0WeatherItem(Item):
 time = Field()
 station = Field()
 temperture = Field()
 humidity = Field()
 pass
Currwx.py
 start_urls = (

'http://www.weather.gov.hk/wxinfo/currwx/curr
entc.htm',
 )
Currwx.py
def parse(self, response):
 laststation = ''
 temperture = int()
 stations = []
 hxs = HtmlXPathSelector(response)
 report = hxs.select('//div[@id="ming"]')
libhk0
class hk0:
 stations = [
  (u' 天 文 台 ', 'hko'),
  (u' 京 士 柏 ', 'kingspark'),
  (u' 黃 竹 坑 ', 'wongchukhang'),
  (u' 打 鼓 嶺 ', 'takwuling'),
  (u' 流 浮 山 ', 'laufaushan'),
libhk0
class hk0:
 def gettime(self, report):
  …
 def hk0current(self, report):
  …
Challenge
●   Challenge on first day of hk0weather release.
●   Facebook comment to blog post: 「其實 HKO
    有個年費 plan 係嘔兩個好靚仔嘅 XML 。而只
    要你肯問,你件嘢又非商業用途, HKO 都會免
    費俾你用」
Challenge
●
    I replied after googling for it.
●
    google 找到相關 XML schema 示範資料,但 ....
●
    1. 在於 Open Data 角度,暫時看不到有網頁說明任何人以非商
    業用途使用資訊,可以免費獲得登入戶口。而我本身是「已登
    記」使用 HKO 網頁資料作非商業用途的使用 / 轉載者,我一直收
    到來自 HKO 的更新電郵都是說明 HTML 格式的更新, " 印象中 "
    HKO 並沒有發出過 XML 和邀請開 XML 使用戶口。
●
    2. 而 ( 以我覺得 ) 以業餘氣象發燒友的角度來看,目前 HKO XML
    schema 仍有不足之處,我已想到一些我想要的數據,仍是只能
    從 HTML 版本取得。
●
    Challenge: FAIL! XD
Open Data from Govenment
●   My Chinese Blog Post 「香港政府機構開放資料
    Open Data 情況」 on 2013/1/17.
●   Data.One released on 2011/3/31.
●   Weather at Data.One provides 7 dataset URLs,
    returns RSS (XML) format (Eng/TChi/SChi)
●   One word: Useless.
●   Data.One dataset is different with HKO own
    XML metioned in previous “challenge”.
Open Data from Govenment
●   Example - Current local weather report:
●   Plain text report in RSS.
●   Difference to quote report content:
    –   Website: HTML tags
    –   Data.One: RSS description tags
●   Other weather data is missing, eg. Area
    temperture updates per each 12 mins.
Open Data from Govenment
●   Weather at Data.One is 'report' but not 'data'.
●   Weather RSS is already released by HKO
    before launch of Data.One.
●   Technically, json/xml format is better
    readable by computer programs.
Open Data from Govenment
Improving Legco Vote Result Data ?
●   Legcovotes.net is created by Hong Kong
    netitizens(?).
●   Only 20 famous vote results are included.
●   It is possible to let public to input other vote
    results by hand, and submissions should be
    verified by legcovotes.net authoritative.
●   Including other data, eg. Minutes in plain text
    or paragraphs related to a counciler.
Thank you.
●   This presentation will be uploaded to
    slideshare.
●   Licensed in Creative Commons BY-NC-SA.
●   http://slidesha.re/11ZPKvx
●   http://sammy.hk

More Related Content

Similar to From hk0weather to Open Data, Open Government

Open Source Weather Information Project with OpenStack Object Storage
Open Source Weather Information Project with OpenStack Object StorageOpen Source Weather Information Project with OpenStack Object Storage
Open Source Weather Information Project with OpenStack Object StorageSammy Fung
 
Creating Open Data with Open Source (beta2)
Creating Open Data with Open Source (beta2)Creating Open Data with Open Source (beta2)
Creating Open Data with Open Source (beta2)Sammy Fung
 
How do we develop open source software to help open data ? (MOSC 2013)
How do we develop open source software to help open data ? (MOSC 2013)How do we develop open source software to help open data ? (MOSC 2013)
How do we develop open source software to help open data ? (MOSC 2013)Sammy Fung
 
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis PipelinesMongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis PipelinesMongoDB
 
Leancamp - are you ready to rock
Leancamp - are you ready to rockLeancamp - are you ready to rock
Leancamp - are you ready to rockChristian Heilmann
 
Local Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell ExtensionLocal Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell ExtensionSammy Fung
 
Hacking pokemon go [droidcon tel aviv 2016]
Hacking pokemon go [droidcon tel aviv 2016]Hacking pokemon go [droidcon tel aviv 2016]
Hacking pokemon go [droidcon tel aviv 2016]Guy Lis
 
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)Sammy Fung
 
JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試Simon Su
 
PyOWM - my first open source project
PyOWM - my first open source projectPyOWM - my first open source project
PyOWM - my first open source projectClaudio Sparpaglione
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server InternalsPraveen Gollakota
 
Real-Time Web applications with WebSockets
Real-Time Web applications with WebSocketsReal-Time Web applications with WebSockets
Real-Time Web applications with WebSocketsStanislav Zozulia
 
Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Mike Milinkovich
 
Etienne chauchot spark structured streaming runner
Etienne chauchot spark structured streaming runnerEtienne chauchot spark structured streaming runner
Etienne chauchot spark structured streaming runnerEtienne Chauchot
 
Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Johnny Sung
 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Alessandro Molina
 
The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0Vassilis Pitsounis
 
Android Performance #4: Network
Android Performance #4: NetworkAndroid Performance #4: Network
Android Performance #4: NetworkYonatan Levin
 

Similar to From hk0weather to Open Data, Open Government (20)

Open Source Weather Information Project with OpenStack Object Storage
Open Source Weather Information Project with OpenStack Object StorageOpen Source Weather Information Project with OpenStack Object Storage
Open Source Weather Information Project with OpenStack Object Storage
 
Creating Open Data with Open Source (beta2)
Creating Open Data with Open Source (beta2)Creating Open Data with Open Source (beta2)
Creating Open Data with Open Source (beta2)
 
How do we develop open source software to help open data ? (MOSC 2013)
How do we develop open source software to help open data ? (MOSC 2013)How do we develop open source software to help open data ? (MOSC 2013)
How do we develop open source software to help open data ? (MOSC 2013)
 
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis PipelinesMongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
MongoDB Days UK: Using MongoDB and Python for Data Analysis Pipelines
 
Leancamp - are you ready to rock
Leancamp - are you ready to rockLeancamp - are you ready to rock
Leancamp - are you ready to rock
 
Local Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell ExtensionLocal Weather Information and GNOME Shell Extension
Local Weather Information and GNOME Shell Extension
 
Hacking pokemon go [droidcon tel aviv 2016]
Hacking pokemon go [droidcon tel aviv 2016]Hacking pokemon go [droidcon tel aviv 2016]
Hacking pokemon go [droidcon tel aviv 2016]
 
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
Web scraping 1 2-3 with python + scrapy (Summer BarCampHK 2012 version)
 
JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試JCConf 2016 - Google Dataflow 小試
JCConf 2016 - Google Dataflow 小試
 
PyOWM - my first open source project
PyOWM - my first open source projectPyOWM - my first open source project
PyOWM - my first open source project
 
Tornado Web Server Internals
Tornado Web Server InternalsTornado Web Server Internals
Tornado Web Server Internals
 
Real-Time Web applications with WebSockets
Real-Time Web applications with WebSocketsReal-Time Web applications with WebSockets
Real-Time Web applications with WebSockets
 
Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)Eclipse IoT Talk (Montreal JUG)
Eclipse IoT Talk (Montreal JUG)
 
Etienne chauchot spark structured streaming runner
Etienne chauchot spark structured streaming runnerEtienne chauchot spark structured streaming runner
Etienne chauchot spark structured streaming runner
 
Maps tek11
Maps tek11Maps tek11
Maps tek11
 
Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人Introductions of Messaging bot 做聊天機器人
Introductions of Messaging bot 做聊天機器人
 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
 
The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0The Angular road from 1.x to 2.0
The Angular road from 1.x to 2.0
 
tit
tittit
tit
 
Android Performance #4: Network
Android Performance #4: NetworkAndroid Performance #4: Network
Android Performance #4: Network
 

More from Sammy Fung

Python 爬網⾴工具 - Scrapy 介紹
Python 爬網⾴工具 - Scrapy 介紹Python 爬網⾴工具 - Scrapy 介紹
Python 爬網⾴工具 - Scrapy 介紹Sammy Fung
 
DevRel - Transform article writing from printing to online
DevRel - Transform article writing from printing to onlineDevRel - Transform article writing from printing to online
DevRel - Transform article writing from printing to onlineSammy Fung
 
Introduction to Open Source by opensource.hk (2019 Edition)
Introduction to Open Source by opensource.hk (2019 Edition)Introduction to Open Source by opensource.hk (2019 Edition)
Introduction to Open Source by opensource.hk (2019 Edition)Sammy Fung
 
My Open Source Journey - Developer and Community
My Open Source Journey - Developer and CommunityMy Open Source Journey - Developer and Community
My Open Source Journey - Developer and CommunitySammy Fung
 
Introduction to development with Django web framework
Introduction to development with Django web frameworkIntroduction to development with Django web framework
Introduction to development with Django web frameworkSammy Fung
 
Open Data and Web API
Open Data and Web APIOpen Data and Web API
Open Data and Web APISammy Fung
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastSammy Fung
 
Mozilla - Openness of the Web
Mozilla - Openness of the WebMozilla - Openness of the Web
Mozilla - Openness of the WebSammy Fung
 
Open Source Technology and Community
Open Source Technology and CommunityOpen Source Technology and Community
Open Source Technology and CommunitySammy Fung
 
Access Open Data with Open Source Software Tools
Access Open Data with Open Source Software ToolsAccess Open Data with Open Source Software Tools
Access Open Data with Open Source Software ToolsSammy Fung
 
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server EditionInstallation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server EditionSammy Fung
 
Software Freedom and Open Source Community
Software Freedom and Open Source CommunitySoftware Freedom and Open Source Community
Software Freedom and Open Source CommunitySammy Fung
 
Building your own job site with Drupal
Building your own job site with DrupalBuilding your own job site with Drupal
Building your own job site with DrupalSammy Fung
 
Use open source software to develop ideas at work
Use open source software to develop ideas at workUse open source software to develop ideas at work
Use open source software to develop ideas at workSammy Fung
 
Software Freedom and Community
Software Freedom and CommunitySoftware Freedom and Community
Software Freedom and CommunitySammy Fung
 
Open Source Job Board
Open Source Job BoardOpen Source Job Board
Open Source Job BoardSammy Fung
 
Introduction of Mozilla Hong Kong (COSCUP 2014)
Introduction of Mozilla Hong Kong (COSCUP 2014)Introduction of Mozilla Hong Kong (COSCUP 2014)
Introduction of Mozilla Hong Kong (COSCUP 2014)Sammy Fung
 
Introduction of Open Source Job Board with Drupal CMS
Introduction of Open Source Job Board with Drupal CMSIntroduction of Open Source Job Board with Drupal CMS
Introduction of Open Source Job Board with Drupal CMSSammy Fung
 
Mozilla Community and Hong Kong
Mozilla Community and Hong KongMozilla Community and Hong Kong
Mozilla Community and Hong KongSammy Fung
 
ITFest 2014 - Open Source Marketing
ITFest 2014 - Open Source MarketingITFest 2014 - Open Source Marketing
ITFest 2014 - Open Source MarketingSammy Fung
 

More from Sammy Fung (20)

Python 爬網⾴工具 - Scrapy 介紹
Python 爬網⾴工具 - Scrapy 介紹Python 爬網⾴工具 - Scrapy 介紹
Python 爬網⾴工具 - Scrapy 介紹
 
DevRel - Transform article writing from printing to online
DevRel - Transform article writing from printing to onlineDevRel - Transform article writing from printing to online
DevRel - Transform article writing from printing to online
 
Introduction to Open Source by opensource.hk (2019 Edition)
Introduction to Open Source by opensource.hk (2019 Edition)Introduction to Open Source by opensource.hk (2019 Edition)
Introduction to Open Source by opensource.hk (2019 Edition)
 
My Open Source Journey - Developer and Community
My Open Source Journey - Developer and CommunityMy Open Source Journey - Developer and Community
My Open Source Journey - Developer and Community
 
Introduction to development with Django web framework
Introduction to development with Django web frameworkIntroduction to development with Django web framework
Introduction to development with Django web framework
 
Open Data and Web API
Open Data and Web APIOpen Data and Web API
Open Data and Web API
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 Forecast
 
Mozilla - Openness of the Web
Mozilla - Openness of the WebMozilla - Openness of the Web
Mozilla - Openness of the Web
 
Open Source Technology and Community
Open Source Technology and CommunityOpen Source Technology and Community
Open Source Technology and Community
 
Access Open Data with Open Source Software Tools
Access Open Data with Open Source Software ToolsAccess Open Data with Open Source Software Tools
Access Open Data with Open Source Software Tools
 
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server EditionInstallation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server Edition
 
Software Freedom and Open Source Community
Software Freedom and Open Source CommunitySoftware Freedom and Open Source Community
Software Freedom and Open Source Community
 
Building your own job site with Drupal
Building your own job site with DrupalBuilding your own job site with Drupal
Building your own job site with Drupal
 
Use open source software to develop ideas at work
Use open source software to develop ideas at workUse open source software to develop ideas at work
Use open source software to develop ideas at work
 
Software Freedom and Community
Software Freedom and CommunitySoftware Freedom and Community
Software Freedom and Community
 
Open Source Job Board
Open Source Job BoardOpen Source Job Board
Open Source Job Board
 
Introduction of Mozilla Hong Kong (COSCUP 2014)
Introduction of Mozilla Hong Kong (COSCUP 2014)Introduction of Mozilla Hong Kong (COSCUP 2014)
Introduction of Mozilla Hong Kong (COSCUP 2014)
 
Introduction of Open Source Job Board with Drupal CMS
Introduction of Open Source Job Board with Drupal CMSIntroduction of Open Source Job Board with Drupal CMS
Introduction of Open Source Job Board with Drupal CMS
 
Mozilla Community and Hong Kong
Mozilla Community and Hong KongMozilla Community and Hong Kong
Mozilla Community and Hong Kong
 
ITFest 2014 - Open Source Marketing
ITFest 2014 - Open Source MarketingITFest 2014 - Open Source Marketing
ITFest 2014 - Open Source Marketing
 

Recently uploaded

(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Recently uploaded (20)

(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMsFact vs. Fiction: Autodetecting Hallucinations in LLMs
Fact vs. Fiction: Autodetecting Hallucinations in LLMs
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

From hk0weather to Open Data, Open Government

  • 1. 從 hk0weather 到 Open Data, Open Government From hk0weather to Open Data, Open Government Sammy Fung BarCampHK 2013 http://slidesha.re/11ZPKvx
  • 2. Sammy Fung ● Blogger: sammy.hk ● Coder: perl -> php -> python ● Linux User: server + desktop ● “Cloud”: OpenStack. ● Smartphone: iPhone 3G -> Android ● Organizer: Linux/Open Source Communities
  • 3. Agenda ● My Products: WeatherHK, TCTrack ● My new opensource projects: hk0weather ● My comments to Open Data and Open Government ● Q&A, Open Discussion to Floor.
  • 4. My Products ● WeatherHK ● TCTrack
  • 5. WeatherHK ● http://twitter.com/weatherhk ● Interview by MetroPop in 2009.
  • 6. WeatherHK ● http://twitter.com/weatherhk ● Backend: Python + Scrapy + Database + Twitter + NNTP...... ● Frontend: Twitter + Newsgroup ● hourly current weather report ● weather forecast report ● tropical signal warning
  • 7. My Products ● WeatherHK ● TCTrack
  • 8. TCTrack ● http://sammy.hk/projects/tctrack/tctrack.php ● http://twitter.com/tctrack ● Plot TC current and forecast tracks over Google Map. ● Tweet JTWC updates for Northwest Pacific. ● Source: JTWC, HKO.
  • 9. TCTrack ● http://sammy.hk/projects/tctrack/tctrack.php ● http://twitter.com/tctrack ● Probably first tctrack map in HK using GoogleMap ● Use of GMap: TCTrack -> Weather Underground Hong Kong -> HKO
  • 10. g0v.tw ● g0v.tw 台灣零時政府 ● clkao 高嘉良 suggested to implement open source weather tools for Hong Kong.
  • 11. hk0weather ● https://github.com/sammyfung/hk0weather ● Open Source Hong Kong Weather Project. ● convert to JSON data from HKO webpages. ● python + scrapy ● 1st version: from current weather report, extracting temperture and humidity from 20+ weather stations, export in json format.
  • 12. hk0weather ● https://github.com/sammyfung/hk0weather ● $ virtualenv hk0weatherenv ● $ source hk0weatherenv/bin/activate ● $ pip install scrapy ● $ git clone https://github.com/sammyfung/hk0weather.git ● $ cd hk0weather ● $ scrapy crawl currwx -t json -o testresult
  • 13. hk0weather [{"humidity": 80, "station": "hko", "temperture": 17, "time": 1360785720}, {"station": "kingspark", "temperture": 16, "time": 1360785720}, {"station": "wongchukhang", "temperture": 17, "time": 1360785720}, {"station": "takwuling", "temperture": 16, "time": 1360785720}, {"station": "laufaushan", "temperture": 15, "time": 1360785720}, {"station": "taipo", "temperture": 16, "time": 1360785720}, {"station": "shatin", "temperture": 17, "time": 1360785720}, {"station": "tuenmun", "temperture": 17, "time": 1360785720}, {"station": "tseungkwano", "temperture": 16, "time": 1360785720}, {"station": "saikung", "temperture": 16, "time": 1360785720}, {"station": "cheungchau", "temperture": 17, "time": 1360785720}, {"station": "cheungchau", "temperture": 17, "time": 1360785720}, {"station": "tsingyi", "temperture": 17, "time": 1360785720}, {"station": "shekkong", "temperture": 15, "time": 1360785720}, {"station": "tsuenwanhokoon", "temperture": 15, "time": 1360785720}, {"station": "tsuenwanshingmunvalley", "temperture": 17, "time": 1360785720}, {"station": "hongkongpark", "temperture": 17, "time": 1360785720}, {"station": "shaukeiwan", "temperture": 16, "time": 1360785720}, {"station": "kowlooncity", "temperture": 16, "time": 1360785720}, {"station": "happyvalley", "temperture": 18, "time": 1360785720}, {"station": "wongtaisin", "temperture": 17, "time": 1360785720}, {"station": "stanley", "temperture": 16, "time": 1360785720}, {"station": "kwuntong", "temperture": 15, "time": 1360785720}, {"station": "shamshuipo", "temperture": 17, "time": 1360785720}]
  • 14. hk0weather ● Future Planning: ● Add more weather reports. ● Getting ideas and/or cooperate with 'pro' Weather hobbists. ● Remarks: ● Development of hk0weather is started from ZERO, its code is different than my twitter @weatherhk.
  • 15. Why python + scrapy ? ● python: my current favourite programming language for few years. ● scrapy: web crawling framework written in Python.
  • 16. Scrapy ● scrapy: web crawling framework written in Python. ● HtmlXPathSelector ● Output: built-in JSON, CSV, XML. ● Python: import re
  • 17. Items.py class Hk0WeatherItem(Item): time = Field() station = Field() temperture = Field() humidity = Field() pass
  • 18. Items.py class Hk0WeatherItem(Item): time = Field() station = Field() temperture = Field() humidity = Field() pass
  • 19. Currwx.py start_urls = ( 'http://www.weather.gov.hk/wxinfo/currwx/curr entc.htm', )
  • 20. Currwx.py def parse(self, response): laststation = '' temperture = int() stations = [] hxs = HtmlXPathSelector(response) report = hxs.select('//div[@id="ming"]')
  • 21. libhk0 class hk0: stations = [ (u' 天 文 台 ', 'hko'), (u' 京 士 柏 ', 'kingspark'), (u' 黃 竹 坑 ', 'wongchukhang'), (u' 打 鼓 嶺 ', 'takwuling'), (u' 流 浮 山 ', 'laufaushan'),
  • 22. libhk0 class hk0: def gettime(self, report): … def hk0current(self, report): …
  • 23. Challenge ● Challenge on first day of hk0weather release. ● Facebook comment to blog post: 「其實 HKO 有個年費 plan 係嘔兩個好靚仔嘅 XML 。而只 要你肯問,你件嘢又非商業用途, HKO 都會免 費俾你用」
  • 24. Challenge ● I replied after googling for it. ● google 找到相關 XML schema 示範資料,但 .... ● 1. 在於 Open Data 角度,暫時看不到有網頁說明任何人以非商 業用途使用資訊,可以免費獲得登入戶口。而我本身是「已登 記」使用 HKO 網頁資料作非商業用途的使用 / 轉載者,我一直收 到來自 HKO 的更新電郵都是說明 HTML 格式的更新, " 印象中 " HKO 並沒有發出過 XML 和邀請開 XML 使用戶口。 ● 2. 而 ( 以我覺得 ) 以業餘氣象發燒友的角度來看,目前 HKO XML schema 仍有不足之處,我已想到一些我想要的數據,仍是只能 從 HTML 版本取得。 ● Challenge: FAIL! XD
  • 25. Open Data from Govenment ● My Chinese Blog Post 「香港政府機構開放資料 Open Data 情況」 on 2013/1/17. ● Data.One released on 2011/3/31. ● Weather at Data.One provides 7 dataset URLs, returns RSS (XML) format (Eng/TChi/SChi) ● One word: Useless. ● Data.One dataset is different with HKO own XML metioned in previous “challenge”.
  • 26. Open Data from Govenment ● Example - Current local weather report: ● Plain text report in RSS. ● Difference to quote report content: – Website: HTML tags – Data.One: RSS description tags ● Other weather data is missing, eg. Area temperture updates per each 12 mins.
  • 27. Open Data from Govenment ● Weather at Data.One is 'report' but not 'data'. ● Weather RSS is already released by HKO before launch of Data.One. ● Technically, json/xml format is better readable by computer programs.
  • 28. Open Data from Govenment
  • 29. Improving Legco Vote Result Data ? ● Legcovotes.net is created by Hong Kong netitizens(?). ● Only 20 famous vote results are included. ● It is possible to let public to input other vote results by hand, and submissions should be verified by legcovotes.net authoritative. ● Including other data, eg. Minutes in plain text or paragraphs related to a counciler.
  • 30. Thank you. ● This presentation will be uploaded to slideshare. ● Licensed in Creative Commons BY-NC-SA. ● http://slidesha.re/11ZPKvx ● http://sammy.hk