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
const lang = "en" //use the language of your choice "en", "de", "it", "fr", etc. | |
const url = `https://${lang}.wikipedia.org/api/rest_v1/page/random/summary` | |
const req = new Request(url) | |
const res = await req.loadJSON() | |
const i = new Request(res.thumbnail.source); | |
const img = await i.loadImage(); | |
let widget = createWidget(res.title, img, res.content_urls.mobile.page) | |
if (config.runsInWidget) { | |
// create and show widget |
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
const getURL = year => `https://nolaborables.com.ar/api/v2/feriados/${year}` | |
const months = ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre']; | |
const days = ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado']; | |
const dayOfWeek = (day, month, year) => days[new Date(year, month, day).getDay()]; | |
const getYear = () => (new Date()).getFullYear(); | |
const getNextHoliday = function(holidays){ | |
const now = new Date() |
NewerOlder