-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
R.Brown
committed
Feb 6, 2014
1 parent
1f6f4d7
commit 10cd3e8
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* Pixelio parser | ||
* | ||
* @package parser | ||
* @author Labs64 <[email protected]> | ||
**/ | ||
class Pixelio extends Parser | ||
{ | ||
|
||
const COPYRIGHT = '© %author% / <a href="http://www.pixelio.de" target="_blank">PIXELIO</a>'; | ||
|
||
const BASE_URL = 'http://www.pixelio.de/media/'; | ||
|
||
function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
protected function parse($number) | ||
{ | ||
$item = parent::parse($number); | ||
$item['source'] = 'Pixelio'; | ||
$item['publisher'] = 'Pixelio'; | ||
$item['license'] = 'Royalty-free'; | ||
|
||
$url = self::BASE_URL . $number; | ||
$doc = new DOMDocument(); | ||
$html = @$doc->loadHTMLFile($url); | ||
if ($html) { | ||
$xpath = new DOMXPath($doc); | ||
|
||
$tags = $xpath->query("//tr/td[contains(., 'Fotograf:')]/following::td[1]/a"); | ||
if (!is_null($tags) && $tags->length > 0) { | ||
$item['author'] = $tags->item(0)->textContent; | ||
} | ||
} | ||
|
||
return $item; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters