Get username instead of e.g. hashtag query

Created on 11 July 2021, over 3 years ago
Updated 17 October 2023, about 1 year ago

In cases where a hashtag or other query is used instead of a username query, the Tweet user is saved as the query, even though the username is present in the retrieved tweet. Patch attached saves the username instead.

Proposed resolution

Changed these two rows from GetTweetsBase.php file
- 'uri' => $tweet_type == 'statuses/user_timeline' ? 'https://twitter.com/' . $tweet->user->screen_name : 'https://twitter.com/search?q=' . str_replace('#', '%23', $query_name),
- 'title' => $tweet_type == 'statuses/user_timeline' ? $tweet->user->screen_name : $query_name,
+ 'uri' => isset($tweet->user, $tweet->user->screen_name) ? 'https://twitter.com/' . $tweet->user->screen_name : 'https://twitter.com/search?q=' . str_replace('#', '%23', $query_name),
+ 'title' => isset($tweet->user, $tweet->user->screen_name) ? $tweet->user->screen_name : $query_name,

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan YousefAnbar Zarqa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024