mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-23 01:55:27 +03:00
parent
26ce16baa2
commit
159b00145d
1 changed files with 12 additions and 1 deletions
|
@ -17,6 +17,8 @@ class VkBridge extends BridgeAbstract
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
protected $pageName;
|
||||||
|
|
||||||
public function getURI()
|
public function getURI()
|
||||||
{
|
{
|
||||||
if (!is_null($this->getInput('u'))) {
|
if (!is_null($this->getInput('u'))) {
|
||||||
|
@ -26,15 +28,24 @@ class VkBridge extends BridgeAbstract
|
||||||
return parent::getURI();
|
return parent::getURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getName()
|
||||||
|
{
|
||||||
|
if ($this->pageName) {
|
||||||
|
return $this->pageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
return parent::getName();
|
||||||
|
}
|
||||||
|
|
||||||
public function collectData()
|
public function collectData()
|
||||||
{
|
{
|
||||||
|
|
||||||
$text_html = $this->getContents()
|
$text_html = $this->getContents()
|
||||||
or returnServerError('No results for group or user name "' . $this->getInput('u') . '".');
|
or returnServerError('No results for group or user name "' . $this->getInput('u') . '".');
|
||||||
|
|
||||||
$text_html = iconv('windows-1251', 'utf-8', $text_html);
|
$text_html = iconv('windows-1251', 'utf-8', $text_html);
|
||||||
$html = str_get_html($text_html);
|
$html = str_get_html($text_html);
|
||||||
$pageName = $html->find('.page_name', 0)->plaintext;
|
$pageName = $html->find('.page_name', 0)->plaintext;
|
||||||
|
$this->pageName = $pageName;
|
||||||
|
|
||||||
foreach ($html->find('.post') as $post) {
|
foreach ($html->find('.post') as $post) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue