[TwitterV2Bridge] Changes to output HTML/CSS, larger display image by default (#2626)

This commit is contained in:
quickwick 2022-04-10 09:53:35 -07:00 committed by GitHub
parent aacf5812ff
commit db28bedb23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 12 deletions

View File

@ -347,7 +347,8 @@ EOD
continue;
}
$cleanedTweet = $tweet->text;
$cleanedTweet = nl2br($tweet->text);
//Debug::log('cleanedTweet: ' . $cleanedTweet);
// Perform filtering (skip tweets that don't contain desired word, if provided)
if (! empty($tweetFilter)) {
@ -386,7 +387,7 @@ EOD
}
}
}
if(isset($includesUsers)) {
if(!$originalUser && isset($includesUsers)) {
foreach($includesUsers as $includesUser) {
if($includesUser->id === $tweet->author_id) {
$originalUser = $includesUser;
@ -464,7 +465,7 @@ EOD
$picture_html = <<<EOD
<a href="https://twitter.com/{$item['username']}">
<img
style="align:top; width:75px; border:1px solid black;"
style="margin-right: 10px; margin-bottom: 10px;"
alt="{$item['username']}"
src="{$item['avatar']}"
title="{$item['fullname']}" />
@ -506,7 +507,7 @@ EOD;
$display_image = $media->url;
} else{
$image = $media->url . '?name=orig';
$display_image = $media->url . '?name=thumb';
$display_image = $media->url;
}
// add enclosures
$item['enclosures'][] = $image;
@ -514,7 +515,6 @@ EOD;
$media_html .= <<<EOD
<a href="{$image}">
<img
style="align:top; max-width:558px; border:1px solid black;"
referrerpolicy="no-referrer"
src="{$display_image}" />
</a>
@ -527,7 +527,6 @@ EOD;
$media_html .= <<<EOD
<img
style="align:top; max-width:558px; border:1px solid black;"
referrerpolicy="no-referrer"
src="{$display_image}" />
EOD;
@ -539,7 +538,6 @@ EOD;
$media_html .= <<<EOD
<img
style="align:top; max-width:558px; border:1px solid black;"
referrerpolicy="no-referrer"
src="{$display_image}" />
EOD;
@ -552,14 +550,14 @@ EOD;
}
$item['content'] = <<<EOD
<div style="display: inline-block; vertical-align: top;">
<div style="float: left;">
{$picture_html}
</div>
<div style="display: inline-block; vertical-align: top;">
<blockquote>{$cleanedTweet}</blockquote>
<div style="display: table;">
{$cleanedTweet}
</div>
<div style="display: block; vertical-align: top;">
<blockquote>{$media_html}</blockquote>
<div style="display: block; margin-top: 16px;">
{$media_html}
</div>
EOD;