├── CountUp
├── .gitkeep
├── CountUp.js
├── README.md
├── preview_1.png
├── preview_2.png
├── preview_3.png
└── preview_4.gif
├── Covid-19 Ukraine Stats
├── .gitkeep
├── COVID-19.js
├── README.md
├── preview_1.png
├── preview_2.png
└── preview_3.png
├── Covid-19-Multilang-Stats
├── .gitkeep
├── Covid-19 Multilang.js
├── README.md
├── preview_1.png
├── preview_2.png
├── preview_3.png
└── preview_4.png
├── Losses_of_russia
├── .gitkeep
├── Losses_of_russia.js
├── README.md
├── preview_0.png
├── preview_1.png
└── preview_2.png
├── README.md
├── SpaceLaunch
├── README.md
├── SpaceLaunch.js
├── preview_0.png
└── preview_1.png
└── WhereIsWebb
├── README.md
├── WhereIsWebb.js
├── preview_1.png
└── preview_2.png
/CountUp/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/CountUp/CountUp.js:
--------------------------------------------------------------------------------
1 | // Variables used by Scriptable.
2 | // These must be at the very top of the file. Do not edit.
3 | // icon-color: blue; icon-glyph: weight;
4 | //Version 1.1
5 | //Sorry for my English.
6 | //This Scriptable Widget is coded by eXtendedZero
7 | //Very Thanks all known and unknown people whose codes parts I used.
8 |
9 | //---CountUp widget---
10 | //Description.
11 | //Minimalistic widget that Count Up number full days from set date.
12 | //
13 | //Features.
14 | //Ability to dynamically (without changing the code) configure/change the widget.
15 | //Setting title, date, time, color.
16 | //Ability to use multiple copies of the widget with different settings.
17 | //
18 | //Setup.
19 | //Easy installation. You only need to specify a unique ID for each copy of the widget.
20 | //
21 | //How to use.
22 | //Add a widget and specify a unique ID in the Parameter.
23 | //It can be a number/numbers or a letter / word. For example "7", "1239", "new", "qwerty11", etc. (without quotes).
24 | //
25 | //How it work.
26 | //Tap the widget to set your own settings. In the new window you can set/change your own settings.
27 | //•Title - anything, even smileys (Warning! Do not use the "|" symbol. This is a reserved character).
28 | //•Date - format dd.mm.yyyy
29 | //•Time - format hh:mm
30 | //•Color - you can use reserved keyword(base colors) or set color at format #rrggbb(hex). Reserved color keyword: red, green, blue, yellow, orange, gray, purple, brown, cyan, magenta.
31 |
32 | //The current date and time are set by default. The title is "Now 😎", the background color is red.
33 | //
34 |
35 | //Some details.
36 | //Each copy of the widget creates a unique file based on a given ID where the settings match.
37 | //
38 |
39 | var widgetId = args.widgetParameter;
40 | var fm = FileManager.iCloud()
41 | var dir = fm.documentsDirectory()
42 | var path = fm.joinPath(dir, "CountUpSet_"+widgetId+".txt")
43 |
44 | if (!fm.fileExists(path))
45 | {
46 | let td = new Date
47 | let d = new Intl.DateTimeFormat("es",{day: "2-digit"}).format(td)
48 | let m = new Intl.DateTimeFormat("es",{month: "2-digit"}).format(td)
49 | let y = new Intl.DateTimeFormat("es",{year: "numeric"}).format(td)
50 | let h = new Intl.DateTimeFormat("es",{hour: "2-digit"}).format(td)
51 | let mi = new Intl.DateTimeFormat("es",{minute: "2-digit"}).format(td)
52 |
53 | fm.writeString(path, "Now 😎|"+`${d}.${m}.${y}`+"|"+`${h}:${mi}`+"|red")
54 | }
55 |
56 | //load and parse data from file line by line
57 | //t0 - title
58 | //t1 - date -> dd.mm.yyyy
59 | //t2 - time -> hh:mm
60 | //t3 - color -> Color: #rrggbb(hex) or keyword(base colors)
61 | var mydatR = fm.readString(path)
62 | var arr = mydatR.split("|")
63 | var t0 = arr[0]
64 | var t1 = arr[1]
65 | var t2 = arr[2]
66 | var t3 = arr[3]
67 |
68 | let day0 = t1.split(".")
69 | let time0 = t2.split(":")
70 |
71 | var mydat = new Date(parseInt(day0[2],10),parseInt(day0[1]-1, 10),parseInt(day0[0],10),parseInt(time0[0], 10),parseInt(time0[1],10),0,0)
72 |
73 | var today = new Date
74 |
75 | if (config.runsInWidget) {
76 |
77 | //title
78 | titl = t0
79 |
80 | //date
81 | let date = today.getDate()
82 |
83 | //To calc the time difference of two dates
84 | let Dif_Time = today.getTime()- mydat.getTime()
85 |
86 |
87 | //To calc the no. of days between two dates
88 | var Dif_Days = Math.trunc(Dif_Time / (1000 * 3600 * 24));
89 |
90 | let widget = createWidget(titl, `${Dif_Days}`, 'Start at', t1+", "+t2, t3)
91 |
92 | Script.setWidget(widget)
93 | Script.complete()
94 | }
95 |
96 | if (config.runsInApp)
97 | {
98 | var myTextInput = new Alert()
99 | myTextInput.title = "Settings:"
100 | myTextInput.addAction("Ok")
101 | myTextInput.addCancelAction("Cancel")
102 |
103 | myTextInput.addTextField("Title:", t0)
104 | myTextInput.addTextField("Date: dd.mm.yyyy", t1)
105 | myTextInput.addTextField("Time: гг-хх", t2);
106 | myTextInput.addTextField("Color: #rrggbb(hex) or keyword(base colors)", t3);
107 |
108 | let inPut = await myTextInput.presentAlert()
109 |
110 | let mydatW = myTextInput.textFieldValue(0)+"|"+myTextInput.textFieldValue(1)+"|"+myTextInput.textFieldValue(2)+"|"+myTextInput.textFieldValue(3)+"|"
111 |
112 | switch(inPut)
113 | {
114 | case 0:
115 | //Ok
116 | fm.writeString(path, mydatW)
117 | break;
118 |
119 | case -1:
120 | //Cancel
121 | break;
122 | }
123 |
124 | }
125 |
126 | function createWidget(pretitle, title, title2, subtitle, color)
127 | {
128 | let w = new ListWidget()
129 | w.setPadding(7, 10, 7, 7)
130 |
131 | switch(color)
132 | {
133 | case "red":
134 | color = "ff0000";
135 | break;
136 | case "green":
137 | color = "008000";
138 | break;
139 | case "blue":
140 | color = "0000ff";
141 | break;
142 | case "yellow":
143 | color = "ffd700";
144 | break;
145 | case "orange":
146 | color = "ffa500";
147 | break;
148 | case "gray":
149 | color = "808080";
150 | break;
151 | case "purple":
152 | color = "0000ff";
153 | break;
154 | case "brown":
155 | color = "a52a2a";
156 | break;
157 | case "cyan":
158 | color = "00ffff";
159 | break;
160 | case "magenta":
161 | color = "ff00ff"
162 | break;
163 | }
164 | w.backgroundColor = new Color(color)
165 |
166 | let preTxt = w.addText(pretitle)
167 | preTxt.textColor = Color.white()
168 | preTxt.textOpacity = 0.9
169 | preTxt.font = Font.boldSystemFont(16)
170 |
171 | if (Dif_Days>999) {w.addSpacer(14)} else
172 | {w.addSpacer(4)}
173 |
174 | let titleTxt = w.addText(title)
175 | titleTxt.textColor = Color.white()
176 | titleTxt.shadowColor = Color.black()
177 | titleTxt.shadowOffset = new Point(1,1)
178 | titleTxt.shadowRadius = 1
179 | if (Dif_Days>999)
180 | {
181 | titleTxt.font = Font.boldSystemFont(40)
182 | } else
183 | {
184 | titleTxt.font = Font.boldSystemFont(60)
185 | }
186 | titleTxt.centerAlignText()
187 |
188 |
189 | if (Dif_Days>999) {w.addSpacer(12)} else
190 | {w.addSpacer(6)}
191 |
192 | let titleTxt2 = w.addText(title2)
193 | titleTxt2.textColor = Color.white()
194 | titleTxt2.font = Font.boldSystemFont(11)
195 |
196 | w.addSpacer(0)
197 | let subTxt = w.addText(subtitle)
198 | subTxt.textColor = Color.white()
199 | subTxt.textOpacity = 1.0
200 | subTxt.font = Font.systemFont(11)
201 | return w
202 | }
203 |
204 |
205 |
--------------------------------------------------------------------------------
/CountUp/README.md:
--------------------------------------------------------------------------------
1 | # CountUp
2 | Minimalistic widget that Count Up number full days from set date.
3 |
4 | ## Features
5 | - Ability to dynamically (without changing the code) configure/change the widget.
6 | - Setting title, date, time, color.
7 | - Ability to use multiple copies of the widget with different settings.
8 |
9 | ## Screenshots
10 | 
11 | 
12 |
13 | ## Installing
14 | Easy installation. You only need to specify a unique ID for each copy of the widget.
15 | 
16 |
17 | ## How to use
18 | Add a widget and specify a unique ID in the Parameter.
19 | It can be a number/numbers or a letter/word. For example "7", "1239", "new", "qwerty11", etc. (without quotes).
20 | ### Example (click to see video)
21 | [](https://youtu.be/SnLLthnOnK4)
22 |
23 |
24 |
25 | ## How it work
26 | Tap the widget to set your own settings. In the new window you can set/change your own settings.
27 | •Title - anything, even smileys (Warning! Do not use the "|" symbol. This is a reserved character).
28 | •Date - format dd.mm.yyyy
29 | •Time - format hh:mm
30 | •Color - you can use reserved keyword(base colors) or set color at format #rrggbb(hex). Reserved color keyword: red, green, blue, yellow, orange, gray, purple, brown, cyan, magenta.
31 | The current date and time are set by default. The title is "Now 😎", the background color is red.
32 |
33 | ## Some details.
34 | Each copy of the widget creates a unique file based on a given ID where the settings match.
35 |
36 | ## Built With
37 | * [Scriptable](https://apps.apple.com/ru/app/scriptable/id1405459188) - You can [download](https://apps.apple.com/ru/app/scriptable/id1405459188) this App for iPhone and iPad in App Store.
38 |
39 | ## Version
40 | 1.1
41 |
42 | ## Authors
43 | * **extendedzero** - [extendedzero](https://github.com/extendedzero)
44 |
45 | ## License
46 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
47 |
48 | ## Acknowledgments
49 | * Very Thanks all known and unknown people whose codes parts I used. :bowtie:
50 |
--------------------------------------------------------------------------------
/CountUp/preview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/CountUp/preview_1.png
--------------------------------------------------------------------------------
/CountUp/preview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/CountUp/preview_2.png
--------------------------------------------------------------------------------
/CountUp/preview_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/CountUp/preview_3.png
--------------------------------------------------------------------------------
/CountUp/preview_4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/CountUp/preview_4.gif
--------------------------------------------------------------------------------
/Covid-19 Ukraine Stats/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Covid-19 Ukraine Stats/COVID-19.js:
--------------------------------------------------------------------------------
1 | // Variables used by Scriptable.
2 | // These must be at the very top of the file. Do not edit.
3 | // icon-color: red; icon-glyph: procedures;
4 | //Version 1.1
5 | //This widget shows daily current statistics of COVID-19 in Ukraine.
6 | //Displayed (for today):
7 | //- the number of identified patients today (updated in the morning around 9:00);
8 | //- the total number of patients;
9 | //- number of deaths;
10 | //- number of recovered.
11 | //Ukraine language.
12 |
13 | //This Scriptable Wodget is coded by eXtendedZero.
14 | //Very Thanks all known and unknown people whose codes parts I used. :-)
15 |
16 | // Variables used by Scriptable.
17 | // These must be at the very top of the file. Do not edit.
18 |
19 | // change "country" to a value from https://coronavirus-19-api.herokuapp.com/countries/
20 |
21 | const country = "Ukraine"
22 | const url = `https://coronavirus-19-api.herokuapp.com/countries/${country}`
23 | const req = new Request(url)
24 | const res = await req.loadJSON()
25 |
26 | if (config.runsInWidget) {
27 | // create and show widget
28 | let widget = await createWidget("COVID-19", "Україна", `Сьогодні ${res.todayCases}`, `Всього ${res.cases}`, `Померло ${res.deaths}`, `Одужало ${res.recovered}`, "#8b0000")
29 |
30 | Script.setWidget(widget)
31 | Script.complete()
32 | } else {
33 | // make table
34 | let table = new UITable()
35 |
36 | // add header
37 | let row = new UITableRow()
38 | row.isHeader = true
39 | row.addText(`Статистика Covid-19 по ${country}`)
40 | table.addRow(row)
41 |
42 | // fill data
43 | table.addRow(createRow("Всього", res.cases))
44 | table.addRow(createRow("Сьогодні", res.todayCases))
45 | table.addRow(createRow("Померло", res.deaths))
46 | table.addRow(createRow("Одужало", res.recovered))
47 |
48 | if (config.runsWithSiri)
49 | Speech.speak(`There are ${res.cases} cases in ${country}, and ${res.todayCases} cases today.`)
50 |
51 | // present table
52 | table.present()
53 | }
54 |
55 | function createRow(title, number) {
56 | let row = new UITableRow()
57 | row.addText(title)
58 | row.addText(number.toString()).rightAligned()
59 | return row
60 | }
61 |
62 | async function createWidget(pretitle, title, today, total, dead, recov, color) {
63 |
64 | let w = new ListWidget()
65 |
66 | w.backgroundColor = new Color(color)
67 | w.setPadding(10, 10, 10, 10)
68 |
69 | let row = w.addStack()
70 |
71 | let column = row.addStack()
72 | column.layoutVertically()
73 |
74 | let preText = column.addText(pretitle)
75 | row.addSpacer(1)
76 |
77 | let titleTxt = column.addText(title)
78 | row.addSpacer(1)
79 |
80 | let req = new Request("https://i.imgur.com/OZLYIp5.png")
81 | let icon = await req.loadImage()
82 |
83 | row.layoutHorizontally()
84 | row.addSpacer(7)
85 |
86 | let iconImg = row.addImage(icon)
87 | iconImg.imageSize = new Size(40, 40)
88 |
89 | w.addSpacer(4)
90 | let todayTxt = w.addText(today)
91 | todayTxt.textColor = Color.white()
92 | todayTxt.textOpacity = 1.0
93 | todayTxt.font=Font.boldSystemFont(14)
94 |
95 | w.addSpacer(2)
96 | let totalTxt = w.addText(total)
97 | totalTxt.textColor = Color.white()
98 | totalTxt.textOpacity = 0.8
99 | totalTxt.font = Font.systemFont(13)
100 |
101 | w.addSpacer(2)
102 | let deadTxt = w.addText(dead)
103 | deadTxt.textColor = Color.white()
104 | deadTxt.textOpacity = 0.8
105 | deadTxt.font = Font.systemFont(13)
106 |
107 | w.addSpacer(2)
108 | let recovTxt = w.addText(recov)
109 | recovTxt.textColor = Color.white()
110 | recovTxt.textOpacity = 0.8
111 | recovTxt.font = Font.systemFont(13)
112 |
113 | return w
114 | }
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/Covid-19 Ukraine Stats/README.md:
--------------------------------------------------------------------------------
1 | # Covid-19 Ukraine Stats
2 | This widget shows daily current statistics of COVID-19 in Ukraine.
3 |
4 | ## Features
5 | Ukraine language.
6 | Displayed (for today):
7 | - the number of identified patients today (updated in the morning around 9:00);
8 | - the total number of patients;
9 | - number of deaths;
10 | - number of recovered.
11 |
12 | ## Screenshots
13 | 
14 | 
15 |
16 | ## Installing
17 | 
18 |
19 | ## Built With
20 | * [Scriptable](https://apps.apple.com/ru/app/scriptable/id1405459188) - You can [download](https://apps.apple.com/ru/app/scriptable/id1405459188) this App for iPhone and iPad in App Store.
21 |
22 | ## Version
23 | 1.1
24 |
25 | ## Authors
26 | * **extendedzero** - [extendedzero](https://github.com/extendedzero)
27 |
28 | ## License
29 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
30 |
31 | ## Acknowledgments
32 | * Very Thanks all known and unknown people whose codes parts I used. :bowtie:
33 |
--------------------------------------------------------------------------------
/Covid-19 Ukraine Stats/preview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19 Ukraine Stats/preview_1.png
--------------------------------------------------------------------------------
/Covid-19 Ukraine Stats/preview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19 Ukraine Stats/preview_2.png
--------------------------------------------------------------------------------
/Covid-19 Ukraine Stats/preview_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19 Ukraine Stats/preview_3.png
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/Covid-19 Multilang.js:
--------------------------------------------------------------------------------
1 | //Version 1.2
2 | //This widget shows daily current statistics of COVID-19 in Ukraine.
3 | //Displayed (for today):
4 | //- the number of identified patients today (updated in the morning around 9:00);
5 | //- the total number of patients;
6 | //- number of deaths;
7 | //- number of recovered.
8 | //Ukraine language.
9 |
10 | //This Scriptable Wodget is coded by eXtendedZero.
11 | //Very Thanks all known and unknown people whose codes parts I used. :-)
12 |
13 | // Variables used by Scriptable.
14 | // These must be at the very top of the file. Do not edit.
15 |
16 | //For country(language) setting use Parameter when Run Script.
17 | //UA - Ukraine and ukrainian language,
18 | //UK - United Kingdom and english language,
19 | //IT - Italy and italy language,
20 | //PL - Poland and poland language,
21 | //DE - Germany and germany language.
22 |
23 | var langId = args.widgetParameter
24 | var id = 0 //default UA
25 |
26 | switch(langId)
27 | {
28 | case "UA":
29 | id = 0
30 | break;
31 | case "UK":
32 | id = 1
33 | break;
34 | case "IT":
35 | id = 2
36 | break;
37 | case "PL":
38 | id = 3
39 | break;
40 | case "DE":
41 | id = 4
42 | break;
43 | }
44 |
45 | var lang = [{
46 | country: "Ukraine",
47 | cName: "Україна",
48 | total: "Всього",
49 | today: "Сьогодні",
50 | cases: "Захворіло",
51 | death: "Померло",
52 | recovered: "Одужало",
53 | statistic: "Статистика"
54 | },
55 | {country: "UK",
56 | cName: "England",
57 | total:"Total",
58 | today: "Today",
59 | cases: "Cases",
60 | death: "Deaths",
61 | recovered: "Recovered",
62 | statistic: "Statistic"
63 | },
64 | {country: "Italy",
65 | cName: "Italia",
66 | total: "Totale",
67 | today: "Oggi",
68 | cases: "Contagiati",
69 | death: "Decessi",
70 | recovered: "Guarriti",
71 | statistic: "Statistica"
72 | },
73 | {
74 | country: "Poland",
75 | cName: "Polska",
76 | total: "Ogólem",
77 | today: "Dzisiaj",
78 | cases: "Zakażenia",
79 | death: "Zgony",
80 | recovered: "Wyzdrowienia",
81 | statistic: "Statystyka"
82 | },
83 | {
84 | country: "Germany",
85 | cName: "Deutschland",
86 | total:"Gesamt",
87 | today: "Heute",
88 | cases: "Fälle",
89 | death: "Todesfälle",
90 | recovered: "Genesene",
91 | statistic: "Statistik"
92 | }
93 | ];
94 |
95 | const url = `https://coronavirus-19-api.herokuapp.com/countries/${lang[id].country}`
96 | const req = new Request(url)
97 | const res = await req.loadJSON()
98 |
99 | if (config.runsInWidget) {
100 | // create and show widget
101 | let widget = await createWidget(
102 | "COVID-19",
103 | lang[id].cName,
104 | lang[id].cases+` ${res.todayCases}`,
105 | lang[id].death+` ${res.todayDeaths}`,
106 | lang[id].cases+` ${res.cases}`,
107 | lang[id].death+` ${res.deaths}`,
108 | lang[id].recovered+` ${res.recovered}`,
109 | "#8b0000")
110 |
111 | Script.setWidget(widget)
112 | Script.complete()
113 | } else {
114 | // make table
115 | let table = new UITable()
116 |
117 | // add header
118 | let row = new UITableRow()
119 | row.isHeader = true
120 | row.addText(lang[id].statistic+` Covid-19 - ${lang[id].cName}`)
121 | table.addRow(row)
122 |
123 | // fill data
124 | table.addRow(createRow(lang[id].today,""))
125 | table.addRow(createRow(lang[id].cases, res.todayCases))
126 | table.addRow(createRow(lang[id].death, res.todayDeaths))
127 |
128 | table.addRow(createRow(lang[id].total, ""))
129 | table.addRow(createRow(lang[id].cases, res.cases))
130 | table.addRow(createRow(lang[id].death, res.deaths))
131 | table.addRow(createRow(lang[id].recovered, res.recovered))
132 |
133 | if (config.runsWithSiri)
134 | Speech.speak(`There are ${res.cases} cases in ${lang[id].country}, and ${res.todayCases} cases today.`)
135 |
136 | // present table
137 | table.present()
138 | }
139 |
140 | function createRow(title, number) {
141 | let row = new UITableRow()
142 | row.addText(title)
143 | row.addText(number.toString()).rightAligned()
144 | return row
145 | }
146 |
147 | async function createWidget(pretitle, title, today, todayDead, total, dead, recov, color) {
148 |
149 | let w = new ListWidget()
150 |
151 | w.backgroundColor = new Color(color)
152 | w.setPadding(0, 14, 0, 10)
153 |
154 | let row = w.addStack()
155 |
156 | let column = row.addStack()
157 | column.layoutVertically()
158 |
159 | let preText = column.addText(pretitle)
160 | preText.font=Font.systemFont(14)
161 | row.addSpacer(1)
162 |
163 | let titleTxt = column.addText(title)
164 | titleTxt.font=Font.systemFont(16)
165 | row.addSpacer(1)
166 |
167 | let req = new Request("https://i.imgur.com/OZLYIp5.png")
168 | let icon = await req.loadImage()
169 |
170 | row.layoutHorizontally()
171 | row.addSpacer(16)
172 |
173 | let iconImg = row.addImage(icon)
174 | iconImg.imageSize = new Size(36, 36)
175 |
176 | w.addSpacer(0)
177 | let todayTxtLabel = w.addText(lang[id].today)
178 | todayTxtLabel.textColor = Color.white()
179 | todayTxtLabel.textOpacity = 1.0
180 | todayTxtLabel.font=Font.boldSystemFont(12)
181 | todayTxtLabel.centerAlignText()
182 |
183 | w.addSpacer(0)
184 | let todayTxt = w.addText(today)
185 | todayTxt.textColor = Color.white()
186 | todayTxt.textOpacity = 1.0
187 | todayTxt.font=Font.systemFont(12)
188 |
189 | w.addSpacer(0)
190 | let todayTxtDead = w.addText(todayDead)
191 | todayTxtDead.textColor = Color.white()
192 | todayTxtDead.textOpacity = 1.0
193 | todayTxtDead.font=Font.systemFont(12)
194 |
195 | w.addSpacer(0)
196 | let totalTxtLabel = w.addText(lang[id].total)
197 | totalTxtLabel.textColor = Color.white()
198 | totalTxtLabel.textOpacity = 0.8
199 | totalTxtLabel.font=Font.boldSystemFont(12)
200 | totalTxtLabel.centerAlignText()
201 |
202 | w.addSpacer(0)
203 | let totalTxt = w.addText(total)
204 | totalTxt.textColor = Color.white()
205 | totalTxt.textOpacity = 0.8
206 | totalTxt.font = Font.systemFont(12)
207 |
208 | w.addSpacer(0)
209 | let deadTxt = w.addText(dead)
210 | deadTxt.textColor = Color.white()
211 | deadTxt.textOpacity = 0.8
212 | deadTxt.font = Font.systemFont(12)
213 |
214 | w.addSpacer(0)
215 | let recovTxt = w.addText(recov)
216 | recovTxt.textColor = Color.white()
217 | recovTxt.textOpacity = 0.8
218 | recovTxt.font = Font.systemFont(12)
219 |
220 | return w
221 | }
222 |
223 |
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/README.md:
--------------------------------------------------------------------------------
1 | # Covid-19-Multilang-Stats
2 | This widget shows daily current statistics of COVID-19 in Ukraine, England, Italy, Poland, Germany.
3 |
4 | ## Features
5 | Multi language.
6 | Displayed
7 | for today:
8 | - the number of identified patients today;
9 | - number of deaths;
10 |
11 | for total:
12 | - the total number of patients;
13 | - number of deaths;
14 | - number of recovered.
15 |
16 | ## Screenshots
17 | 
18 | 
19 | 
20 |
21 | ## Installing
22 | For country(language) setting use Parameter when Run Script.
23 | UA - for Ukraine and ukrainian language,
24 | UK - for United Kingdom and english language,
25 | IT - for Italy and italy language,
26 | PL - for Poland and poland language,
27 | DE - for Germany and germany language.
28 | Default setup UA.
29 | 
30 |
31 | ## Built With
32 | * [Scriptable](https://apps.apple.com/ru/app/scriptable/id1405459188) - You can [download](https://apps.apple.com/ru/app/scriptable/id1405459188) this App for iPhone and iPad in App Store.
33 |
34 | ## Version
35 | 1.2
36 |
37 | ## Authors
38 | * **extendedzero** - [extendedzero](https://github.com/extendedzero)
39 |
40 | ## License
41 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
42 |
43 | ## Acknowledgments
44 | * Very Thanks all known and unknown people whose codes parts I used. :bowtie:
45 |
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/preview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19-Multilang-Stats/preview_1.png
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/preview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19-Multilang-Stats/preview_2.png
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/preview_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19-Multilang-Stats/preview_3.png
--------------------------------------------------------------------------------
/Covid-19-Multilang-Stats/preview_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Covid-19-Multilang-Stats/preview_4.png
--------------------------------------------------------------------------------
/Losses_of_russia/.gitkeep:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Losses_of_russia/Losses_of_russia.js:
--------------------------------------------------------------------------------
1 | //Рускій воєний карабль - іді нахуй!
2 |
3 |
4 | //Version 1.2
5 | //Sorry for my English.
6 | //This Scriptable Widget is coded by eXtendedZero.
7 | //Very Thanks all known and unknown people whose codes parts I used.
8 | //Special thanks https://github.com/Juniorchen2012 for his script I used as template.
9 |
10 | //All data from pravda.com.ua.
11 | //Military icons from uawar.net.
12 |
13 | //---Losses of russia widget---
14 | //Description.
15 | //This widget shows russia's current losses in the war against Ukraine.
16 | //The widget is updated once a day around 10:00 Kyiv time.
17 | //For language setting use Parameter when Run Script.
18 | //UA - ukrainian language,
19 | //UK - english language.
20 |
21 |
22 | var langId = args.widgetParameter
23 | var id = 0 //default UA
24 |
25 | switch(langId)
26 | {
27 | case "UA":
28 | id = 0
29 | break;
30 | case "UK":
31 | id = 1
32 | break;
33 | }
34 |
35 | //get day, hours, min from war start
36 | let diffTime = Math.abs(new Date().valueOf() - new Date('2022-02-24T04:48:00').valueOf());
37 | let days = diffTime / (24*60*60*1000);
38 | let hours = (days % 1) * 24;
39 | let minutes = (hours % 1) * 60;
40 | let secs = (minutes % 1) * 60;
41 | [days, hours, minutes, secs] = [Math.floor(days), Math.floor(hours), Math.floor(minutes), Math.floor(secs)]
42 |
43 | //titles
44 | switch(id)
45 | {
46 | case 0://UA
47 | var title="Втрати росії:"
48 | var title2="Війна триває "+days+' днів '+ hours+' годин '+ minutes+' хвилин'
49 | break;
50 | case 1://UK
51 | var title="Losses of russia:"
52 | var title2="The war lasts "+days+' days '+ hours+' hours '+ minutes+' minutes'
53 | break;
54 | }
55 |
56 | //load to array icon images
57 | var imgArray = new Array()
58 | imgArray[0] = await loadImage(`https://i.postimg.cc/W34xvvXc/0.png`)
59 |
60 | imgArray[1] = await loadImage(`https://i.postimg.cc/QC9PFJ26/1.png`)
61 |
62 | imgArray[2] = await loadImage(`https://i.postimg.cc/sX0qfNNQ/2.png`)
63 |
64 | imgArray[3] = await loadImage(`https://i.postimg.cc/QC2z1Wsj/3.png`)
65 |
66 | imgArray[4] = await loadImage(`https://i.postimg.cc/FscrqyYg/4.png`)
67 |
68 | imgArray[5] = await loadImage(`https://i.postimg.cc/P5jXkCZG/5.png`)
69 |
70 | imgArray[6] = await loadImage(`https://i.postimg.cc/c1P1X9LL/6.png`)
71 |
72 | imgArray[7] = await loadImage(`https://i.postimg.cc/vZtQ8GL4/7.png`)
73 |
74 | imgArray[8] = await loadImage(`https://i.postimg.cc/PxPhMYGD/8.png`)
75 |
76 | imgArray[10] = await loadImage(`https://i.postimg.cc/vBky2TMN/9.png`)
77 |
78 | imgArray[9] = await loadImage(`https://i.postimg.cc/6QHtRzPw/10.png`)
79 |
80 | //imgArray[11] = await loadImage(`https://i.postimg.cc/MHBSCwpK/11.png`)
81 |
82 | //get main data
83 | const url = 'https://pravda.com.ua'
84 | const wv = new WebView()
85 | await wv.loadURL(url)
86 |
87 | let js = `Array.from(document.querySelectorAll('div.war_block div.war_item')).map( div => Array.from(div.children).map(span=>span.innerText))`
88 |
89 | var data = await wv.evaluateJavaScript(js)
90 |
91 | const name = [["Солдати","Літаки","Гелікоптери","Танки","ББМ","Артилерія","ППО","РСЗВ","Автотехніка","Кораблі","БПЛА"],["Soldiers","Aircrafts","Helicopters","Tanks","APV","Artillery","AAW","MLRS","Vehicles","Boats","UAV"]]
92 |
93 | //console.log(data)
94 | for (let i=0; i<11; i++)//13
95 | {
96 | temp=data[i][1]
97 | //remove space and +...
98 | data[i][1]=(data[i][1].replace(/\s/g, ``)).replace(/[+]\d+/g, ``)
99 |
100 | //remove space and ~...
101 | data[i][0]=(temp.replace(/\s/g, ``)).replace(/~\d+|^\d+/g, ``)
102 | }
103 |
104 | //remove полонені
105 | //data.splice(1, 1)
106 |
107 | //completed data
108 | //format: name, count, progress
109 | var res=[[],[]]
110 | for (let i=0; i<11; i++)//12
111 | {
112 | res[i]=[name[id][i],data[i][1],data[i][0]]
113 | }
114 | //console.log(res)
115 |
116 | const w = new ListWidget()
117 | w.backgroundColor = new Color("#46482e")
118 |
119 | const titlew= w.addText(title)
120 | titlew.textColor = new Color("#ffffff")
121 | titlew.font = Font.boldSystemFont(12)
122 | titlew.centerAlignText()
123 |
124 | w.addSpacer(4)//2
125 |
126 |
127 | for (let p=0; p<6; p++)
128 | {
129 |
130 | const stack = w.addStack()
131 | stack.layoutHorizontally()
132 | stack.centerAlignContent()
133 |
134 | const imgwidget=stack.addImage(imgArray[p])
135 | imgwidget.imageSize=new Size(16, 16)
136 |
137 | createTextStack(stack, `${res[p][0]}`, 65, "#ffffff")
138 | createTextStack(stack, `${res[p][1]}`, 40, "#ffffff")
139 | createTextStack(stack, `${res[p][2]}`, 40, "#ff1a00")
140 |
141 | if ((p+6)!=11)
142 | {
143 | const imgwidget2=stack.addImage(imgArray[p+6])
144 | imgwidget2.imageSize=new Size(16, 16)
145 |
146 |
147 | createTextStack(stack, `${res[p+6][0]}`, 70, "#ffffff")
148 | createTextStack(stack, `${res[p+6][1]}`, 30, "#ffffff")
149 | createTextStack(stack, `${res[p+6][2]}`, 30, "#ff1a00")
150 | }
151 |
152 | w.addSpacer(2)
153 |
154 | }
155 |
156 | const titlew2= w.addText(title2)
157 | titlew2.textColor = new Color("#ffffff")
158 | titlew2.font = Font.boldSystemFont(9)
159 | titlew2.centerAlignText()
160 |
161 |
162 | w.presentMedium()
163 | if (config.runsInWidget)
164 | {
165 | let widget = w
166 | Script.setWidget(widget)
167 | Script.complete()
168 | }
169 |
170 |
171 | function createTextStack(stack, text, width, color)
172 | {
173 | const tmpStack = stack.addStack()
174 | tmpStack.size = new Size(width, 14)//20
175 | widgetText = tmpStack.addText(text)
176 | //tmpStack.addSpacer()
177 | widgetText.font=Font.boldSystemFont(9)
178 | widgetText.textColor = new Color(color)
179 | widgetText.textOpacity = 0.9
180 | return widgetText
181 | }
182 |
183 |
184 | async function loadImage(imgUrl)
185 | {
186 | let req = new Request(imgUrl)
187 | let image = await req.loadImage()
188 | return image
189 | }
190 |
191 |
--------------------------------------------------------------------------------
/Losses_of_russia/README.md:
--------------------------------------------------------------------------------
1 | # Losses of russia
2 |
3 | This widget shows russia's current losses in the war against Ukraine.
4 |
5 | ## Features
6 | Ukraine and English languages.
7 | The widget is updated once a day around 10:00 Kyiv time.
8 |
9 | ## Screenshots
10 | 
11 | 
12 |
13 | ## Installing
14 | For language setting use Parameter when Run Script.
15 | UA - for ukrainian language,
16 | UK - for english language.
17 | Default setup UA.
18 | 
19 |
20 | ## Built With
21 | * [Scriptable](https://apps.apple.com/ru/app/scriptable/id1405459188) - You can [download](https://apps.apple.com/ru/app/scriptable/id1405459188) this App for iPhone and iPad in App Store.
22 |
23 | ## Version
24 | 1.2
25 |
26 | ## Authors
27 | * **extendedzero** - [extendedzero](https://github.com/extendedzero)
28 |
29 | ## License
30 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
31 |
32 | ## Acknowledgments
33 | * Very Thanks all known and unknown people whose codes parts I used. :bowtie:
34 |
--------------------------------------------------------------------------------
/Losses_of_russia/preview_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Losses_of_russia/preview_0.png
--------------------------------------------------------------------------------
/Losses_of_russia/preview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Losses_of_russia/preview_1.png
--------------------------------------------------------------------------------
/Losses_of_russia/preview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/Losses_of_russia/preview_2.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Scriptable-IOS-Widget
2 | Scripts collection for use with Scriptable App as IOS Widget.
3 | Download the App "Scriptable" from the App Store: https://apps.apple.com/us/app/scriptable/id1405459188
4 | and use this Scripts.
5 |
6 | 
7 |
--------------------------------------------------------------------------------
/SpaceLaunch/README.md:
--------------------------------------------------------------------------------
1 | # 🚀 Space Launch
2 |
3 | Minimalist widget that show upcoming launches in Space.
4 |
5 | ## Features
6 | Widget updates no more than once an hour.
7 |
8 | Data format:
9 | * [date time] - date, time upcoming launch
10 | * color icon - showing curren launch status
11 | 🚀 - the launch vehicle successfully inserted its payload into the target orbit
12 | 🔵 - in flight
13 | 🟢 - current T-0 confirmed by official or reliable resources
14 | 🟡 - await official confirmation - current date is known with some certainty
15 | ⚪️ - current date is placeholder or rough estimation based on unreliable or interpreted sources
16 | 🔴 - launch failure occurred
17 | * flag - rocket launch country flag
18 | * name - mission name
19 |
20 | ## Screenshots
21 | 
22 |
23 | ## Installing
24 | 
25 |
26 | ## Built With
27 | * [Scriptable](https://apps.apple.com/ru/app/scriptable/id1405459188) - You can [download](https://apps.apple.com/ru/app/scriptable/id1405459188) this App for iPhone and iPad in App Store.
28 |
29 | ## Version
30 | 1.0
31 |
32 | ## Authors
33 | * **extendedzero** - [extendedzero](https://github.com/extendedzero)
34 |
35 | ## License
36 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
37 |
38 | ## Acknowledgments
39 | * Very Thanks all known and unknown people whose codes parts I used. :bowtie:
40 |
--------------------------------------------------------------------------------
/SpaceLaunch/SpaceLaunch.js:
--------------------------------------------------------------------------------
1 | //Version 1.0
2 | //Sorry for my English.
3 | //This Scriptable Widget is coded by eXtendedZero.
4 | //Very Thanks all known and unknown people whose codes parts I used.
5 |
6 | //--- 🚀 Upcoming Launches ---
7 | //Description.
8 | //Minimalist widget that show upcoming launches in Space.
9 | //Widget updates no more than once an hour.
10 |
11 | //Data format:
12 | //• [date time] - date, time upcoming launch
13 | //• color icon - showing curren launch status
14 | // 🚀 - the launch vehicle successfully inserted its payload into the target orbit
15 | // 🔵 - in flight
16 | // 🟢 - current T-0 confirmed by official or reliable resources
17 | // 🟡 - await official confirmation - current date is known with some certainty
18 | // ⚪️ - current date is placeholder or rough estimation based on unreliable or interpreted sources
19 | // 🔴 - launch failure occurred
20 | //• flag - rocket launch country flag
21 | //• nane - mission name
22 |
23 |
24 | const rec_count=5
25 |
26 | var atNow = new Date
27 | let hh=atNow.getHours()
28 | let mm=atNow.getMinutes()
29 |
30 | if (hh < 10) hh = '0' + hh;
31 | if (mm < 10) mm = '0' + mm;
32 |
33 | var time_upd=hh+":"+mm
34 |
35 | //file
36 | var fm = FileManager.iCloud()
37 | var dir = fm.documentsDirectory()
38 | var path = fm.joinPath(dir, "space.txt")
39 |
40 | if (!fm.fileExists(path))
41 | {
42 | fm.writeString(path, (hh-1)+":"+mm)
43 | }
44 |
45 | var tt = fm.readString(path)
46 | let h0=tt.split(":")[0]
47 | let m0=tt.split(":")[1]
48 |
49 | var dat0=new Date()
50 | dat0.setHours(h0)
51 | dat0.setMinutes(m0)
52 |
53 | var dat2=new Date()
54 | dat2.setHours(hh)
55 | dat2.setMinutes(mm)
56 |
57 | let dif=Math.abs((dat2-dat0)/(1000*60))
58 |
59 | //updates no more than once an hour
60 | if (dif>60)
61 | {
62 |
63 | fm.writeString(path, hh+":"+mm)
64 |
65 | let req = new Request('https://ll.thespacedevs.com/2.2.0/launch/upcoming/?format=json&limit='+rec_count+'&mode=normal');
66 |
67 | //load JSON
68 | let res = await req.loadJSON();
69 |
70 | const w = new ListWidget()
71 | const bgColor = new LinearGradient();
72 | bgColor.colors = [new Color("#18191a"), new Color("#0b0b45")];
73 | bgColor.locations = [0.0, 1.0];
74 | w.backgroundGradient = bgColor;
75 |
76 | let padding = 10;
77 | w.setPadding(5, padding, padding, padding);
78 |
79 | //title
80 | const titlew= w.addText('🚀 Upcoming Launches')
81 | titlew.textColor = new Color("#ffffff")
82 | titlew.font = Font.boldSystemFont(12)
83 | titlew.centerAlignText()
84 |
85 | w.addSpacer(4)
86 |
87 | for (let i=0; i 127397 + char.charCodeAt());
507 | return String.fromCodePoint(...codePoints);
508 | } else
509 | {
510 | return "🏁"
511 | }
512 | }
513 |
--------------------------------------------------------------------------------
/SpaceLaunch/preview_0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/SpaceLaunch/preview_0.png
--------------------------------------------------------------------------------
/SpaceLaunch/preview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/extendedzero/Scriptable-IOS-Widget/8c3907b60d8bfa739047c581c461094d68cbcd3e/SpaceLaunch/preview_1.png
--------------------------------------------------------------------------------
/WhereIsWebb/README.md:
--------------------------------------------------------------------------------
1 | # WhereIsWebb
2 |
3 | Minimalist widget that show major deployment/commissioning schedule phases, its current deployment/commissioning state and status of that state James Webb space telescope.
4 |
5 | ## Features
6 | When tap on widget, the link will open in Safari to view more information.
7 |
8 | ## Screenshots
9 | 
10 |
11 | ## Installing
12 | 
13 |
14 | ## Built With
15 | * [Scriptable](https://apps.apple.com/ru/app/scriptable/id1405459188) - You can [download](https://apps.apple.com/ru/app/scriptable/id1405459188) this App for iPhone and iPad in App Store.
16 |
17 | ## Version
18 | 1.0
19 |
20 | ## Authors
21 | * **extendedzero** - [extendedzero](https://github.com/extendedzero)
22 |
23 | ## License
24 | This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
25 |
26 | ## Acknowledgments
27 | * Very Thanks all known and unknown people whose codes parts I used. :bowtie:
28 |
29 |
--------------------------------------------------------------------------------
/WhereIsWebb/WhereIsWebb.js:
--------------------------------------------------------------------------------
1 | //Version 1.0
2 | //Sorry for my English.
3 | //This Scriptable Widget is coded by eXtendedZero
4 | //Very Thanks all known and unknown people whose codes parts I used.
5 |
6 | //--- WhereIsWebb ---
7 | //Description.
8 | //Minimalist widget that show major deployment/commissioning schedule phases, its current deployment/commissioning state and status of that state James Webb space telescope.
9 |
10 |
11 | var url="https://webb.nasa.gov/content/webbLaunch/whereIsWebb.html"
12 |
13 | let html = await loadHTML(url)
14 |
15 | //get title
16 | let ttl=html.match(/"title":".*",/g)
17 | let ttl_count=ttl.length
18 | var title=new Array(ttl_count)
19 | for (let i=0; i]+)>)/g, "").trim()
45 |
46 | }
47 |
48 | //get status
49 | let stts=html.match(/"status" : ".*",/g)
50 | let stts_count=stts.length
51 | var status=new Array(stts_count)
52 | for (let i=0; i]+)>)/g, "").trim()
58 |
59 | }
60 |
61 | //get icon image url
62 | //not used now
63 | let icn=html.match(/"thumbnailUrl":".*",/g)
64 | let icn_count=icn.length
65 | var icon_url=new Array(icn_count)
66 | for (let i=0; i