mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-14 17:04:02 +01:00
Small tweaks
This commit is contained in:
parent
57c0c78996
commit
d37b1b3a38
2 changed files with 3 additions and 5 deletions
|
@ -15,8 +15,7 @@ function generateCSRFToken() {
|
||||||
export const twitterFetch = async (
|
export const twitterFetch = async (
|
||||||
url: string,
|
url: string,
|
||||||
event: FetchEvent,
|
event: FetchEvent,
|
||||||
useElongator = typeof TwitterProxy !== 'undefined' &&
|
useElongator = experimentCheck(Experiment.ELONGATOR_BY_DEFAULT, typeof TwitterProxy !== 'undefined'),
|
||||||
experimentCheck(Experiment.ELONGATOR_BY_DEFAULT),
|
|
||||||
validateFunction: (response: unknown) => boolean
|
validateFunction: (response: unknown) => boolean
|
||||||
): Promise<unknown> => {
|
): Promise<unknown> => {
|
||||||
let apiAttempts = 0;
|
let apiAttempts = 0;
|
||||||
|
@ -221,8 +220,7 @@ export const twitterFetch = async (
|
||||||
export const fetchConversation = async (
|
export const fetchConversation = async (
|
||||||
status: string,
|
status: string,
|
||||||
event: FetchEvent,
|
event: FetchEvent,
|
||||||
useElongator = typeof TwitterProxy !== 'undefined' &&
|
useElongator = experimentCheck(Experiment.ELONGATOR_BY_DEFAULT, typeof TwitterProxy !== 'undefined')
|
||||||
experimentCheck(Experiment.ELONGATOR_BY_DEFAULT)
|
|
||||||
): Promise<TweetResultsByRestIdResult> => {
|
): Promise<TweetResultsByRestIdResult> => {
|
||||||
return (await twitterFetch(
|
return (await twitterFetch(
|
||||||
`${
|
`${
|
||||||
|
|
|
@ -55,7 +55,7 @@ const htmlifyHashtags = (input: string): string => {
|
||||||
const hashtagPattern = /#([a-zA-Z_]\w*)/g;
|
const hashtagPattern = /#([a-zA-Z_]\w*)/g;
|
||||||
return input.replace(hashtagPattern, (match, hashtag) => {
|
return input.replace(hashtagPattern, (match, hashtag) => {
|
||||||
const encodedHashtag = encodeURIComponent(hashtag);
|
const encodedHashtag = encodeURIComponent(hashtag);
|
||||||
return `<a href="https://twitter.com/hashtag/${encodedHashtag}?src=hashtag_click">${match}</a>`;
|
return `<a href="${Constants.TWITTER_ROOT}/hashtag/${encodedHashtag}?src=hashtag_click">${match}</a>`;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue