From 159b00145dfc390e9e8e6315a1413985068142bf Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Mon, 5 Mar 2018 14:46:15 +0500 Subject: [PATCH] [VkBridge] Setting feed title (#635) * [VkBridge] Setting feed title --- bridges/VkBridge.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bridges/VkBridge.php b/bridges/VkBridge.php index 85bf60c..4eba961 100644 --- a/bridges/VkBridge.php +++ b/bridges/VkBridge.php @@ -17,6 +17,8 @@ class VkBridge extends BridgeAbstract ) ); + protected $pageName; + public function getURI() { if (!is_null($this->getInput('u'))) { @@ -26,15 +28,24 @@ class VkBridge extends BridgeAbstract return parent::getURI(); } + public function getName() + { + if ($this->pageName) { + return $this->pageName; + } + + return parent::getName(); + } + public function collectData() { - $text_html = $this->getContents() or returnServerError('No results for group or user name "' . $this->getInput('u') . '".'); $text_html = iconv('windows-1251', 'utf-8', $text_html); $html = str_get_html($text_html); $pageName = $html->find('.page_name', 0)->plaintext; + $this->pageName = $pageName; foreach ($html->find('.post') as $post) {