For ease of maintainability this project has moved from this gist to its own repository. You can go and visit it there.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Widget Params | |
// Don't edit this, those are default values for debugging (location for Cupertino). | |
// You need to give your locations parameters through the widget params, more info below. | |
const widgetParams = JSON.parse((args.widgetParameter != null) ? args.widgetParameter : '{ "LAT" : "46.062" , "LON" : "13.242" , "LOC_NAME" : "Udine" }') | |
// WEATHER API PARAMETERS !important | |
// API KEY, you need an Open Weather API Key | |
// You can get one for free at: https://home.openweathermap.org/api_keys (account needed). | |
const API_KEY = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: deep-blue; icon-glyph: magic; | |
// Create your ID on openweathermap.org | |
// Get your api from there and set that in API_WEATHER | |
// To get CITY_WEATHER means city ID get the longitude and latitute from google maps for your location | |
// Replace the longitude, latitute and YOUR_API_KEY in the given link http://api.openweathermap.org/data/2.5/weather?lat=Latitude&lon=Longitude&appid=YOUR_API_KEY&units=metric and look for your city ID in the resultant text. | |
// Set that ID to CITY_WEATHER | |
//API_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shows latest news from MacStories in a table. | |
// The table shows an image from the article, if available, and the title of the article. | |
let inputStr = args.widgetParameter | |
// if exclude itrms, this meeds to be higger than vLimit | |
// logError(inputStr) | |
if ( inputStr == null ) { inputStr = "apollo@scriptable@1@pic@4" } | |
let vRedditLimit = 15 | |
let vItemCount = 1 | |
var res = inputStr.split("@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shows latest news from MacStories in a table. | |
// The table shows an image from the article, if available, and the title of the article. | |
// let rReddit = "scriptable" | |
let inputStr = args.widgetParameter | |
// if exclude itrms, this meeds to be higger than vLimit | |
// logError(inputStr) | |
if ( inputStr == null ) { inputStr = "apollo@scriptable@1" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've moved this to a proper GitHub project. | |
Check it out at: | |
https://github.com/jasonsnell/PurpleAir-AQI-Scriptable-Widget |
Note: < i=OS 5.1 use
prefs:
. > 5.1 useapp-settings:
- app-settings:root=General&path=About
- app-settings:root=General&path=ACCESSIBILITY
- app-settings:root=AIRPLANE_MODE
- app-settings:root=General&path=AUTOLOCK
- app-settings:root=General&path=USAGE/CELLULAR_USAGE
- app-settings:root=Brightness