[ScribdBridge] Fix bridge (#1478)

This commit is contained in:
Joseph 2022-03-24 20:32:16 +00:00 committed by GitHub
parent 8e2b65556f
commit 1ae7cf6530
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,8 +9,8 @@ class ScribdBridge extends BridgeAbstract {
'name' => 'Profile URL', 'name' => 'Profile URL',
'type' => 'text', 'type' => 'text',
'required' => true, 'required' => true,
'title' => 'Profile URL. Example: https://www.scribd.com/user/217860653/Legal-Momentum', 'title' => 'Profile URL. Example: https://www.scribd.com/user/164147088/Ars-Technica',
'exampleValue' => 'https://www.scribd.com/user/217860653/Legal-Momentum' 'exampleValue' => 'https://www.scribd.com/user/'
), ),
)); ));
@ -20,19 +20,16 @@ class ScribdBridge extends BridgeAbstract {
private $feedName = ''; private $feedName = '';
public function collectData() { public function collectData() {
$html = getSimpleHTMLDOM($this->getURI()); $html = getSimpleHTMLDOM($this->getURI());
$header = $html->find('div.header', 0); $this->feedName = $html->find('div.header', 0)->plaintext;
$this->feedName = $header->find('a', 0)->plaintext;
foreach($html->find('div.content ul li') as $index => $li) { foreach($html->find('ul.document_cells > li') as $index => $li) {
$item = array(); $item = array();
$item['title'] = $li->find('div.under_title', 0)->plaintext; $item['title'] = $li->find('div.under_title', 0)->plaintext;
$item['uri'] = $li->find('a', 0)->href; $item['uri'] = $li->find('a', 0)->href;
$item['author'] = $li->find('span.uploader', 0)->plaintext; $item['author'] = $li->find('span.uploader', 0)->plaintext;
//$item['timestamp'] =
$item['uid'] = $li->find('a', 0)->href; $item['uid'] = $li->find('a', 0)->href;
$pageHtml = getSimpleHTMLDOMCached($item['uri'], 3600); $pageHtml = getSimpleHTMLDOMCached($item['uri'], 3600);