import { searchTweets } from "https://esm.town/v/andreterron/searchTweets";
export async function searchPostsForTheActuallyBot(accessToken: string): Promise<{
id: string;
text: string;
author_id: string;
}[]> {
const results = await searchTweets({
accessToken,
query:
'"twitter" (elon OR musk) -"X" -"๐" -follow -twerk -selfie -nft -crypto -is:retweet -is:reply -is:quote lang:en -has:links',
params: {
"tweet.fields": "created_at,public_metrics,author_id",
},
});
return (results ?? [])
.filter((post) => {
const words = post.text.split(/\s+/);
return !(words.includes("x") || words.includes("X") ||
words.includes("๐"));
});
}