-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update BlueskyBridge.php #4367
Update BlueskyBridge.php #4367
Conversation
mruac
commented
Dec 15, 2024
- Used human readable terms
- Include quote and reply post
- Added video support
- Replaced Youtube embed with thumbnail preview
- Added link embed preview
- Included visible alt text to images
* Used human readable terms * Include quote and reply post * Added video support * Replaced Youtube embed with thumbnail preview * Added link embed preview * Included visible alt text to images
Pull request artifacts
last change: Friday 2024-12-20 11:11:32 |
$facets = $record['facets']; | ||
foreach ($facets as $facet) { | ||
if ($facet['features'][0]['$type'] === 'app.bsky.richtext.facet#link') { | ||
$substring = substr($text_copy, $facet['index']['byteStart'], $facet['index']['byteEnd'] - $facet['index']['byteStart']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful... does it break for unicode text?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Testing with urls that have emojis and international characters in them are either converted to punycode or percent coded when published. When using rich text via third party clients, PHP was able to get the right string from the byte indexes alone.
$description .= $this->parseExternal($post['post']['record']['embed']['external'], $authorDid); | ||
if (Debug::isEnabled()) { | ||
$url = explode('/', $post['post']['uri']); | ||
error_log('https://bsky.app/profile/' . $url[2] . '/post/' . $url[4]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please dont use error_log
directly. Use $this->logger->warning()
or $this->logger->error()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted, this should probably be mentioned in the documentation.
I merged despite my nit picks. Good work @mruac ! |
Thank you! Being nit picky to an extent is good to keep coding styles uniform and readable. |