Skip to content

Update BlueskyBridge.php#4367

Merged
dvikan merged 5 commits intoRSS-Bridge:masterfrom
mruac:bridge-bluesky
Jan 2, 2025
Merged

Update BlueskyBridge.php#4367
dvikan merged 5 commits intoRSS-Bridge:masterfrom
mruac:bridge-bluesky

Conversation

@mruac
Copy link
Contributor

@mruac 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
@github-actions
Copy link

github-actions bot commented Dec 15, 2024

Pull request artifacts

Bridge Context Status
Bluesky 1 untitled (current) ✔️
Bluesky 1 untitled (pr) ✔️

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']);
Copy link
Contributor

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?

Copy link
Contributor Author

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]);
Copy link
Contributor

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()

Copy link
Contributor Author

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.

@dvikan dvikan merged commit 2a44a00 into RSS-Bridge:master Jan 2, 2025
@dvikan
Copy link
Contributor

dvikan commented Jan 2, 2025

I merged despite my nit picks. Good work @mruac !

@mruac
Copy link
Contributor Author

mruac commented Jan 4, 2025

Thank you! Being nit picky to an extent is good to keep coding styles uniform and readable.
When I finish working on another bridge I'll look to expand this further to support User Lists, Feeds and Starter packs.

floviolleau pushed a commit to floviolleau/rss-bridge that referenced this pull request Aug 18, 2025
* Update BlueskyBridge.php

* 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

* appease the lint

* remove unused test code

* fix unset displayName

* appease the lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants