Comparing version 0.0.1 to 0.0.2
@@ -23,4 +23,4 @@ 'use strict'; | ||
obj.roles = this.trimArray($(e).find('h3 + p').text().split('/')); | ||
obj.dateBirth = $(e).find('h3 + p + p').text().replace('nar. ', ''); | ||
obj.placeBirth = $(e).find('h3 + p + p + p').text(); | ||
obj.dateBirth = $(e).find('h3 + p + p') ? $(e).find('h3 + p + p').text().replace('nar. ', '') : ''; | ||
obj.placeBirth = $(e).find('h3 + p + p + p') ? $(e).find('h3 + p + p + p').text() : ''; | ||
@@ -27,0 +27,0 @@ this.data.push(obj); |
@@ -22,6 +22,6 @@ 'use strict'; | ||
obj.id = obj.url.match(/film\/(\d+)\-/)[1]; | ||
obj.genres = this.trimArray($(e).find('h3 + p').text().split(',')[0].split('/')); | ||
obj.countries = this.trimArray($(e).find('h3 + p').text().split(',')[1].split('/')); | ||
obj.directors = this.trimArray( this.removeLineBreaks($(e).find('p + p').text().split('Hrají:')[0].replace('Režie:', '')).split(',') ); | ||
obj.actors = this.trimArray( this.removeLineBreaks($(e).find('p + p').text().split('Hrají:')[1]).split(',') ); | ||
obj.genres = $(e).find('h3 + p').text() ? this.trimArray($(e).find('h3 + p').text().split(',')[0].split('/')) : []; | ||
obj.countries = $(e).find('h3 + p').text() ? this.trimArray($(e).find('h3 + p').text().split(',')[1].split('/')) : []; | ||
obj.directors = $(e).find('p + p').text().split('Hrají:')[0] ? this.trimArray( this.removeLineBreaks($(e).find('p + p').text().split('Hrají:')[0].replace('Režie:', '')).split(',') ) : []; | ||
obj.actors = $(e).find('p + p').text().split('Hrají:')[1] ? this.trimArray( this.removeLineBreaks($(e).find('p + p').text().split('Hrají:')[1]).split(',') ) : []; | ||
@@ -28,0 +28,0 @@ this.data.push(obj); |
@@ -50,3 +50,6 @@ 'use strict'; | ||
csfd.removeLineBreaks = function(string){ | ||
return string.replace(/(\r\n|\n|\r|\t)/gm, ''); | ||
if(string){ | ||
string = string.replace(/(\r\n|\n|\r|\t)/gm, ''); | ||
} | ||
return string; | ||
}; |
{ | ||
"name": "csfd", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "csfd api", | ||
@@ -30,2 +30,2 @@ "keywords": [ | ||
"readmeFilename": "Readme.md" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# CSFD [![Build Status](https://secure.travis-ci.org/danielhusar/csfd.png?branch=master)](http://travis-ci.org/danielhusar/csfd) | ||
# CSFD [![Build Status](https://secure.travis-ci.org/danielhusar/csfd.svg?branch=master)](http://travis-ci.org/danielhusar/csfd) | ||
@@ -3,0 +3,0 @@ CSFD json api |
68242
15
197