mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-29 06:38:51 +03:00
[BinanceBridge] Fix blog posts (#2226)
This commit is contained in:
parent
877707f7b2
commit
c673917aca
1 changed files with 9 additions and 13 deletions
|
@ -38,25 +38,21 @@ class BinanceBridge extends BridgeAbstract {
|
||||||
$html = getSimpleHTMLDOM($this->getURI())
|
$html = getSimpleHTMLDOM($this->getURI())
|
||||||
or returnServerError('Could not fetch Binance blog data.');
|
or returnServerError('Could not fetch Binance blog data.');
|
||||||
|
|
||||||
foreach($html->find('div[direction="row"]') as $element) {
|
$appData = $html->find('script[id="__APP_DATA"]');
|
||||||
|
$appDataJson = json_decode($appData[0]->innertext);
|
||||||
|
|
||||||
$date = $element->find('div[direction="column"]', 0);
|
foreach($appDataJson->pageData->redux->blogList->blogList as $element) {
|
||||||
$day = $date->find('div', 0)->innertext;
|
|
||||||
$month = $date->find('div', 1)->innertext;
|
|
||||||
$extractedDate = $day . ' ' . $month;
|
|
||||||
|
|
||||||
$abstract = $element->find('div[direction="column"]', 1);
|
$date = $element->postTime;
|
||||||
$a = $abstract->find('a', 0);
|
$abstract = $element->brief;
|
||||||
$uri = self::URI . $a->href;
|
$uri = self::URI . '/' . $element->lang . '/blog/' . $element->idStr;
|
||||||
$title = $a->innertext;
|
$title = $element->title;
|
||||||
|
$content = $element->content;
|
||||||
$full = getSimpleHTMLDOMCached($uri);
|
|
||||||
$content = $full->find('div.desc', 1);
|
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['title'] = $title;
|
$item['title'] = $title;
|
||||||
$item['uri'] = $uri;
|
$item['uri'] = $uri;
|
||||||
$item['timestamp'] = strtotime($extractedDate);
|
$item['timestamp'] = substr($date, 0, -3);
|
||||||
$item['author'] = 'Binance';
|
$item['author'] = 'Binance';
|
||||||
$item['content'] = $content;
|
$item['content'] = $content;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue