-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
86 lines (86 loc) · 6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>
Graphing Air Pollution in China (Aengus Walton)
</title>
<link rel="stylesheet" href="stylesheets/styles.css" type="text/css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"><!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<h1>
Graphing Air Pollution in China
</h1>
<div id="donate_buttons">
<script id='fbiqmud'>(function(i){var f,s=document.getElementById(i);f=document.createElement('iframe');f.src='//api.flattr.com/button/view/?uid=ventolin&url='+encodeURIComponent(document.URL);f.title='Flattr';f.height=62;f.width=55;f.style.borderWidth=0;s.parentNode.insertBefore(f,s);})('fbiqmud');</script>
<script data-gittip-username="kopf" data-gittip-widget="button" src="//gttp.co/v1.js"></script>
</div>
<p>
<b>NOTICE:</b> In May 2015, Google changed the Fusion Tables API. Fusion Tables provides the database
that stores the data shown on this page. Unfortunately I have no spare time to update <a
href="http://github.com/kopf/chineseair">the code that
powers this site</a>, and so it will no longer be updated. <a
href="https://www.google.com/fusiontables/DataSource?docid=14BwrqWVcFIEZSVSa15TlkqTsLYqLO6BXJkWzhu60">Click
here</a> for the raw data this tool has collected over the years. <a href="http://aqicn.org/">Click
here</a> for another site reporting the air quality across many Chinese cities.
</p>
<p>
News of high levels of air pollution in China are nothing new, but <a href="http://www.bbc.co.uk/news/world-asia-china-21007893">recent reports</a> have startled many.
</p>
<blockquote>
<p>
WHO guidelines say average concentrations of the tiniest pollution particles - called PM2.5 - should be no more than 25 microgrammes per cubic metre. Air is unhealthy above 100 microgrammes and at 300, all children and elderly people should remain indoors.
</p>
<p>
Official Beijing city readings on Saturday [12th January 2013] suggested pollution levels of over 400. An unofficial reading from a monitor at the US embassy recorded levels of over 800.
</p>
</blockquote>
<p>
As mentioned above, United States Embassies in China run twitter accounts which tweet the current levels of air pollution in many Chinese cities. Apparently the authorities have threatened to shut them down on multiple occasions but not yet followed through.
</p>
<p>
I think these twitter accounts are a great idea but they have one problem: it's rather difficult to digest the information (points on the <a href="http://www.airnow.gov/index.cfm?action=aqibasics.aqi">Air Quality Index</a>) in tweet form. Twitter does a great job at getting the information out there, but to properly consume it, you really need a graph. So, one evening I decided to hack this page together.
</p>
<p>
The graph will update hourly, just as the twitter feeds do.
</p>
<h2>
Current Pollution Levels
</h2>
<iframe width="900" height="450" scrolling="no" frameborder="no" src="https://www.google.com/fusiontables/embedviz?containerId=googft-gviz-canvas&viz=GVIZ&t=LINE_AGGREGATE&isXyPlot=true&bsize=0&q=select+col0%2C+col1%2C+col4%2C+col2%2C+col3%2C+col5+from+14BwrqWVcFIEZSVSa15TlkqTsLYqLO6BXJkWzhu60&qrs=+where+col0+%3E%3D+&qre=+and+col0+%3C%3D+&qe=+order+by+col0+asc&uiversion=2&rstart=2014%2F3%2F25+9%3A2%3A56&rend=2014%2F4%2F30+15%3A20%3A13&gco_forceIFrame=true&gco_hasLabelsColumn=true&width=900&height=450"></iframe>
<h2>
Source code and data
</h2>
<p>
The scripts used to compile this data are available for inspection <a href="https://github.com/kopf/chineseair" target="_new">here</a>.
The raw data is stored in a Google Fusion Table. You can <a href="https://www.google.com/fusiontables/DataSource?docid=14BwrqWVcFIEZSVSa15TlkqTsLYqLO6BXJkWzhu60" target="_new">view this table here</a> and also download a spreadsheet of the raw data.
<h2>
About me
</h2>
<p>
I'm <a href="http://ventolin.org">Aengus Walton</a>, a software engineer from Ireland, currently living in Germany. You can <a href="http://github.com/kopf">see some of my open-source projects here</a>, and <a href="http://ventolin.org">read my (much neglected) blog here</a>.
</p>
<p>
If you would like to contact me, you can <a href="http://ventolin.org/about-2">get my email address here</a>.
</p>
</div>
<script src="javascripts/scale.fix.js" type="text/javascript"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-37666330-1");
pageTracker._trackPageview();
} catch(err) {}
</script>
</body>
</html>