Skip to content

Commit

Permalink
PENIS
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed May 29, 2019
1 parent 61aa40d commit ef089f3
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
6 changes: 3 additions & 3 deletions go.sh
Expand Up @@ -4,9 +4,9 @@ access_token=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJlYiI6IkpiMnhrdzVWNUh0WE1XMU
account_id=acc_00009OeBcb40RrGoHJQAwD
dedupe_id=$RANDOM-lol
current_pot_value=$(http "https://api.monzo.com/pots" "Authorization: Bearer $access_token" | jq ".pots[] | select(.id==\"$pot_id\") | .balance")
echo "there's currently $current_pot_value in the amex pot"
echo "there's currently $current_pot_value pennies in the amex pot"
current_balance=$(($(node index.js) * 100))
echo "the amex balance is $current_balance"
echo "the amex balance is $current_balance pennies"
increase=$((current_balance - current_pot_value))
echo "that's an increase of $increase pennies"

Expand All @@ -23,4 +23,4 @@ http --form PUT "https://api.monzo.com/pots/$pot_id/deposit" \

echo "transaction complete!!"
current_pot_value=$(http "https://api.monzo.com/pots" "Authorization: Bearer $access_token" | jq ".pots[] | select(.id==\"$pot_id\") | .balance")
echo "there's now $current_pot_value in the pot ^_^"
echo "there's now $current_pot_value pennies in the pot ^_^"
19 changes: 15 additions & 4 deletions index.js
@@ -1,7 +1,11 @@
let pup = require("puppeteer")
let pup = require("puppeteer");

void (async function() {
let puppy = await pup.launch({ headless: false })
(async function() {
let puppy = await pup.launch({
headless: !false,
args: ['--no-sandbox'],
timeout: 5000
})
let bone = await puppy.newPage()
await bone.goto(
"https://global.americanexpress.com/login/en-GB?noRedirect=true&DestPage=%2Fdashboard"
Expand All @@ -10,6 +14,10 @@ void (async function() {
await bone.type(".eliloUserId input", "snootgirl22")
await bone.waitForSelector(".eliloPassword input")
await bone.type(".eliloPassword input", "magicfriend22")
await new Promise(resolve => setTimeout(resolve), 2000)
await bone.mouse.move(10, 20)
await bone.mouse.down()
await bone.mouse.up()
await bone.click("[type=submit]")
await bone.waitForSelector(".summary-container")
await bone.waitForSelector(
Expand All @@ -33,4 +41,7 @@ void (async function() {
console.log(currentBalance)

await puppy.close()
})()
})().catch(x => {
console.error(x)
process.exit(1)
})
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -11,6 +11,6 @@
"license": "ISC",
"dependencies": {
"amex": "0.0.1",
"puppeteer": "^1.15.0"
"puppeteer": "^1.17.0"
}
}

0 comments on commit ef089f3

Please sign in to comment.