-
Notifications
You must be signed in to change notification settings - Fork 0
/
www.4wheelparts.com.txt
30 lines (28 loc) · 1.11 KB
/
www.4wheelparts.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("t_pn") != -1)
{
object.buyurl = url;
object.manufacturer= $html.filter('h1').next().children().text();
object.manufacturerid = url.split("t_pn")[1].split("=")[1];
object.prodname= $html.filter('h1').text();
object.price= $html.filter('ul[class="productPricing"]').last().filter('span[class="price"]').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();
}