[FicbookBridge] Add getName implementation (#1771)
This commit is contained in:
parent
712f60e910
commit
84d5daaa03
1 changed files with 21 additions and 0 deletions
|
@ -35,6 +35,8 @@ class FicbookBridge extends BridgeAbstract {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $titleName;
|
||||||
|
|
||||||
public function getURI() {
|
public function getURI() {
|
||||||
switch($this->queriedContext) {
|
switch($this->queriedContext) {
|
||||||
case 'Site News': {
|
case 'Site News': {
|
||||||
|
@ -56,6 +58,21 @@ class FicbookBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getName() {
|
||||||
|
switch($this->queriedContext) {
|
||||||
|
case 'Site News': {
|
||||||
|
return $this->queriedContext . ' | ' . self::NAME;
|
||||||
|
}
|
||||||
|
case 'Fiction Updates': {
|
||||||
|
return $this->titleName . ' | ' . self::NAME;
|
||||||
|
}
|
||||||
|
case 'Fiction Comments': {
|
||||||
|
return $this->titleName . ' | Comments | ' . self::NAME;
|
||||||
|
}
|
||||||
|
default: return self::NAME;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function collectData() {
|
public function collectData() {
|
||||||
|
|
||||||
$header = array('Accept-Language: en-US');
|
$header = array('Accept-Language: en-US');
|
||||||
|
@ -65,6 +82,10 @@ class FicbookBridge extends BridgeAbstract {
|
||||||
|
|
||||||
$html = defaultLinkTo($html, self::URI);
|
$html = defaultLinkTo($html, self::URI);
|
||||||
|
|
||||||
|
if ($this->queriedContext == 'Fiction Updates' or $this->queriedContext == 'Fiction Comments' ) {
|
||||||
|
$this->titleName = $html->find('.fanfic-main-info > h1', 0)->innertext;
|
||||||
|
}
|
||||||
|
|
||||||
switch($this->queriedContext) {
|
switch($this->queriedContext) {
|
||||||
case 'Site News': return $this->collectSiteNews($html);
|
case 'Site News': return $this->collectSiteNews($html);
|
||||||
case 'Fiction Updates': return $this->collectUpdatesData($html);
|
case 'Fiction Updates': return $this->collectUpdatesData($html);
|
||||||
|
|
Loading…
Reference in a new issue