Skip to content

Commit adc0c47

Browse files
committed
fix tests
1 parent 456d955 commit adc0c47

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/item.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ const Item = function (options) {
2222
return this;
2323
};
2424

25+
Item.prototype.getUrl = function () {
26+
if(this.link) {
27+
if(!this.link.startsWith("http")) {
28+
return "http:" + this.link;
29+
}
30+
return this.link;
31+
}
32+
var category = this.category;
33+
if(!category) {
34+
category = "cat";
35+
}
36+
return "http://www.leboncoin.fr/" + category + "/" + this.id + ".htm/";
37+
}
38+
2539

2640
Item.prototype.getDetails = function () {
2741
var self = this;

0 commit comments

Comments
 (0)