Skip to content

Commit

Permalink
Fix issue with @ bluesky usernames
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Nov 20, 2024
1 parent abdd61a commit 9aa0079
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/DataSource/BlueskyUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,15 @@ class BlueskyUser extends Rss {
static TYPE = "bluesky";
static TYPE_FRIENDLY = "Bluesky";

#username;

constructor(username) {
super(`https://bsky.app/profile/${username}/rss`);
this.username = username;
}

set username(username) {
static normalizeUsername(username) {
if(username.startsWith("@")) {
this.#username = username.slice(1);
} else {
this.#username = username;
return username.slice(1);
}
return username;
}

get username() {
return this.#username;
constructor(username) {
super(`https://bsky.app/profile/${BlueskyUser.normalizeUsername(username)}/rss`);
}

static getFilePath(url) {
Expand Down

0 comments on commit 9aa0079

Please sign in to comment.