Skip to content

Commit

Permalink
Sponsorship auto-generate v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jan 30, 2024
1 parent b2231a5 commit 635d285
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions update_sponsors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,33 @@ def fetch_sponsors():
# GraphQL query to fetch sponsors
graphql_query = """
{
viewer {
login
sponsorshipsAsMaintainer(first: 100, orderBy: {field: CREATED_AT, direction: ASC}, includePrivate: true) {
totalCount
pageInfo {
endCursor
}
nodes {
sponsorEntity {
... on User {
name
login
url
}
... on Organization {
name
url
login
}
user(login: "jokob-sk") {
sponsorshipsAsMaintainer(first: 100, orderBy: {field: CREATED_AT, direction: ASC}, includePrivate: true) {
totalCount
pageInfo {
endCursor
}
nodes {
sponsorEntity {
... on User {
name
login
url
}
... on Organization {
name
url
login
}
}
createdAt
privacyLevel
tier {
monthlyPriceInCents
}
}
createdAt
privacyLevel
tier {
monthlyPriceInCents
}
}
}
}
}
"""

Expand All @@ -56,7 +55,7 @@ def fetch_sponsors():
print(f"GraphQL query failed: {data['errors']}")
return {"sponsors": []}

sponsorships = data["data"]["viewer"]["sponsorshipsAsMaintainer"]["nodes"]
sponsorships = data["data"]["user"]["sponsorshipsAsMaintainer"]["nodes"]
sponsors = []

for sponsorship in sponsorships:
Expand Down

0 comments on commit 635d285

Please sign in to comment.