Skip to content

Commit

Permalink
[PikabuBridge] Cut "script" element from post body (#2125)
Browse files Browse the repository at this point in the history
Also correct description and remove useless returnServerError call
  • Loading branch information
em92 committed May 23, 2021
1 parent 37cd071 commit 63d257d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bridges/PikabuBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class PikabuBridge extends BridgeAbstract {

const NAME = 'Пикабу';
const URI = 'https://pikabu.ru';
const DESCRIPTION = 'Выводит посты по тегу';
const DESCRIPTION = 'Выводит посты по тегу, сообществу или пользователю';
const MAINTAINER = 'em92';

const PARAMETERS_FILTER = array(
Expand Down Expand Up @@ -75,7 +75,7 @@ public function getName() {
public function collectData(){
$link = $this->getURI();

$text_html = getContents($link) or returnServerError('Could not fetch ' . $link);
$text_html = getContents($link);
$text_html = iconv('windows-1251', 'utf-8', $text_html);
$html = str_get_html($text_html);

Expand All @@ -87,6 +87,7 @@ public function collectData(){

$el_to_remove_selectors = array(
'.story__read-more',
'script',
'svg.story-image__stretch',
);

Expand Down

0 comments on commit 63d257d

Please sign in to comment.