Skip to content

Commit 5591597

Browse files
committed
force a fetch client
1 parent 29f53a1 commit 5591597

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/client-twitter/src/base.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import {
1818
} from "agent-twitter-client";
1919
import { EventEmitter } from "events";
2020
import { TwitterConfig } from "./environment.ts";
21-
import { ProxyAgent, setGlobalDispatcher } from "undici";
21+
import { fetch, ProxyAgent, setGlobalDispatcher } from "undici";
22+
// import fetch, { RequestInfo, RequestInit, Response } from "node-fetch";
23+
// import { HttpsProxyAgent } from "https-proxy-agent";
2224

2325
export function extractAnswer(text: string): string {
2426
const startIndex = text.indexOf("Answer: ") + 8;
@@ -126,6 +128,7 @@ function doLogin(username, cb, proxyUrl?: string) {
126128
}
127129

128130
const twitterClient = new Scraper({
131+
fetch: fetch,
129132
transform: {
130133
request: (input: any, init: any) => {
131134
if (agent) {

0 commit comments

Comments
 (0)