forgot to commit this

This commit is contained in:
dangered wolf 2022-07-26 10:52:11 -04:00
parent 6cef702845
commit d68dc31f6f
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
4 changed files with 9 additions and 2 deletions

View file

@ -63,6 +63,7 @@ const populateTweetProperties = async (
apiTweet.likes = tweet.favorite_count;
apiTweet.color = apiTweet.author.avatar_color;
apiTweet.twitter_card = 'tweet';
apiTweet.created_at = tweet.created_at;
if (tweet.lang !== 'unk') {
apiTweet.lang = tweet.lang;

View file

@ -8,6 +8,7 @@ export const Constants = {
API_HOST: API_HOST,
HOST_URL: HOST_URL,
REDIRECT_URL: REDIRECT_URL,
API_DOCS_URL: `https://github.com/dangeredwolf/FixTweet/wiki/Status-API`,
TWITTER_ROOT: 'https://twitter.com',
TWITTER_API_ROOT: 'https://api.twitter.com',
/* We used to use Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA

View file

@ -133,7 +133,13 @@ router.get('/owoembed', async (request: Request) => {
router.get('/:handle', profileRequest);
router.get('/:handle/', profileRequest);
router.get('*', async (_request: Request) => {
router.get('*', async (request: Request) => {
const url = new URL(request.url);
if (url.hostname === Constants.API_HOST) {
return Response.redirect(Constants.API_DOCS_URL, 307);
}
return Response.redirect(Constants.REDIRECT_URL, 307);
});

1
src/types.d.ts vendored
View file

@ -86,7 +86,6 @@ interface APIVideo {
interface APITweet {
id: string;
url: string;
tweet: string;
text: string;
created_at: string;