mirror of
https://github.com/snachodog/tok-to-insta-follower-bridge.git
synced 2025-04-10 14:11:22 -06:00
refactor: rename
This commit is contained in:
parent
bc1dcc32d3
commit
e07fbf91c3
@ -1,4 +1,4 @@
|
||||
import type { CrawledUser } from "~types";
|
||||
import type { CrawledUserInfo } from "~types";
|
||||
import { BSKY_DOMAIN } from "./constants";
|
||||
|
||||
export const getUserCells = ({
|
||||
@ -22,7 +22,7 @@ export const getUserCells = ({
|
||||
return Array.from(userCells);
|
||||
};
|
||||
|
||||
export const extractUserData = (userCell: Element): CrawledUser => {
|
||||
export const extractUserData = (userCell: Element): CrawledUserInfo => {
|
||||
const anchors = Array.from(userCell.querySelectorAll("a"));
|
||||
const [avatarEl, displayNameEl] = anchors;
|
||||
const accountName = avatarEl?.getAttribute("href")?.replace("/", "");
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
import { extractUserData, getUserCells } from "~lib/domHelpers";
|
||||
import { searchBskyUser } from "~lib/searchBskyUsers";
|
||||
import { wait } from "~lib/utils";
|
||||
import type { CrawledUser, MatchType } from "~types";
|
||||
import type { CrawledUserInfo, MatchType } from "~types";
|
||||
|
||||
export type BskyUser = {
|
||||
did: string;
|
||||
@ -65,7 +65,7 @@ export const useRetrieveBskyUsers = () => {
|
||||
};
|
||||
|
||||
const retrieveBskyUsers = React.useCallback(
|
||||
async (usersData: CrawledUser[]) => {
|
||||
async (usersData: CrawledUserInfo[]) => {
|
||||
for (const userData of usersData) {
|
||||
const searchResult = await searchBskyUser({
|
||||
client: bskyClient.current,
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { ProfileView } from "@atproto/api/dist/client/types/app/bsky/actor/defs";
|
||||
import { isSimilarUser } from "~lib/bskyHelpers";
|
||||
import { isOneSymbol } from "~lib/utils";
|
||||
import type { CrawledUser } from "~types";
|
||||
import type { CrawledUserInfo } from "~types";
|
||||
import type { BskyServiceWorkerClient } from "./bskyServiceWorkerClient";
|
||||
import { BSKY_PROFILE_LABEL } from "./constants";
|
||||
|
||||
@ -16,7 +16,7 @@ export const searchBskyUser = async ({
|
||||
userData,
|
||||
}: {
|
||||
client: BskyServiceWorkerClient;
|
||||
userData: CrawledUser;
|
||||
userData: CrawledUserInfo;
|
||||
}) => {
|
||||
const searchTerms = [
|
||||
...(userData.bskyHandle ? [userData.bskyHandle] : []),
|
||||
|
@ -23,7 +23,7 @@ export type MatchTypeFilterValue = {
|
||||
[BSKY_USER_MATCH_TYPE.FOLLOWING]: boolean;
|
||||
};
|
||||
|
||||
export type CrawledUser = {
|
||||
export type CrawledUserInfo = {
|
||||
accountName: string;
|
||||
displayName: string;
|
||||
accountNameRemoveUnderscore: string;
|
||||
|
Loading…
x
Reference in New Issue
Block a user