Skip to content

Commit 247fd30

Browse files
committed
chore: add more params
1 parent e06a213 commit 247fd30

File tree

5 files changed

+66
-61
lines changed

5 files changed

+66
-61
lines changed

.github/workflows/deploy.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Generate and Deploy
22

33
on:
4-
schedule:
5-
- cron: '0 0 * * *'
4+
push:
5+
on:
6+
- 'dao-space-2'
67
workflow_dispatch:
78

89
jobs:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mask-dsearch",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"repository": "https://github.com/DimensionDev/Mask-DSearch.git",
55
"license": "MIT",
66
"author": "guanbinrui <[email protected]>",

src/index.ts

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -19,63 +19,63 @@ const nonFungibleCollectionProviders = [nftScanCollectionAPI]
1919
async function main() {
2020
await initFolder()
2121

22-
for (const p of fungibleProviders) {
23-
let fungibleTokens: FungibleToken[] = []
24-
console.log(`Fetch the data from ${p.getProviderName()}`)
25-
try {
26-
const tokens = await p.getTopTokens()
27-
fungibleTokens = [...fungibleTokens, ...tokens]
28-
} catch (e) {
29-
console.log(`Fetching the chain failed by ${p.getProviderName()}`)
30-
console.log(e)
31-
}
32-
33-
console.log(`The current chain get ${fungibleTokens.length} tokens`)
34-
35-
if (fungibleTokens.length) {
36-
await writeTokensToFile(
37-
p.getProviderName(),
38-
'fungible-tokens',
39-
fungibleTokens.filter((x) => x.source === p.getProviderName()),
40-
)
41-
}
42-
}
43-
44-
for (const p of nonFungibleTokenProviders) {
45-
let nonFungibleTokens: NonFungibleToken[] = []
46-
console.log(`Fetch the data from ${p.getProviderName()}`)
47-
try {
48-
const tokens = await p.getTopTokens()
49-
nonFungibleTokens = [...nonFungibleTokens, ...tokens]
50-
} catch (e) {
51-
console.log(`Fetch the chain failed by ${p.getProviderName()}`)
52-
console.log(e)
53-
}
54-
55-
console.log(`The current chain get ${nonFungibleTokens.length} tokens`)
56-
57-
if (nonFungibleTokens.length) {
58-
await writeTokensToFile(p.getProviderName(), 'non-fungible-tokens', nonFungibleTokens)
59-
}
60-
}
61-
62-
for (const p of nonFungibleCollectionProviders) {
63-
let nonFungibleCollections: NonFungibleCollection[] = []
64-
console.log(`Fetch the data from ${p.getProviderName()}`)
65-
try {
66-
const collections = await p.getCollections()
67-
nonFungibleCollections = [...nonFungibleCollections, ...collections]
68-
} catch (e) {
69-
console.log(`Fetch the chain failed by ${p.getProviderName()}`)
70-
console.log(e)
71-
}
72-
73-
console.log(`The current chain get ${nonFungibleCollections.length} collections`)
74-
75-
if (nonFungibleCollections.length) {
76-
await writeCollectionsToFile(p.getProviderName(), nonFungibleCollections)
77-
}
78-
}
22+
// for (const p of fungibleProviders) {
23+
// let fungibleTokens: FungibleToken[] = []
24+
// console.log(`Fetch the data from ${p.getProviderName()}`)
25+
// try {
26+
// const tokens = await p.getTopTokens()
27+
// fungibleTokens = [...fungibleTokens, ...tokens]
28+
// } catch (e) {
29+
// console.log(`Fetching the chain failed by ${p.getProviderName()}`)
30+
// console.log(e)
31+
// }
32+
33+
// console.log(`The current chain get ${fungibleTokens.length} tokens`)
34+
35+
// if (fungibleTokens.length) {
36+
// await writeTokensToFile(
37+
// p.getProviderName(),
38+
// 'fungible-tokens',
39+
// fungibleTokens.filter((x) => x.source === p.getProviderName()),
40+
// )
41+
// }
42+
// }
43+
44+
// for (const p of nonFungibleTokenProviders) {
45+
// let nonFungibleTokens: NonFungibleToken[] = []
46+
// console.log(`Fetch the data from ${p.getProviderName()}`)
47+
// try {
48+
// const tokens = await p.getTopTokens()
49+
// nonFungibleTokens = [...nonFungibleTokens, ...tokens]
50+
// } catch (e) {
51+
// console.log(`Fetch the chain failed by ${p.getProviderName()}`)
52+
// console.log(e)
53+
// }
54+
55+
// console.log(`The current chain get ${nonFungibleTokens.length} tokens`)
56+
57+
// if (nonFungibleTokens.length) {
58+
// await writeTokensToFile(p.getProviderName(), 'non-fungible-tokens', nonFungibleTokens)
59+
// }
60+
// }
61+
62+
// for (const p of nonFungibleCollectionProviders) {
63+
// let nonFungibleCollections: NonFungibleCollection[] = []
64+
// console.log(`Fetch the data from ${p.getProviderName()}`)
65+
// try {
66+
// const collections = await p.getCollections()
67+
// nonFungibleCollections = [...nonFungibleCollections, ...collections]
68+
// } catch (e) {
69+
// console.log(`Fetch the chain failed by ${p.getProviderName()}`)
70+
// console.log(e)
71+
// }
72+
73+
// console.log(`The current chain get ${nonFungibleCollections.length} collections`)
74+
75+
// if (nonFungibleCollections.length) {
76+
// await writeCollectionsToFile(p.getProviderName(), nonFungibleCollections)
77+
// }
78+
// }
7979

8080
const spaces = await daoAPI.getSpaces()
8181
await writeDAOToFile(spaces)

src/providers/dao.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ export class DAO implements DaoProvider {
5050
return uniqBy(rawSpaces.filter(x => x.avatar && x.followersCount > 499 && x.validation.name !== 'any' && x.twitter).map(x => ({
5151
spaceId: x.id,
5252
spaceName: x.name,
53-
twitterHandler: x.twitter
53+
twitterHandler: x.twitter,
54+
avatar: x.avatar,
55+
followersCount: x.followersCount
5456
}) as Space), x => x.spaceId)
5557
}
5658
}

src/type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ export interface Space {
164164
spaceId: string
165165
spaceName: string
166166
twitterHandler: string
167+
followersCount: number
168+
avatar: string
167169
}
168170

169171
export interface FungibleTokenProvider {

0 commit comments

Comments
 (0)