Skip to content

Commit c324822

Browse files
author
Encore
committed
FEAT: update README
1 parent 6ddc226 commit c324822

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ This project is a GitHub scraper that uses Puppeteer to extract information abou
2121
1. Set the `ORG_NAME` environment variable to the GitHub organization you want to scrape:
2222

2323
```bash
24-
export ORG_NAME=your-organization-name
25-
```
26-
27-
2. Run the scraper:
28-
```bash
29-
npm start
24+
env ORG_NAME=ranbot-ai npx ts-node scraper.ts
3025
```
3126

3227
## Features

scraper.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ async function scrapeGitHubOrg(orgName: string) {
3131
orgInfo.repositories = await scrapeAllRepos(orgName, page);
3232
orgInfo.totalRepositoriesCount = orgInfo.repositories.length;
3333

34-
console.log("Organization Info with Repos:", orgInfo);
34+
console.log("// Organization Info with Repos:", orgInfo);
3535
} catch (error) {
36-
console.error("Error scraping GitHub:", error);
36+
console.error("// Error scraping GitHub:", error);
3737
} finally {
3838
await browser.close();
3939
}
@@ -45,9 +45,6 @@ async function getOrgInfo(orgName: string, page: Page): Promise<OrgInfo> {
4545
});
4646

4747
return await page.evaluate(() => {
48-
const cleanText = (el?: Element | null) =>
49-
el?.textContent?.replace(/\s+/g, " ").trim();
50-
5148
const name =
5249
document
5350
.querySelector("div.application-main main header h1")
@@ -125,7 +122,7 @@ async function scrapeAllRepos(
125122
}
126123
);
127124

128-
console.log(`Scraping page ${pageNumber}...`);
125+
console.log(`// Scraping page ${pageNumber}...`);
129126

130127
const pageRepos = await page.evaluate((): RepoData[] => {
131128
const cleanText = (el?: Element | null) =>
@@ -167,7 +164,7 @@ async function scrapeAllRepos(
167164
}
168165
}
169166

170-
console.log(`Total repositories scraped: ${allRepos.length}`);
167+
console.log(`// Total repositories scraped: ${allRepos.length}`);
171168
return allRepos;
172169
}
173170

@@ -176,5 +173,5 @@ const orgName = process.env.ORG_NAME;
176173
if (orgName) {
177174
scrapeGitHubOrg(orgName);
178175
} else {
179-
console.error("ORG_NAME environment variable is not defined.");
176+
console.error("// ORG_NAME environment variable is not defined.");
180177
}

0 commit comments

Comments
 (0)