Skip to content
Browse files

fixed controller format for the scraper controller

  • Loading branch information...
1 parent c02206c commit 8041318a5899eb31a65d7a3196824c1b0671c176 @farski committed Nov 21, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 controllers/scraper_controller.js
View
6 controllers/scraper_controller.js
@@ -1,3 +1,5 @@
+Pactrac.scraper = {};
+
Array.prototype.PTunique = function () {
var r = new Array();
o:for(var i = 0, n = this.length; i < n; i++)
@@ -14,7 +16,7 @@ Array.prototype.PTunique = function () {
return r;
}
-Pactrac.scrape = function (request, sender, sendResponse) {
+Pactrac.scraper.scrape = function (request, sender, sendResponse) {
var patterns = {};
patterns.ups = /\b(1Z ?[0-9A-Z]{3} ?[0-9A-Z]{3} ?[0-9A-Z]{2} ?[0-9A-Z]{4} ?[0-9A-Z]{3} ?[0-9A-Z]|[\dT]\d\d\d ?\d\d\d\d ?\d\d\d)\b/gi;
patterns.fedex = /\b(\d\d\d\d ?\d\d\d\d ?\d\d\d\d)\b/ig;
@@ -37,4 +39,4 @@ Pactrac.scrape = function (request, sender, sendResponse) {
sendResponse(parcels);
}
-chrome.extension.onRequest.addListener(Pactrac.scrape);
+chrome.extension.onRequest.addListener(Pactrac.scraper.scrape);

0 comments on commit 8041318

Please sign in to comment.
Something went wrong with that request. Please try again.