export type GetApiScrapecreatorsV1TwitterTweetArgs = {url: string, trim?: string | undefined}; export type GetApiScrapecreatorsV1TwitterTweetOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Tweet Details * * GET /scrapecreators/v1/twitter/tweet */ export const getApiScrapecreatorsV1TwitterTweet = async (args: GetApiScrapecreatorsV1TwitterTweetArgs, options?: GetApiScrapecreatorsV1TwitterTweetOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.url != null) query.append("url", String(args.url)) if (args.trim != null) query.append("trim", String(args.trim)) const url = `${baseUrl.replace(/\/+$/, '')}/scrapecreators/v1/twitter/tweet${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };