Skip to content

Commit

Permalink
Sort sponsors by tier
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Jun 3, 2024
1 parent 6c9a4bb commit b9cc24a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
18 changes: 10 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,20 +129,21 @@ This project exists thanks to all the people who contribute.

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

<a href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme" target="_blank"><img src="https://carbon.nesbot.com/tidelift-brand.png" width="256" height="64"></a><!-- <open-collective-sponsors> -->
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="64" height="64"></a>
<a title="#1 Guide To Online Gambling In Canada" href="https://casinohex.org/canada/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="CasinoHex Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/79fdbcc0-a997-11eb-abbc-25e48b63c6dc.jpg" width="85" height="64"></a>
<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="89" height="64"></a>
<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="64" height="64"></a>
<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
<a title="Gives a fun for our users" href="https://slotoking.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Ігрові автомати" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
<!-- <open-collective-sponsors> -->
<a title="Онлайн казино 777 Україна" href="https://777.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/7e572d50-1ce8-4d69-ae12-86cc80371373/ok-ua-777.png" width="96" height="96"></a>
<a title="#1 Guide To Online Gambling In Canada" href="https://casinohex.org/canada/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="CasinoHex Canada" src="https://opencollective-production.s3.us-west-1.amazonaws.com/79fdbcc0-a997-11eb-abbc-25e48b63c6dc.jpg" width="127.5" height="96"></a>
<a title="Znajdź najlepsze zakłady bukmacherskie w Polsce w 2023 roku. Probukmacher.pl to Twoje kompendium wiedzy na temat bukmacherów!" href="https://www.probukmacher.pl?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Probukmacher" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/caf50271-4560-4ffe-a434-ea15239168db/Screenshot_1.png" width="133.5" height="96"></a>
<a title="Casino-portugal.pt" href="https://casino-portugal.pt/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Casino-portugal.pt" src="https://logo.clearbit.com/casino-portugal.pt" width="96" height="96"></a>
<a title="inkedin" href="https://inkedin.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="inkedin" src="https://logo.clearbit.com/inkedin.com" width="64" height="64"></a>
<a title="OnlineCasinosSpelen" href="https://onlinecasinosspelen.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="OnlineCasinosSpelen" src="https://logo.clearbit.com/onlinecasinosspelen.com" width="64" height="64"></a>
<a title="Актуальний топ-рейтинг українських онлайн казино на гривні! Щоденне оновлення топу та унікальна система ранжування, основана на відгуках гравців!" href="https://onlinecasino.in.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн Казино Украины" src="https://opencollective-production.s3.us-west-1.amazonaws.com/8fdd8aa0-e273-11ec-a95e-d38fd331cabf.png" width="64" height="64"></a>
<a title="Parimatch" href="https://parimattchbr.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Parimatch" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/d3d74dd5-49a3-4306-b99e-7445b78a4243/parimatch_-_hero_-_white.png" width="114" height="64"></a>
<a title="Актуальний та повносправний рейтинг онлайн казино України, ґрунтований на відгуках реальних гравців." href="https://uk.onlinecasino.in.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Онлайн казино України" src="https://opencollective-production.s3.us-west-1.amazonaws.com/c0b4b090-eef8-11ec-9cb7-0527a205b226.png" width="64" height="64"></a>
<a title="Gives a fun for our users" href="https://slotoking.ua/games/all-slots/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Ігрові автомати" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/94601d07-3205-4c60-9c2d-9b8194dbefb7/skg-blue.png" width="64" height="64"></a>
<a title="Slots City® ➢ Лучшее лицензионно казино онлайн и оффлайн на гривны в Украине. 【 Более1500 игровых автоматов и слотов】✅ Официально и Безопасно" href="https://slotscity.ua/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Slots City" src="https://opencollective-production.s3.us-west-1.amazonaws.com/d7e298c0-7abe-11ed-8553-230872f5e54d.png" width="90" height="64"></a>
<a title="Entertainment" href="https://www.nongamstopbets.com/casinos-not-on-gamstop/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non-GamStop Bets UK" src="https://logo.clearbit.com/nongamstopbets.com" width="64" height="64"></a>
<a title="Job Board for Software Engineers from the US" href="https://devitjobs.com/jobs/Java/all/all?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="DevITJobs.com" src="https://logo.clearbit.com/devitjobs.us" width="64" height="64"></a>
<a title="Get professional support for Carbon" href="https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&amp;utm_medium=referral&amp;utm_campaign=docs&amp;utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Tidelift" src="https://carbon.nesbot.com/tidelift-brand.png" width="84" height="42"></a>
<a title="Best non Gamstop sites in the UK" href="https://nongamstopcasinos.net/gb/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Best non Gamstop sites in the UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/34e340b8-e1de-4932-8a76-1b3ce2ec7ee8/logo_white%20bg%20(8).png" width="42" height="42"></a>
<a title="Real Money Pokies" href="https://onlinecasinoskiwi.co.nz/real-money-pokies/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Real Money Pokies" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/42f8f58b-ddee-4b58-a86d-eb29e3e4e401/onlinecasinoskiwi_logo%20(2).jpg" width="84" height="42"></a>
<a title="Non GamStop Bookies UK" href="https://nongamstopbookiesuk.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank"><img alt="Non GamStop Bookies UK" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/43c5561c-8907-4ef7-a4ee-c6da054788b8/logo-site%20(3).jpg" width="42" height="42"></a>
Expand All @@ -160,11 +161,12 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
<a title="Hall Effect Game Controllers" href="https://www.reddit.com/r/goodsmallgames/comments/1b5w5rf/full_list_of_hall_effect_controllers_pc_xbox_ps5/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Hall Effect Game Controllers" src="https://logo.clearbit.com/reddit.com" width="32" height="32"></a>
<a title="Buy TikTok Followers is a leading provider of social media growth solutions for TikTok.com." href="https://buytiktokfollowers.co/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Buy TikTok Followers" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/8626c295-9414-4e0c-b228-38ca2704cd68/btf-favicon.png" width="32" height="32"></a>
<a title="casinos that accept GamStop players" href="https://www.bsc.news/post/casinos-not-on-gamstop?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Casinos That Accept GamStop Players" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/5e3e35b1-647a-489e-86bd-9b80eec34766/NOT%20ON%20GAMSTOP%20SCHEME.png" width="32" height="32"></a>
<a title="Poradniki PC" href="https://www.it-manuals.info?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="IT-Manuals" src="https://logo.clearbit.com/it-manuals.info" width="32" height="32"></a>
<a title="Siti Non AAMS" href="https://www.outlookindia.com/outlook-spotlight/migliori-siti-non-aams-siti-scommesse-senza-licenza-sicuri-news-294715?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Migliori Siti Non AAMS" src="https://opencollective-production.s3.us-west-1.amazonaws.com/account-avatar/392810da-6cb6-4938-a3cb-38bd0e1eb7de/migliori-siti-non-aams.png" width="24" height="24"></a>
<a title="Vancouver Coir" href="https://www.vancouvercoir.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Vancouver Coir" src="https://logo.clearbit.com/vancouvercoir.com" width="24" height="24"></a>
<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations." href="https://azuracast.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="24" height="24"></a>
<a title="rapid trigger keyboard alternatives to wooting" href="https://medium.com/@hlplanet/best-wooting-alternatives-rapid-trigger-keyboards-e2a802890d96?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Wooting Alternatives" src="https://logo.clearbit.com/medium.com" width="48" height="24"></a>
<a title="Triplebyte is the first software engineering job platform that is on the developer&#039;s side. Take our coding quiz!" href="https://triplebyte.com/os/opencollective?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Triplebyte" src="https://opencollective-production.s3.us-west-1.amazonaws.com/43e4f9d0-30cd-11ea-9c6b-e1142996e8b2.png" width="24" height="24"></a>
<a title="A self-hosted web radio management suite, including turnkey installer tools and an easy-to-use web app to manage your stations." href="https://azuracast.com/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="AzuraCast" src="https://opencollective-production.s3.us-west-1.amazonaws.com/3c12ea10-cdfb-11eb-9cf4-3760b386b76d.png" width="24" height="24"></a>
<a title="Connect your Collective to GitHub Sponsors: https://docs.opencollective.com/help/collectives/github-sponsors" href="https://github.com/sponsors/?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="GitHub Sponsors" src="https://opencollective-production.s3.us-west-1.amazonaws.com/87b1d240-f617-11ea-9960-fd7e8ab20fe4.png" width="27" height="24"></a>
<a title="Salesforce" href="https://engineering.salesforce.com?utm_source=opencollective&amp;utm_medium=github&amp;utm_campaign=Carbon" target="_blank" rel="sponsored"><img alt="Salesforce" src="https://opencollective-production.s3.us-west-1.amazonaws.com/24d34880-df8d-11e9-949c-6bc2037b6bd5.png" width="24" height="24"></a>
<!-- </open-collective-sponsors> -->
Expand Down
45 changes: 40 additions & 5 deletions sponsors.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ function getOpenCollectiveSponsors(): string
];

