<commit_before>// ==UserScript==
// @description Let pm25.in display AQI level according to US standard instead of CN.
// @match http://www.pm25.in/*
// @name pm25.in us std
// @version 0.0.0
// ==/UserScript==


var pm25_csspath = 'body > div.container > div.span12.avg > div.span12.data > div:nth-child(2) > div.value';
var pm25 = parseInt(document.querySelector(pm25_csspath).innerText, 10);

// AQI category: https://en.wikipedia.org/wiki/Air_quality_index
// AQI meaning: http://airnow.gov/index.cfm?action=aqibasics.aqi
// Action: AQI: A Guide to Air Quality and Your Health, p. 8
// via http://www.epa.gov/airnow/aqi_brochure_02_14.pdf
if (pm25 <= 12) {
  var aqi_category = 'Good';
  var aqi_meaning = 'Air quality is considered satisfactory, and air pollution poses little or no risk.';
  var aqi_action = 'None';}
else if (pm25 <= 35.4) {
  var aqi_category = 'Moderate';
  var aqi_meaning = 'Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution.';
  var aqi_action = 'Unusually sensitive people should consider reducing prolonged or heavy exertion.';}
else if (pm25 <= 55.4) {
  var aqi_category = 'Unhealthy for sensitive Groups';
  var aqi_meaning = 'Members of sensitive groups may experience health effects. The general public is not likely to be affected.';
  var aqi_action = 'People with heart or lung disease, children  and older adults should reduce prolonged or heavy exertion';}
else if (pm25 <= 150.4) {
  var aqi_category = 'Unhealthy';
  var aqi_meaning = 'Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects.';
  var aqi = 'People with heart or lung disease, children  and older adults should avoid prolonged or heavy exertion. Everyone else should reduce prolonged or heavy exertion.';}
else if (pm25 <= 250.4) {
  var aqi_category = 'Very Unhealthy';
  var aqi_meaning = 'Health warnings of emergency conditions. The entire population is more likely to be affected.';
  var aqi_action = 'People with heart or lung disease, children  and older adults should avoid all physical activity outdoors. Everyone else should avoid prolonged or heavy exertion.';}
else {
  var aqi_category = 'Hazardous';
  var aqi_meaning = 'Health alert: everyone may experience more serious health effects';
  var aqi_action = 'Avoid all physical activity outdoors.';}
<commit_msg>Fix a typo (no action displayed for 'Unhealthy').<commit_after>// ==UserScript==
// @description Let pm25.in display AQI level according to US standard instead of CN.
// @match http://www.pm25.in/*
// @name pm25.in us std
// @version 0.0.0
// ==/UserScript==


var pm25_csspath = 'body > div.container > div.span12.avg > div.span12.data > div:nth-child(2) > div.value';
var pm25 = parseInt(document.querySelector(pm25_csspath).innerText, 10);

// AQI category: https://en.wikipedia.org/wiki/Air_quality_index
// AQI meaning: http://airnow.gov/index.cfm?action=aqibasics.aqi
// Action: AQI: A Guide to Air Quality and Your Health, p. 8
// via http://www.epa.gov/airnow/aqi_brochure_02_14.pdf
if (pm25 <= 12) {
  var aqi_category = 'Good';
  var aqi_meaning = 'Air quality is considered satisfactory, and air pollution poses little or no risk.';
  var aqi_action = 'None';}
else if (pm25 <= 35.4) {
  var aqi_category = 'Moderate';
  var aqi_meaning = 'Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution.';
  var aqi_action = 'Unusually sensitive people should consider reducing prolonged or heavy exertion.';}
else if (pm25 <= 55.4) {
  var aqi_category = 'Unhealthy for sensitive Groups';
  var aqi_meaning = 'Members of sensitive groups may experience health effects. The general public is not likely to be affected.';
  var aqi_action = 'People with heart or lung disease, children  and older adults should reduce prolonged or heavy exertion';}
else if (pm25 <= 150.4) {
  var aqi_category = 'Unhealthy';
  var aqi_meaning = 'Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects.';
  var aqi_action = 'People with heart or lung disease, children  and older adults should avoid prolonged or heavy exertion. Everyone else should reduce prolonged or heavy exertion.';}
else if (pm25 <= 250.4) {
  var aqi_category = 'Very Unhealthy';
  var aqi_meaning = 'Health warnings of emergency conditions. The entire population is more likely to be affected.';
  var aqi_action = 'People with heart or lung disease, children  and older adults should avoid all physical activity outdoors. Everyone else should avoid prolonged or heavy exertion.';}
else {
  var aqi_category = 'Hazardous';
  var aqi_meaning = 'Health alert: everyone may experience more serious health effects';
  var aqi_action = 'Avoid all physical activity outdoors.';}

{'fraction_non_alphanumeric': 0.09517130835503906, 'fraction_numerical': 0.02123822881186135, 'mean_word_length': 4.31629392971246, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2569395', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1420, 'n_words': 609}