MCPcopy
hub / github.com/deezertidal/shadowrocket-rules / getWeatherData

Function getWeatherData

js/tianqi.js:7–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5const isLoon = typeof $loon != "undefined";
6
7function getWeatherData() {
8 if (isQuantumultX) {
9 $task.fetch({ url: apiurl }).then(response => {
10 showNotification(response.body);
11 }, reason => {
12 console.log(reason.error);
13 $done();
14 });
15 } else if (isSurge || isLoon) {
16 $httpClient.get(apiurl, function (error, response, data) {
17 if (error) {
18 console.log(error);
19 $done();
20 } else {
21 showNotification(data);
22 }
23 });
24 }
25}
26
27function showNotification(data) {
28 var obj = JSON.parse(data);

Callers 1

tianqi.jsFile · 0.85

Calls 1

showNotificationFunction · 0.85

Tested by

no test coverage detected