Acount Ability

Description

Screen shots

The AccountAbility project aims to give consumers convenient access to the social responsibility of their purchases via online bank statements. In particular, we want to make use of resources that gather product and company reviews, as well as distill these reviews into quantifiable numbers, or ratings.

The first step is to create a firefox extension that demonstrates how users will interact with socially responsible information inserted into their online bank statements. This extension does the following:

  1. Extract merchant names and, if possible, locations from the bank statement
  2. Use the Buy It Like You Mean It (BILUMI) open data API to retrieve aggregated company ratings and, if necessary, locations for each merchant
  3. Insert ratings into the transaction listings
  4. Use the BILUMI open data API to map the locations of merchants, as well as the locations of recommended merchants
  5. Encourage users to create customized BILUMI portfolios, which can then automatically be used when calculating ratings and recommending merchants

Although not stricly necessary for the demo, it is crucial to a usable and informative application that we gather tons of data, in this case reviews and ratings, as well as purchase types and merchant locations. We may choose to target specific merchants or metrics. We expect to make use of at least two open data APIs to this end, as well as a community effort in data entry (specifically in rating reviews that have been programmatically scraped from trusted NGO websites).

Based on feedback from the demo, presentations and collaborators in and around the Center for Future Banking, we will decide if additional applications and technology need be developed. One long-term goal is to for Bank of America to include this information, perhaps as a preference, in online bank statements.

Demo Installation

The demo, which at a proof of concept stage, is currently a greasemonkey script. To install you must do the following:

  1. Install greasemonkey if you don't already have it. The demo was written for version 0.8, currently the latest (Oct, 2008).
  2. Click here to install the accountability.user.js greasemonkey script automatically.

The script is tailored for a Bank of America credit card online statement and will likely fail to work on anything else because of different css selectors. Eit.

Feedback is welcome.

Technical Neatness

Padded Json

Question: How does one use javascript and a XMLHttpRequest object to make a post/get request to a different server than the one providing the page currently being viewed AND then display the response in a proper way? How does one get past the "Cross-domain Ajax request" restrictions imposed by the browser?

Answer: Padded json. For example, using jquery's getJSON function:

$.getJSON(
               "http://staging.thoughtandmemory.org/Main/api/get/rating/?name="+name+"&return_fake_data=True&callback=?",
               function(data) {
                       GM_log("\nrating: " + data.rating + "\ncount: " + data.count +
"\nnode_ids: " + eval(data.node_ids));
                       var r = '?';
                       if (data.rating != '') { r = parseInt(data.rating) }
                       //elem.append("<span class='"+RATING_SPAN_CLASS+"'>("+r+")</span>");
                       elem.prepend("<span class='"+RATING_SPAN_CLASS+"'>("+r+")</span>");
                       $("."+RATING_SPAN_CLASS).css("float","right");
               }
       );

Jquery automatically inserts a value for the callback GET parameter in the call to BILUMI's server. Let's say that method is called C1234. So BILUMI's server receives a request for

http://staging.thoughtandmemory.org/Main/api/get/rating/?name="+name+"&return_fake_data=True&callback=C1234

Bilumi's server does some django/python stuff to retrieve ratings for the request name. Instead of sending back a straight json response, eg

 { 'rating': 4 }

it sends back padded json, eg

 C1234({'rating':4})

which the javascript executes.

Jquery automatically uses ties the callback name to the nameless function given to getJSON.

Google Map Insertion

One can't simply insert a google map into Bank of America, even if using the appropriate developer key. In my experience (I don't know the theoretical reason for the failure, only the practical).

The solution is to insert an iframe that displays a page from Bilumi containing only the map.

Data

Dang. we don't know where merchants are located. Maybe those details are provided by the merchant, maybe they provide a phone number that we could track down. Instead, we simply tell Bilumi that it's OK to return fake data. Including fake ratings, since unless you're purchasing directly from chocolate companies you won't get many ratings.

This isn't random data since that would break REST GET. Instead, we hash the requested name and return an existing node that deterministically matches (the ith node more or less).

The default on our API is to return real data or unknown, but sometimes a demo with fake data can help others see the important in investing in the challenge of obtaining real data.

Attachments