Skip to content

Commit 0b51a4e

Browse files
committed
chore: support .env in ctls example and tweak types
1 parent 2785a41 commit 0b51a4e

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

examples/cycletls/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { Scraper } from '@the-convocation/twitter-scraper';
4141
import { cycleTLSFetch, cycleTLSExit } from '@the-convocation/twitter-scraper/cycletls';
4242

4343
const scraper = new Scraper({
44-
fetch: cycleTLSFetch as any,
44+
fetch: cycleTLSFetch,
4545
});
4646
```
4747

examples/cycletls/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dependencies": {
88
"@the-convocation/twitter-scraper": "file:../../",
99
"cycletls": "^2.0.4",
10+
"dotenv": "^16.3.1",
1011
"tsx": "^4.15.5"
1112
}
1213
}

examples/cycletls/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import {
44
cycleTLSFetch,
55
cycleTLSExit,
66
} from '@the-convocation/twitter-scraper/cycletls';
7+
import dotenv from 'dotenv';
8+
9+
dotenv.config({ path: '.env.local' });
710

811
/**
912
* Example: Using CycleTLS to bypass Cloudflare bot detection
@@ -27,7 +30,7 @@ assert(username && password && email, 'Missing required environment variables');
2730

2831
// Create scraper with CycleTLS fetch
2932
const scraper = new Scraper({
30-
fetch: cycleTLSFetch as any,
33+
fetch: cycleTLSFetch,
3134
});
3235

3336
const main = async () => {

examples/cycletls/yarn.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
integrity sha512-Ul3YyOTU++to8cgNkttakC0dWvpERr6RYoHO2W47DLbFvrwBDJUY31B1sImH6JZSYc4Kt4PyHtoPNu+vL2r2dA==
144144

145145
"@the-convocation/twitter-scraper@file:../..":
146-
version "0.18.3"
146+
version "0.19.0"
147147
dependencies:
148148
"@sinclair/typebox" "^0.32.20"
149149
cross-fetch "^4.0.0-alpha.5"
@@ -247,6 +247,11 @@ delayed-stream@~1.0.0:
247247
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
248248
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
249249

250+
dotenv@^16.3.1:
251+
version "16.6.1"
252+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.6.1.tgz#773f0e69527a8315c7285d5ee73c4459d20a8020"
253+
integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==
254+
250255
dunder-proto@^1.0.1:
251256
version "1.0.1"
252257
resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a"

0 commit comments

Comments
 (0)