Removed gender and marital status for better privacy

This commit is contained in:
hauke 2015-12-24 08:42:48 +01:00
commit cd976b8dcc
14 changed files with 9 additions and 119 deletions

View file

@ -103,7 +103,7 @@ function scrape_dfrn($url, $max_nodes=3500) {
$nodes_left = max(intval($max_nodes), $minNodes);
$items = $dom->getElementsByTagName('*');
$targets = array('fn', 'pdesc', 'photo', 'key', 'locality', 'region', 'postal-code', 'country-name', 'gender', 'marital');
$targets = array('fn', 'pdesc', 'photo', 'key', 'locality', 'region', 'postal-code', 'country-name');
$targets_left = count($targets);
foreach($items as $item) {
if(attribute_contains($item->getAttribute('class'), 'vcard')) {
@ -141,16 +141,8 @@ function scrape_dfrn($url, $max_nodes=3500) {
$ret['country-name'] = $x->textContent;
$targets_left = pop_scrape_target($targets, 'country-name');
}
if(attribute_contains($x->getAttribute('class'),'x-gender')){
$ret['gender'] = $x->textContent;
$targets_left = pop_scrape_target($targets, 'gender');
}
}
}
if(attribute_contains($item->getAttribute('class'),'marital-text')){
$ret['marital'] = $item->textContent;
$targets_left = pop_scrape_target($targets, 'marital');
}
$nodes_left--;
if($nodes_left <= 0 || $targets_left <= 0) break;
}

View file

@ -114,8 +114,6 @@ function run_submit($url) {
`region` = '%s',
`postal-code` = '%s',
`country-name` = '%s',
`gender` = '%s',
`marital` = '%s',
`homepage` = '%s',
`nurl` = '%s',
`comm` = %d,
@ -129,8 +127,6 @@ function run_submit($url) {
$parms['region'],
$parms['postal-code'],
$parms['country-name'],
$parms['gender'],
$parms['marital'],
dbesc($url),
dbesc($nurl),
intval($parms['comm']),
@ -142,7 +138,7 @@ function run_submit($url) {
}
else {
$r = q("INSERT INTO `profile` ( `name`, `pdesc`, `locality`, `region`, `postal-code`, `country-name`, `gender`, `marital`, `homepage`, `nurl`, `comm`, `tags`, `created`, `updated` )
$r = q("INSERT INTO `profile` ( `name`, `pdesc`, `locality`, `region`, `postal-code`, `country-name`, `homepage`, `nurl`, `comm`, `tags`, `created`, `updated` )
VALUES ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s' )",
$parms['fn'],
$parms['pdesc'],
@ -150,8 +146,6 @@ function run_submit($url) {
$parms['region'],
$parms['postal-code'],
$parms['country-name'],
$parms['gender'],
$parms['marital'],
dbesc($url),
dbesc($nurl),
intval($parms['comm']),