$members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true);
$members[] = [
'MemberId' => 1,
'createdAt' => '2019-01-01 02:00',
'type' => 'ORGANIZATION',
'role' => 'BACKER',
'tier' => 'backer+',
'isActive' => true,
'totalAmountDonated' => 1000,
'currency' => 'USD',
'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d') . ' 02:00',
'lastTransactionAmount' => 25,
'profile' => 'https://tidelift.com/',
'name' => 'Tidelift',
'description' => 'Get professional support for Carbon',
'image' => 'https://carbon.nesbot.com/tidelift-brand.png',
'website' => 'https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs',
];

$list = array_filter($members, static function ($member): bool {
return ($member['lastTransactionAmount'] > 3 || $member['isActive']) &&
Expand Down Expand Up @@ -78,29 +95,42 @@ function getOpenCollectiveSponsors(): string
$monthlyContribution = (float) $member['lastTransactionAmount'];
}

if ($lastTransactionAt->isBefore('-75 days')) {
$days = min(120, $lastTransactionAt->diffInDays('now') - 70);
$monthlyContribution *= 1 - $days / 240;
}

$yearlyContribution = (float) ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears()));
$status = null;
$rank = 0;

if ($monthlyContribution > 29) {
if ($monthlyContribution > 29 || $yearlyContribution > 700) {
$status = 'sponsor';
} elseif ($monthlyContribution > 14.5) {
$rank = 4;
} elseif ($monthlyContribution > 14.5 || $yearlyContribution > 500) {
$status = 'backerPlus';
} elseif ($monthlyContribution > 4.5 || $yearlyContribution > 40) {
$rank = 3;
} elseif ($monthlyContribution > 4.5 || $yearlyContribution > 80) {
$status = 'backer';
$rank = 2;
} elseif ($member['totalAmountDonated'] > 0) {
$status = 'helper';
$rank = 1;
}

return array_merge($member, [
'star' => ($monthlyContribution > 98 || $yearlyContribution > 500),
'star' => ($monthlyContribution > 98 || $yearlyContribution > 800),
'status' => $status,
'rank' => $rank,
'monthlyContribution' => $monthlyContribution,
'yearlyContribution' => $yearlyContribution,
]);
}, $list);

usort($list, static function (array $a, array $b): int {
return ($b['monthlyContribution'] <=> $a['monthlyContribution'])
return ($b['star'] <=> $a['star'])
?: ($b['rank'] <=> $a['rank'])
?: ($b['monthlyContribution'] <=> $a['monthlyContribution'])
?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']);
});

Expand All @@ -126,6 +156,11 @@ function getOpenCollectiveSponsors(): string
$title = getHtmlAttribute(($member['description'] ?? null) ?: $member['name']);
$alt = getHtmlAttribute($member['name']);

if ($member['star']) {
$width *= 1.5;
$height *= 1.5;
}

return "\n".'<a title="'.$title.'" href="'.$href.'" target="_blank"'.$rel.'>'.
'<img alt="'.$alt.'" src="'.$src.'" width="'.$width.'" height="'.$height.'">'.
'</a>';
Expand Down

0 comments on commit b9cc24a

Please sign in to comment.