diff --git a/README.md b/README.md index b70b9177c..554308954 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ For an introduction of what the project aims to achieve, [please check out the w ## Sponsors -Fornjot is supported by [**@webtrax-oz**](https://github.com/webtrax-oz), [**@reivilibre**](https://github.com/reivilibre), [**@lthiery**](https://github.com/lthiery), [**@ahdinosaur**](https://github.com/ahdinosaur), [**@martindederer**](https://github.com/martindederer), [**@bollian**](https://github.com/bollian), [**@rozgo**](https://github.com/rozgo), [**@nullstyle**](https://github.com/nullstyle), [**@tachiniererin**](https://github.com/tachiniererin), [**@sucaba**](https://github.com/sucaba), [**@Kethku**](https://github.com/Kethku), [**@jessebraham**](https://github.com/jessebraham), [**@seanjensengrey**](https://github.com/seanjensengrey), [**@MattOslin**](https://github.com/MattOslin), [**@benwis**](https://github.com/benwis), [**@happysalada**](https://github.com/happysalada), [**@jminer**](https://github.com/jminer), [**@jeevcat**](https://github.com/jeevcat), [**@voxpelli**](https://github.com/voxpelli), [**@U007D**](https://github.com/U007D), [**@guillaumechauvat**](https://github.com/guillaumechauvat), [**@MitchellHansen**](https://github.com/MitchellHansen), [**@mayfieldiv**](https://github.com/mayfieldiv), [**@ksindi**](https://github.com/ksindi), and [my other awesome sponsors](https://github.com/sponsors/hannobraun). Thank you! +Fornjot is supported by [**@MitchellHansen**](https://github.com/MitchellHansen), [**@webtrax-oz**](https://github.com/webtrax-oz), [**@reivilibre**](https://github.com/reivilibre), [**@lthiery**](https://github.com/lthiery), [**@ahdinosaur**](https://github.com/ahdinosaur), [**@martindederer**](https://github.com/martindederer), [**@bollian**](https://github.com/bollian), [**@nullstyle**](https://github.com/nullstyle), [**@tachiniererin**](https://github.com/tachiniererin), [**@HalfVoxel**](https://github.com/HalfVoxel), [**@sucaba**](https://github.com/sucaba), [**@Kethku**](https://github.com/Kethku), [**@jessebraham**](https://github.com/jessebraham), [**@seanjensengrey**](https://github.com/seanjensengrey), [**@MattOslin**](https://github.com/MattOslin), [**@benwis**](https://github.com/benwis), [**@happysalada**](https://github.com/happysalada), [**@jminer**](https://github.com/jminer), [**@jeevcat**](https://github.com/jeevcat), [**@voxpelli**](https://github.com/voxpelli), [**@U007D**](https://github.com/U007D), [**@guillaumechauvat**](https://github.com/guillaumechauvat), [**@mayfieldiv**](https://github.com/mayfieldiv), and [my other awesome sponsors](https://github.com/sponsors/hannobraun). Thank you! **Please consider [supporting me too](https://github.com/sponsors/hannobraun), to help make Fornjot sustainable long-term.** diff --git a/tools/automator/src/sponsors.rs b/tools/automator/src/sponsors.rs index 1f8ef0e87..138e68832 100644 --- a/tools/automator/src/sponsors.rs +++ b/tools/automator/src/sponsors.rs @@ -1,5 +1,6 @@ -use std::{cmp::Ordering, fmt::Write}; +use std::{cmp::Ordering, collections::HashMap, fmt::Write}; +use anyhow::Context; use chrono::{DateTime, Utc}; use octocrab::Octocrab; @@ -10,39 +11,44 @@ pub struct Sponsors { impl Sponsors { pub async fn query(octocrab: &Octocrab) -> anyhow::Result { - let response: QueryResult = octocrab - .graphql( - "query { - viewer { - sponsors(first: 100) { - nodes { - __typename - ... on User { - login - sponsorshipForViewerAsSponsorable { - createdAt - tier { - monthlyPriceInDollars - } - isOneTimePayment + let graphql_query = "\ + query { + viewer { + sponsors(first: 100) { + nodes { + __typename + ... on User { + login + sponsorshipForViewerAsSponsorable { + createdAt + tier { + monthlyPriceInDollars } + isOneTimePayment } - ... on Organization { - login - sponsorshipForViewerAsSponsorable { - createdAt - tier { - monthlyPriceInDollars - } - isOneTimePayment + } + ... on Organization { + login + sponsorshipForViewerAsSponsorable { + createdAt + tier { + monthlyPriceInDollars } + isOneTimePayment } } } } - }", - ) - .await?; + } + }"; + + let mut json_object = HashMap::new(); + json_object.insert("query", graphql_query); + + let response: QueryResult = octocrab + .graphql(&json_object) + .await + .context("GraphQL query failed")?; let mut sponsors = response .data