127.0.0.1:8000 budget / master test_email_parser.js
master

Tree @master (Download .tar.gz)

test_email_parser.js @masterraw · history · blame

require("dotenv").config();
const gmail_api = require('./server/external_apis/gmail/gmail_api');
const email_parsers = require('./server/external_apis/gmail/email_parsers');
const time = require('./server/utils/time');

async function test_parser() {
  const gmail = await gmail_api.get_authed_gmail(1);
  const email_parser = process.argv[2];
  if (email_parser) {
    const txns = await gmail_api.get_transactions_after(gmail, email_parsers[email_parser], time.today().subtract(5, 'month'));
    console.log(txns);
  }
  process.exit(0);
}
test_parser();