Skip to content

Commit

Permalink
fix problems with missing email addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
yetzt committed Nov 7, 2013
1 parent e213d29 commit 71eb8e6
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions bundesscraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,14 +606,20 @@ fetch.frak_spd = function(_callback){
name: $(this).find('h3 a').text(),
frak_url: url.resolve(base_url, $(this).find('h3 a').attr('href')),
fotos: [],
kontakt: [{
"type": "email",
"address": $(e).find('a.mail').attr('href').replace(/^mailto:/,'')
}],
kontakt: [],
web: []
};

$(e).find('.share li a').each(function(idx,f){
if ($(this).find('a.mail').length > 0) {
$(this).find('a.mail').each(function(idx,e){
_data.kontakt.push({
"type": "email",
"address": $(this).attr('href').replace(/^mailto:/,'')
})
});
}

$(this).find('.share li a').each(function(idx,f){
_data.web.push({
service: $(f).text(),
url: $(f).attr("href")
Expand Down Expand Up @@ -766,12 +772,16 @@ fetch.frak_gruene = function(_callback){
"copyright": null
}],
web: [],
kontakt: [{
"type": "email",
"address": $(e).find('.email_link a').attr('href').replace(/^mailto:/,'')
}]
kontakt: []
}

$(this).find('.email_link a').each(function(idx,e){
_data.kontakt.push({
"type": "email",
"address": $(this).attr('href').replace(/^mailto:/,'')
})
})

scraper.scrape(_data.frak_url, "html", function(err, $){

_count_fetched++;
Expand Down

0 comments on commit 71eb8e6

Please sign in to comment.