|
@@ -324,7 +324,7 @@ class TwitterService implements SmmPlatformInterface
|
|
*/
|
|
*/
|
|
public function uploadAndPost($filePaths, $tweetText) {
|
|
public function uploadAndPost($filePaths, $tweetText) {
|
|
try {
|
|
try {
|
|
- $tweetText = $this->truncateText($tweetText, 270);// 截断推文
|
|
|
|
|
|
+ $tweetText = $this->truncateText($tweetText);// 截断推文
|
|
|
|
|
|
$media_ids = [];
|
|
$media_ids = [];
|
|
foreach ($filePaths as $filePath) {
|
|
foreach ($filePaths as $filePath) {
|
|
@@ -462,7 +462,7 @@ class TwitterService implements SmmPlatformInterface
|
|
* @param string $ellipsis 截断后缀(默认...)
|
|
* @param string $ellipsis 截断后缀(默认...)
|
|
* @return string 处理后的文本
|
|
* @return string 处理后的文本
|
|
*/
|
|
*/
|
|
- function truncateText(string $text, int $maxWidth = 270, string $ellipsis = ''): string {
|
|
|
|
|
|
+ function truncateText(string $text, int $maxWidth = 250, string $ellipsis = ''): string {
|
|
if ($maxWidth <= 0) return '';
|
|
if ($maxWidth <= 0) return '';
|
|
|
|
|
|
// 计算后缀的显示宽度
|
|
// 计算后缀的显示宽度
|