1
0
Fork 0
forked from blallo/rss-bridge

[TwitterBridgeExtended] Directly write content to ->title

This commit is contained in:
logmanoriginal 2016-08-10 10:26:29 +02:00
parent 6138031793
commit 89aad9f796

View file

@ -45,6 +45,8 @@ class TwitterBridgeExtended extends BridgeAbstract{
$item->username = $tweet->getAttribute('data-screen-name'); $item->username = $tweet->getAttribute('data-screen-name');
// extract fullname (pseudonym) // extract fullname (pseudonym)
$item->fullname = $tweet->getAttribute('data-name'); $item->fullname = $tweet->getAttribute('data-name');
// get author
$item->author = $item->fullname . ' (@' . $item->username . ')';
// get avatar link // get avatar link
$item->avatar = $tweet->find('img', 0)->src; $item->avatar = $tweet->find('img', 0)->src;
// get TweetID // get TweetID
@ -53,8 +55,8 @@ class TwitterBridgeExtended extends BridgeAbstract{
$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 // 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');
// extract plaintext // generate the title
$item->content_simple = str_replace('href="/', 'href="https://twitter.com/', html_entity_decode(strip_tags($tweet->find('p.js-tweet-text', 0)->innertext, '<a>'))); $item->title = strip_tags($tweet->find('p.js-tweet-text', 0)->innertext);
// processing content links // processing content links
foreach($tweet->find('a') as $link) { foreach($tweet->find('a') as $link) {
@ -86,8 +88,6 @@ class TwitterBridgeExtended extends BridgeAbstract{
</div> </div>
EOD; EOD;
// generate the title
$item->title = $item->fullname . ' (@'. $item->username . ') | ' . $item->content_simple;
// put out // put out
$this->items[] = $item; $this->items[] = $item;
} }