-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwww.eeuroparts.com.txt
30 lines (28 loc) · 1.1 KB
/
www.eeuroparts.com.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var EightyApp = function() {
this.processDocument = function(html, url, headers, status, jQuery) {
var app = this;
var $ = jQuery;
var $html = app.parseHtml(html, $);
var object = {};
if(url.indexOf("Parts") != -1)
{
object.buyurl = url;
object.manufacturer= $html.filter('span[itemprop="manufacturer"]').text();
object.manufacturerid = $html.filter('span[itemprop="productId"]').text();
object.prodname= $html.filter('h1').text();
object.price= $html.filter('span[class="UnitPrice"]').text().split("$")[1];
}
return JSON.stringify(object);
}
}
try {
// Testing
module.exports = function(EightyAppBase) {
EightyApp.prototype = new EightyAppBase();
return new EightyApp();
}
} catch(e) {
// Production
console.log("Eighty app exists.");
EightyApp.prototype = new EightyAppBase();
}