[TwitterBridge] code simplification

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-29 23:36:49 +02:00
parent fa294e2b4c
commit 351e1e9a6a

View file

@ -86,7 +86,7 @@ class TwitterBridge extends BridgeAbstract{
// get TweetID
$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'] = $this->uri.$tweet->find('a.js-permalink', 0)->getAttribute('href');
// extract tweet timestamp
$item['timestamp'] = $tweet->find('span.js-short-timestamp', 0)->getAttribute('data-time');
// generate the title
@ -111,7 +111,7 @@ class TwitterBridge extends BridgeAbstract{
}
// get tweet text
$cleanedTweet = str_replace('href="/', 'href="https://twitter.com/', $tweet->find('p.js-tweet-text', 0)->innertext);
$cleanedTweet = str_replace('href="/', 'href="'.$this->uri, $tweet->find('p.js-tweet-text', 0)->innertext);
// Add picture to content
$picture_html = '';