Create IPCustom.js

This commit is contained in:
Shawn
2019-06-29 18:16:15 +08:00
committed by GitHub
parent b273590e98
commit 55ac42ae0b

20
Scripts/IPCustom.js Normal file
View File

@@ -0,0 +1,20 @@
// if ($response.statusCode != 200) {
// $done(Null);
// }
// var body = $response.body;
// var obj = JSON.parse(body);
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
const foods = ['🍎', '🍐', '🍊', '🍋', '🍌', '🍉', '🍇', '🍓', '🍈', '🍒', '🍑', '🥭', '🍅']
var title = foods[getRandomInt(foods.length)];
var subtitle = '今天吃什么水果?';
var ip = '1.1.1.1';
var description = 'description'+ip;
$done({title, subtitle, ip, description});