From 1b4ed77eac0618426a4e4372d96f0f61c9a557f8 Mon Sep 17 00:00:00 2001 From: triatic <42704418+triatic@users.noreply.github.com> Date: Tue, 22 Jan 2019 17:09:15 +0000 Subject: [PATCH 1/5] Append username of retweeter to author. Append username of retweeter to author. Useful when viewing all unread tweets in an RSS reader which are not sorted within username folders. --- bridges/TwitterBridge.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 32ed94285b2..f87ef14f389 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -189,6 +189,8 @@ public function collectData(){ $item['fullname'] = htmlspecialchars_decode($tweet->getAttribute('data-name'), ENT_QUOTES); // get author $item['author'] = $item['fullname'] . ' (@' . $item['username'] . ')'; + if ($tweet->getAttribute('data-screen-name') !== $this->getInput('u')) + $item['author'] .= ' RT: @' . $this->getInput('u'); // get avatar link $item['avatar'] = $tweet->find('img', 0)->src; // get TweetID From 3ed1a75ce0974dad54b342e84d1390c594c3d23f Mon Sep 17 00:00:00 2001 From: triatic <42704418+triatic@users.noreply.github.com> Date: Tue, 22 Jan 2019 17:32:02 +0000 Subject: [PATCH 2/5] Decode username --- bridges/TwitterBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index f87ef14f389..0d63ebf3bc1 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -190,7 +190,7 @@ public function collectData(){ // get author $item['author'] = $item['fullname'] . ' (@' . $item['username'] . ')'; if ($tweet->getAttribute('data-screen-name') !== $this->getInput('u')) - $item['author'] .= ' RT: @' . $this->getInput('u'); + $item['author'] .= ' RT: @' . htmlspecialchars_decode($this->getInput('u'), ENT_QUOTES); // get avatar link $item['avatar'] = $tweet->find('img', 0)->src; // get TweetID From aebfbf3c6cf11f67ad9464e73e211358627947ca Mon Sep 17 00:00:00 2001 From: triatic <42704418+triatic@users.noreply.github.com> Date: Tue, 22 Jan 2019 17:44:00 +0000 Subject: [PATCH 3/5] On second thoughts, don't decode username --- bridges/TwitterBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 0d63ebf3bc1..f87ef14f389 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -190,7 +190,7 @@ public function collectData(){ // get author $item['author'] = $item['fullname'] . ' (@' . $item['username'] . ')'; if ($tweet->getAttribute('data-screen-name') !== $this->getInput('u')) - $item['author'] .= ' RT: @' . htmlspecialchars_decode($this->getInput('u'), ENT_QUOTES); + $item['author'] .= ' RT: @' . $this->getInput('u'); // get avatar link $item['avatar'] = $tweet->find('img', 0)->src; // get TweetID From 961343428d16460f0a2525c52e28d74ebab8ff55 Mon Sep 17 00:00:00 2001 From: triatic <42704418+triatic@users.noreply.github.com> Date: Wed, 30 Jan 2019 18:31:50 +0000 Subject: [PATCH 4/5] Reformat if statement --- bridges/TwitterBridge.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index f87ef14f389..1e6e4443bad 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -189,8 +189,9 @@ public function collectData(){ $item['fullname'] = htmlspecialchars_decode($tweet->getAttribute('data-name'), ENT_QUOTES); // get author $item['author'] = $item['fullname'] . ' (@' . $item['username'] . ')'; - if ($tweet->getAttribute('data-screen-name') !== $this->getInput('u')) + if($tweet->getAttribute('data-screen-name') !== $this->getInput('u')) { $item['author'] .= ' RT: @' . $this->getInput('u'); + } // get avatar link $item['avatar'] = $tweet->find('img', 0)->src; // get TweetID From 39a0cd3af8d31d0c742b40e7ff46bdda432ec0c7 Mon Sep 17 00:00:00 2001 From: triatic <42704418+triatic@users.noreply.github.com> Date: Sun, 3 Feb 2019 22:30:49 +0000 Subject: [PATCH 5/5] Case insensitive match for retweets --- bridges/TwitterBridge.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bridges/TwitterBridge.php b/bridges/TwitterBridge.php index 1e6e4443bad..b3b7bed40a1 100644 --- a/bridges/TwitterBridge.php +++ b/bridges/TwitterBridge.php @@ -165,7 +165,7 @@ public function collectData(){ // Skip retweets? if($this->getInput('noretweet') - && $tweet->getAttribute('data-screen-name') !== $this->getInput('u')) { + && strcasecmp($tweet->getAttribute('data-screen-name'), $this->getInput('u'))) { continue; } @@ -189,7 +189,7 @@ public function collectData(){ $item['fullname'] = htmlspecialchars_decode($tweet->getAttribute('data-name'), ENT_QUOTES); // get author $item['author'] = $item['fullname'] . ' (@' . $item['username'] . ')'; - if($tweet->getAttribute('data-screen-name') !== $this->getInput('u')) { + if(strcasecmp($tweet->getAttribute('data-screen-name'), $this->getInput('u'))) { $item['author'] .= ' RT: @' . $this->getInput('u'); } // get avatar link