Skip to content

Commit

Permalink
Added stripping of newlines to beer names in the Beer plugin data imp…
Browse files Browse the repository at this point in the history
…ort script and updated its pregenerated database
  • Loading branch information
Matthew Turland committed Aug 2, 2010
1 parent f979f86 commit 6e5b1db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Binary file modified Phergie/Plugin/Beer/beer.db
Binary file not shown.
2 changes: 2 additions & 0 deletions Phergie/Plugin/Beer/db.php
Expand Up @@ -35,6 +35,7 @@
$db->beginTransaction();
foreach ($beers as $beer) {
$name = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $beer->textContent);
$name = preg_replace('/\h*\v+\h*/', '', $name);
$link = 'http://beerme.com' . $beer->childNodes->item(1)->getAttribute('href');
$insert->execute(array($name, $link));
}
Expand Down Expand Up @@ -66,6 +67,7 @@
while ($line = fgetcsv($fp, 0, '|')) {
$line = array_combine($columns, $line);
$name = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $line['name']);
$name = preg_replace('/\h*\v+\h*/', '', $name);
$link = null;
$insert->execute(array($name, $link));
}
Expand Down

0 comments on commit 6e5b1db

Please sign in to comment.