Skip to content

Instantly share code, notes, and snippets.

@howawong
howawong / kc.csv
Last active November 25, 2020 17:20
item subitem a b c d
區議會
區議會 區議會大會一般開支
區議會 大會其他開支
區議會 委員會預算
區議會 社區參與活動
區議會 九龍城區議會核下委員會
區議會 活動已於上年度舉辦但尚未獲發還的墊支費用及因申請團體未有兌現支票而須預留款項
區議會大會一般開支 九龍城區節日慶祝活動籌劃工作小組 5300000.00 5300000.00 5300000.00 5500000.00
區議會大會一般開支 九龍城區地區推廣國民教育工作小組 220000.00 220000.00 220000.00 200000.00
id value
flare
flare.analytics
flare.analytics.cluster
flare.analytics.cluster.AgglomerativeCluster 3938
flare.analytics.cluster.CommunityStructure 3812
flare.analytics.cluster.HierarchicalCluster 6714
flare.analytics.cluster.MergeEdge 743
flare.analytics.graph
flare.analytics.graph.BetweennessCentrality 3534
[{
"nid": "657461",
"field_store_name": "\u5fb7\u8f14\u9053\u897f",
"field_store_address": "\u9999\u6e2f\u5fb7\u8f14\u9053\u897f202-204\u865f\u5730\u4e0bA \u0026amp; B\u8216",
"field_store_business_hours": "\u003Cp\u003E\u661f\u671f\u4e00\u81f3\u661f\u671f\u65e5 : 9:00 \u81f3 21:00\u003C\/p\u003E",
"field_pharmacy_business_hour": "",
"field_store_type": "",
"field_store_code": "181",
"field_store_abb": "DV",
"field_store_district": "0|\u4e2d\u897f\u5340 ",
@howawong
howawong / dc2015.json
Last active December 7, 2019 09:36
DC 2015 JSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@howawong
howawong / hkg.json
Created November 8, 2019 23:19
Hong Kong GeoJSON
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import requests
from bs4 import BeautifulSoup
def get_all_meetings(meetingDateS='0890101', meetingDateE='1080720'):
payload={
'session_type': '',
'termSessionS': '000000',
'termSessionE': '999999',
'sortFieldListSource': 'meeting_date1:',
'fieldNameListSource': 'term,Session_Period,Session_times,Session_type,Pdf_filename,Meeting_Date,Term_Session,Meeting_Times,$9$',
@howawong
howawong / water.csv
Last active November 15, 2018 14:45
water.csv
id year amountOfWater expenditure
2003 2003 810 2498.8
2004 2004 820 2529.7
2005 2005 820 2529.7
2006 2006 820 2494.8
2007 2007 820 2494.8
2008 2008 820 2494.8
2009 2009 820 2959
2010 2010 820 3146
2011 2011 820 3344
分區 規劃 文化康樂 財務 房屋
中西區
灣仔區
南區
東區
觀塘區
深水埗區
油尖旺區
黃大仙區
九龍城區
@howawong
howawong / scraper.py
Created December 5, 2017 05:59
Python 網路爬蟲 101: Beautiful Soap + Morph.io scraper.py
import requests
from bs4 import BeautifulSoup
import scraperwiki
from datetime import datetime
import pytz
req = requests.get('http://www.shunon.com.hk/pricing.php')
soup = BeautifulSoup(req.content, 'html.parser')
table = soup.find_all('table', {'class': 'Font16Boldc'})[1]
element = table.find_all('p')[0]
text = element.text.split()
@howawong
howawong / crawl_price.py
Last active December 5, 2017 05:14
Python 網路爬蟲 101: Beautiful Soap + Morph.io crawl_price.py
import requests
from bs4 import BeautifulSoup
req = requests.get('http://www.shunon.com.hk/pricing.php')
soup = BeautifulSoup(req.content, 'html.parser')
table = soup.find_all('table', {'class': 'Font16Boldc'})[1]
element = table.find_all('p')[0]
text = element.text.split()
titles = [text[i] for i in (0, 2, 4, 6)]
values = [int(text[i].replace('$', '').replace(',', ''))
for i in (1, 3, 5, 7)]