1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://github.com/explore"
14 },
15 {
16 "url": "https://github.com/trending?since=daily"
17 },
18 {
19 "url": "https://github.com/trending?since=weekly"
20 },
21 {
22 "url": "https://github.com/trending?since=monthly"
23 },
24 {
25 "url": "https://github.com/trending/python?since=weekly"
26 },
27 {
28 "url": "https://github.com/trending/javascript?since=weekly"
29 },
30 {
31 "url": "https://github.com/trending/typescript?since=weekly"
32 },
33 {
34 "url": "https://github.com/trending/rust?since=weekly"
35 },
36 {
37 "url": "https://github.com/trending/go?since=weekly"
38 },
39 {
40 "url": "https://github.com/trending/java?since=weekly"
41 }
42 ],
43 "maxItems": 500,
44 "proxyConfiguration": {
45 "useApifyProxy": true
46 }
47};
48
49
50const run = await client.actor("samer-samaha/github-scraper").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60