Skip to content

Commit

Permalink
npm version and minor refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronalddddd committed Feb 16, 2015
1 parent 8ea84a2 commit a061963
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
}).catch(function(err){
console.error("Error parsing Current Weather data!",err, err.stack.toString());
}),
// Get Weather condition (icon mapping and condition name/description -- since there's no reliable way to scrape this data from HKO's feed)
// Get Weather condition from openweathermap.org (icon mapping and condition name/description -- since there's no reliable way to scrape this data from HKO's feed)
// TODO: Parse HKO's homepage to get relevant weather condition instead of using openweathermap.org
_getJsonFeed(openweatherJsonFeedUrl).then(function (openWeatherData) {
var condition;
if (! (openWeatherData && openWeatherData.weather && openWeatherData.weather instanceof Array && openWeatherData.weather.length > 0)) throw new Error("Failed to get weather data from openweathermap.org");
Expand All @@ -125,7 +126,7 @@
}).catch(function(err){
console.error("Error parsing Weather Warning data!",err, err.stack.toString());
}),
// Air Pollution index from
// Air Quality Health Index (AQHI) from the Environmental Protection Department (EPD)
_getXmlFeed(airQualityFeedUrl).then(function ($) {
var aqDateMatch = aqDateRegex.exec($('item title').text()),
aqGeneralMatch = aqGeneralRegex.exec($('item description').text()),
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hko-scraper",
"version": "0.0.1",
"version": "0.0.2",
"description": "Hong Kong Observatory and Air Quality data scraper",
"main": "index.js",
"scripts": {
Expand All @@ -20,6 +20,10 @@
"bluebird": "~2.9.9"
},
"devDependencies": {
"chai": "latest"
"chai": "latest"
},
"repository": {
"type" : "git",
"url" : "https://github.com/ronalddddd/hko-scraper"
}
}

0 comments on commit a061963

Please sign in to comment.