#!/usr/bin/python
import sys
import api
import getpass

# Banks
banks = {}
import bankofamerica
banks["bankofamerica"] = bankofamerica

print "Login"
print "Username: ",
username = sys.stdin.readline().strip()
password = getpass.getpass()

if not api.callapi("login",{"username": username, "password": password}):
    print "Login failed"
    sys.exit(1)

todo = api.callapi("accountstodo")
print todo

for account in todo:
    if account["bankname"] not in banks:
        print "No scraper for %s!" % (account["bankname"])
        continue
    print "Scraping %s..." % (account["bankname"])
    data = banks[account["bankname"].downloadaccount(account)
    for key in data:
        if data[key]:
            api.callapi("new"+key, data[key])

api.callapi("logout")

@@ -596,16 +596,27 @@
  data = 
+json.dumps(
 banks%5Bac
@@ -632,16 +632,17 @@
 nkname%22%5D
+%5D
 .downloa
@@ -662,96 +662,71 @@
 unt)
-%0A    for key in data:%0A        if data%5Bkey%5D:%0A            api.callapi(%22new%22+key, data%5Bkey%5D
+,default=str)%0A    api.callapi(%22newtransactions%22, %7B%22data%22: data%7D
 )%0A%0Aa

Send all scraped data in one big json dump.