Skip to content

Instantly share code, notes, and snippets.

@Fndroid
Last active November 22, 2019 09:41
Show Gist options
  • Save Fndroid/061aeb7b09e3f7f6c36c540b9b5c9382 to your computer and use it in GitHub Desktop.
Save Fndroid/061aeb7b09e3f7f6c36c540b9b5c9382 to your computer and use it in GitHub Desktop.
if ($response.statusCode != 200) {
$done(Null);
}
// test
const body = $response.body;
const bodyJson = JSON.parse(body)
function getRandomInt(max) {
return Math.floor(Math.random() * Math.floor(max));
}
const foods = ['🍎', '🍐', '🍊', '🍍', '🍌', 'πŸ‰', 'πŸ‡', 'πŸ“', '🍈', 'πŸ’', 'πŸ‘', 'πŸ₯­', 'πŸ…']
const f1 = foods[getRandomInt(foods.length)]
const foods2 = foods.filter(f => f !== f1)
const f2 = foods2[getRandomInt(foods2.length)]
const title = `${f1} or ${f2}`;
const subtitle = 'δ»Šε€©εƒδ»€δΉˆζ°΄ζžœοΌŸ';
const ip = bodyJson.query;
const description = 'Fndroid' + '\n' + body;
$done({title, subtitle, ip, description});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment