Skip to content

Commit

Permalink
Add Instagram and Threads support to social IDs map
Browse files Browse the repository at this point in the history
  • Loading branch information
molly committed Dec 4, 2023
1 parent 6876ad7 commit c220d8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion functions/src/social.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ import { firestore } from "./config/firebase";
import * as functions from "firebase-functions";
import { SocialNetwork, SocialPostGroup } from "./types";

const NETWORKS: SocialNetwork[] = ["twitter", "mastodon", "bluesky"];
const NETWORKS: SocialNetwork[] = [
"twitter",
"mastodon",
"bluesky",
"instagram",
"threads",
];
const ID_FORMATS = {
twitter: /\d+/,
mastodon: /\d+/,
bluesky: /[a-z0-9]+/,
instagram: /[a-z0-9]+/,
threads: /[a-z0-9]+/,
};

export const addSocialPostIds = functions.https.onRequest(async (req, res) => {
Expand Down
7 changes: 6 additions & 1 deletion functions/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ export type ScamAmountDetails = {
textOverride?: string; // Text override (used in leaderboard)
};

export type SocialNetwork = "twitter" | "mastodon" | "bluesky";
export type SocialNetwork =
| "twitter"
| "mastodon"
| "bluesky"
| "instagram"
| "threads";

export type SocialPostGroup = {
[network in SocialNetwork]?: string;
Expand Down

0 comments on commit c220d8f

Please sign in to comment.