mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
[bridges] Change all occurrences of the Item object to array
This commit is contained in:
@@ -57,23 +57,23 @@ class TwitterBridge extends BridgeAbstract{
|
||||
$hidePictures = $param['nopic'] === 'on';
|
||||
|
||||
foreach($html->find('div.js-stream-tweet') as $tweet) {
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
// extract username and sanitize
|
||||
$item->username = $tweet->getAttribute('data-screen-name');
|
||||
$item['username'] = $tweet->getAttribute('data-screen-name');
|
||||
// extract fullname (pseudonym)
|
||||
$item->fullname = $tweet->getAttribute('data-name');
|
||||
$item['fullname'] = $tweet->getAttribute('data-name');
|
||||
// get author
|
||||
$item->author = $item->fullname . ' (@' . $item->username . ')';
|
||||
$item['author'] = $item['fullname'] . ' (@' . $item['username'] . ')';
|
||||
// get avatar link
|
||||
$item->avatar = $tweet->find('img', 0)->src;
|
||||
$item['avatar'] = $tweet->find('img', 0)->src;
|
||||
// get TweetID
|
||||
$item->id = $tweet->getAttribute('data-tweet-id');
|
||||
$item['id'] = $tweet->getAttribute('data-tweet-id');
|
||||
// get tweet link
|
||||
$item->uri = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href');
|
||||
$item['uri'] = 'https://twitter.com'.$tweet->find('a.js-permalink', 0)->getAttribute('href');
|
||||
// extract tweet timestamp
|
||||
$item->timestamp = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time');
|
||||
$item['timestamp'] = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time');
|
||||
// generate the title
|
||||
$item->title = strip_tags(html_entity_decode($tweet->find('p.js-tweet-text', 0)->innertext,ENT_QUOTES,'UTF-8'));
|
||||
$item['title'] = strip_tags(html_entity_decode($tweet->find('p.js-tweet-text', 0)->innertext,ENT_QUOTES,'UTF-8'));
|
||||
|
||||
// processing content links
|
||||
foreach($tweet->find('a') as $link) {
|
||||
@@ -100,12 +100,12 @@ class TwitterBridge extends BridgeAbstract{
|
||||
$picture_html = '';
|
||||
if(!$hidePictures){
|
||||
$picture_html = <<<EOD
|
||||
<a href="https://twitter.com/{$item->username}"><img style="align: top; width:75 px; border: 1px solid black;" alt="{$item->username}" src="{$item->avatar}" title="{$item->fullname}" /></a>
|
||||
<a href="https://twitter.com/{$item['username']}"><img style="align: top; width:75 px; border: 1px solid black;" alt="{$item['username']}" src="{$item['avatar']}" title="{$item['fullname']}" /></a>
|
||||
EOD;
|
||||
}
|
||||
|
||||
// add content
|
||||
$item->content = <<<EOD
|
||||
$item['content'] = <<<EOD
|
||||
<div style="display: inline-block; vertical-align: top;">
|
||||
{$picture_html}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user