Skip to content

Instantly share code, notes, and snippets.

@peterdemin
Created May 27, 2017 21:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterdemin/3015b72e4e54c45d559439227373ac6d to your computer and use it in GitHub Desktop.
Save peterdemin/3015b72e4e54c45d559439227373ac6d to your computer and use it in GitHub Desktop.
Banks aggregation
checks:
- name: bofa
url: https://www.bankofamerica.com/
form:
- id: onlineid1
creds: keyring.bofa.username
- id: passcode1
creds: keyring.bofa.password
- id: hp-sign-in-btn
click: true
delay: 5
transform:
- css-all: .balancevalue
- text
notify:
- stash:
bofa_checking: "{{ lines.0 }}"
bofa_savings: "{{ lines.1 }}"
bofa_credit: "{{ lines.2 }}"
period: 3 hours
- name: discover
url: https://www.discover.com/
form:
- id: userid
creds: keyring.discover.username
- id: password
creds: keyring.discover.password
delay: 5
transform:
- css: .current-balance
- text
notify:
- stash:
discover: "${{ content }}"
period: 3h
- name: amex
url: https://global.americanexpress.com/dashboard
form:
- id: lilo_username
creds: keyring.amex.username
- id: lilo_password
creds: keyring.amex.password
- id: lilo_formsubmit
click: true
delay: 10
transform:
- xpath: '//*[@id="root"]/div[1]//section//li[2]/div/div[2]/span'
- text
notify:
- stash:
amex: "{{ content }}"
period: 3h
- name: summary
script: echo dummy
transform:
- jinja: |
{%- set bofa = stash.bofa_credit | float -%}
{%- set discover = stash.discover | float -%}
{%- set amex = stash.amex | float -%}
{%- set checking = stash.bofa_checking | float -%}
{%- set savings = stash.bofa_savings | float -%}
{%- set credits = bofa + discover + amex -%}
{%- set total = -bofa - discover - amex + checking + savings -%}
```text
checking {{ '%10s' % stash.bofa_checking }}
savings {{ '%10s' % stash.bofa_savings }}
credit cards:
bofa {{ '%10s' % stash.bofa_credit }}
discover {{ '%10s' % stash.discover }}
amex {{ '%10s' % stash.amex }}
*total* {{ '%10s' % credits | dollars }}
-----------------------
balance {{ '%10s' % total | dollars }}
```
- changes: new
notify:
- telegram
period: 3 hours
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment