kawamataryo / sky-follower-bridge

Instantly find and follow the same users from your X(Twitter) follower on Bluesky.
https://chrome.google.com/webstore/detail/sky-follower-bridge/behhbpbpmailcnfbjagknjngnfdojpko
MIT License
445 stars 13 forks source link

re: "handle name in description", drop matches preceeded by "pfp" #31

Closed lowercase-donkey closed 11 months ago

lowercase-donkey commented 11 months ago

"handle name in description" seems to give a lot of false positives for me, and a common reason is this:

image

Note here that camalange is just trying to give credit for their pic to coughdrops.

This PR attempts to filter out these false positives using a negative lookbehind and regex. (Please test it out in the project, I was only able to test the JS in console!) The regex means that when it hits a possible match, it will check to make sure it doesn't have "pfp " in front of it before matching. Hopefully.

There's a chance you will miss a few account matches due to this, but I hope you find it worth it for the false positives it filters out.

Summary by CodeRabbit

coderabbitai[bot] commented 11 months ago

Walkthrough

The isSimilarUser function within the bskyHelpers.ts file has been updated to refine its user matching logic. The function now uses a regular expression with a negative lookbehind assertion to prevent false matches when the string "pfp " precedes the account name. This change ensures that descriptions containing "pfp " are not incorrectly identified as similar users.

Changes

File Change Summary
.../bskyHelpers.ts Updated isSimilarUser function to use regex with negative lookbehind to improve matching criteria in bskyProfile.description.

🐇 In the code's burrow, beneath the autumn's glow,
Changes hop in, regex flows,
No "pfp " in sight, the match is just right,
As the digital meadow continues to grow. 🍂🌟


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`
lowercase-donkey commented 11 months ago

This code rabbit thing is wild!

kawamataryo commented 11 months ago

The content of this PR has been corrected in #32 and is closed