diff --git a/README.md b/README.md
index 1505ba9..c043a3c 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# FixTweet
+# FixTweet / FixupX
-## Embed Twitter videos, polls, translations, & more on Discord and Telegram!
+## Embed X / Twitter videos, polls, translations, & more on Discord and Telegram!
![][icons]
@@ -20,11 +20,14 @@
[licensebadge]: https://img.shields.io/github/license/FixTweet/FixTweet
[uptimebadge]: https://img.shields.io/uptimerobot/ratio/m792476277-53add6f22c4e6f4d3a2d7e98
-## Inspired by [Robin Universe's TwitFix](https://github.com/robinuniverse/TwitFix), rewritten in TypeScript as a Cloudflare Worker to scale, packed with even more features and [best-in-class user privacy đ](#built-with-privacy-in-mind).
+## Written in TypeScript as a Cloudflare Worker to scale, packed with more features and [best-in-class user privacy đ](#built-with-privacy-in-mind).
-### Add `fx` before your Twitter link to make it `fxtwitter.com`
+### Add `fx` before your `twitter.com` link to make it `fxtwitter.com`, OR
+### Change `x.com` to `fixupx.com` in your link
-### In a hurry? On Discord, send a Twitter link and type `s/e/p` to make `twittpr.com`.
+### For Twitter links on Discord, send a Twitter link and type `s/e/p` to make `twittpr.com`.
+
+### âšī¸ Note: Some extra features described may currently broken due to recent Twitter/X API changes. [Tracking thread for the API changes](https://github.com/FixTweet/FixTweet/issues/333)
diff --git a/src/embed/status.ts b/src/embed/status.ts
index adbc480..b8c460d 100644
--- a/src/embed/status.ts
+++ b/src/embed/status.ts
@@ -282,12 +282,14 @@ export const handleStatus = async (
``
);
}
+
+ if (!flags?.isXDomain) {
+ siteName = Strings.X_DOMAIN_NOTICE;
+ }
/* Notice that user is using deprecated domain */
if (flags?.deprecated) {
siteName = Strings.DEPRECATED_DOMAIN_NOTICE;
- } else if (!flags?.isXDomainTemp) {
- siteName = Strings.X_DOMAIN_NOTICE;
}
/* Push basic headers relating to author, Tweet text, and site name */
@@ -317,7 +319,7 @@ export const handleStatus = async (
status
)}&author=${encodeURIComponent(
tweet.author?.screen_name || ''
- )}" type="application/json+oembed" title="${tweet.author.name}">`
+ )}&useXbranding=${flags?.isXDomain ? 'true' : 'false'}" type="application/json+oembed" title="${tweet.author.name}">`
);
/* When dealing with a Tweet of unknown lang, fall back to en */
diff --git a/src/server.ts b/src/server.ts
index 149c33b..8230585 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -68,8 +68,12 @@ const statusRequest = async (
flags.deprecated = true;
}
- if (/fixup/g.test(url.hostname)) {
- flags.isXDomainTemp = true;
+ /* TODO: Figure out what we're doing with FixTweet / FixupX branding in future */
+ if (/fixup/g.test(url.href)) {
+ console.log(`We're using x domain`);
+ flags.isXDomain = true;
+ } else {
+ console.log(`We're using twitter domain`);
}
/* Check if request is to api.fxtwitter.com, or the tweet is appended with .json
@@ -295,6 +299,7 @@ router.get('/owoembed', async (request: IRequest) => {
const text = searchParams.get('text') || 'Twitter';
const author = searchParams.get('author') || 'jack';
const status = searchParams.get('status') || '20';
+ const useXbranding = searchParams.get('useXbranding') === 'true';
const random = Math.floor(Math.random() * Object.keys(motd).length);
const [name, url] = Object.entries(motd)[random];
@@ -308,7 +313,7 @@ router.get('/owoembed', async (request: IRequest) => {
provider_name:
searchParams.get('deprecated') === 'true'
? Strings.DEPRECATED_DOMAIN_NOTICE_DISCORD
- : name,
+ : (useXbranding ? name : Strings.X_DOMAIN_NOTICE),
provider_url: url,
title: Strings.DEFAULT_AUTHOR_TEXT,
type: 'link',
diff --git a/src/strings.ts b/src/strings.ts
index 61470b2..0c5ee4e 100644
--- a/src/strings.ts
+++ b/src/strings.ts
@@ -210,5 +210,5 @@ Disallow: /owoembed/
Allow: /watch?v=dQw4w9WgXcQ
# 0100011101101111011011110110010000100000011000100110111101110100`,
- X_DOMAIN_NOTICE: 'FixTweet - đ Fix x.com links with fixupx.com!'
+ X_DOMAIN_NOTICE: 'FixTweet - đ x.com link? Try fixupx.com'
};
diff --git a/src/types/types.d.ts b/src/types/types.d.ts
index 4aea8bc..05a5857 100644
--- a/src/types/types.d.ts
+++ b/src/types/types.d.ts
@@ -7,7 +7,7 @@ type InputFlags = {
api?: boolean;
deprecated?: boolean;
textOnly?: boolean;
- isXDomainTemp?: boolean;
+ isXDomain?: boolean;
};
interface StatusResponse {