Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
superwunc committed Jul 2, 2024
1 parent 775d069 commit 2860a28
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
17 changes: 9 additions & 8 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,19 @@ function getFiles(dir: string, files: string[] = []) {
}

async function fetchBscScanTag(address: string) {

Check failure on line 68 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Missing return type on function

Check failure on line 68 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Missing return type on function
const parseTags = []
try {
const reponse = await fetch(`https://bscscan.com/address/${address}`)
if (reponse.ok) {
const text = await reponse.text()
const $ = cheerio.load(text)
const tags = $('#ContentPlaceHolder1_divLabels .hash-tag').text()
console.log('tags', tags)
return tags
const tags = $('#ContentPlaceHolder1_divLabels .hash-tag')
for (let i = 0, l = tags.length; i < l; i++) {
parseTags.push($(tags[i]).text())
}
}
} catch (error) {
return []
}
} catch (error) {}

Check failure on line 80 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Empty block statement

Check failure on line 80 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Empty block statement
return parseTags
}
/**
* The main function for the action.
Expand Down Expand Up @@ -119,10 +120,10 @@ export async function run(): Promise<void> {
if (data.status === '1') {
data.result.forEach(async (item: any) => {

Check failure on line 121 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Prefer for...of instead of Array.forEach

Check failure on line 121 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Unexpected any. Specify a different type

Check failure on line 121 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Prefer for...of instead of Array.forEach

Check failure on line 121 in src/main.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Unexpected any. Specify a different type
if (!DeployList.includes(item.contractCreator.toLowerCase())) {
const tags = await fetchBscScanTag(item.contractAddress)
console.log(
`BSC\thttps://bscscan.com/address/${item.contractAddress}\t${item.contractCreator}`
`BSC\thttps://bscscan.com/address/${item.contractAddress}\t${item.contractCreator}\t${tags.join('\t')}`
)
await fetchBscScanTag(item.contractAddress)
}
})
}
Expand Down

0 comments on commit 2860a28

Please sign in to comment.