diff --git a/Scripts/IPCustom.js b/Scripts/IPCustom.js index 949566c..0cb56ff 100644 --- a/Scripts/IPCustom.js +++ b/Scripts/IPCustom.js @@ -5,16 +5,22 @@ // var body = $response.body; // var obj = JSON.parse(body); +if ($response.statusCode != 200) { + $done(Null); +} + function getRandomInt(max) { return Math.floor(Math.random() * Math.floor(max)); } const foods = ['🍎', '🍐', '🍊', 'πŸ‹', '🍌', 'πŸ‰', 'πŸ‡', 'πŸ“', '🍈', 'πŸ’', 'πŸ‘', 'πŸ₯­', 'πŸ…'] +const emojis= ['πŸ˜„','😁','😒','πŸ€—','😑','😴','πŸ€‘','πŸ‘½','πŸ€–','πŸŽƒ'] -var title = foods[getRandomInt(foods.length)]; -var subtitle = 'δ»Šε€©εƒδ»€δΉˆζ°΄ζžœοΌŸ'; -var ip = '1.1.1.1'; -var description = 'description'+ip; - +var body = $response.body; +var obj = JSON.parse(body); +var title = foods[getRandomInt(foods.length)]+' ' +obj['country'] + ' ' + emojis[getRandomInt(emojis.length)]; +var subtitle = obj['city'] + ' ' + obj['isp']; +var ip = obj['query']; +var description = obj['country'] + '\n' + obj['city'] + '\n' + obj['isp'] + '\n' + obj['ipType']+ '\n' + ip; $done({title, subtitle, ip, description});