Skip to content

Commit

Permalink
sponsors: add & remove silver sponsors & improve script
Browse files Browse the repository at this point in the history
Bountii, Earthweb and ProxyCoupons are new silver sponsors.

- The script now uses the OpenCollective username ("slug") to disambiguate
  entries when a user does not have a web site configured
- The curl invocation to download sponsors now uses more robust options
- The alt tag is now capitalized
- Perl strict mode is enabled
  • Loading branch information
dfandrich committed Jul 15, 2024
1 parent b71190b commit 23dcb6c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 22 deletions.
24 changes: 14 additions & 10 deletions _sponsors.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,23 @@
<div style="clear: both;"></div>
SUBTITLE(Silver sponsors)
<!-- Silver start -->
<div class="silver"><p> <a class="x" href="https://icons8.com/" rel="sponsored"><img src="pix/silver/icons8.svg" alt="icons8"></a></div>
<div class="silver"><p> <a class="x" href="https://www.minitool.com" rel="sponsored"><img src="pix/silver/minitool-2.svg" alt="minitool-2"></a></div>
<div class="silver"><p> <a class="x" href="https://www.airbnb.com/" rel="sponsored"><img src="pix/silver/airbnb.svg" alt="airbnb"></a></div>
<div class="silver"><p> <a class="x" href="https://icons8.com/" rel="sponsored"><img src="pix/silver/icons8.svg" alt="Icons8"></a></div>
<div class="silver"><p> <a class="x" href="https://www.minitool.com" rel="sponsored"><img src="pix/silver/minitool-2.svg" alt="Minitool-2"></a></div>
<div class="silver"><p> <a class="x" href="https://www.airbnb.com/" rel="sponsored"><img src="pix/silver/airbnb.svg" alt="Airbnb"></a></div>
<div class="silver"><p> <a class="x" href="https://www.crosswordsolver.com" rel="sponsored"><img src="pix/silver/CrosswordSolver.svg" alt="CrosswordSolver"></a></div>
<div class="silver"><p> <a class="x" href="https://www.partitionwizard.com" rel="sponsored"><img src="pix/silver/partitionwizard-2.svg" alt="partitionwizard-2"></a></div>
<div class="silver"><p> <a class="x" href="https://www.premium-minds.com" rel="sponsored"><img src="pix/silver/premium-minds.svg" alt="premium-minds"></a></div>
<div class="silver"><p> <a class="x" href="https://ipinfo.io/" rel="sponsored"><img src="pix/silver/ipinfo.svg" alt="ipinfo"></a></div>
<div class="silver"><p> <a class="x" href="https://serpapi.com" rel="sponsored"><img src="pix/silver/serpapi.svg" alt="serpapi"></a></div>
<div class="silver"><p> <a class="x" href="https://proxy-hub.com/" rel="sponsored"><img src="pix/silver/proxyhub.svg" alt="proxyhub"></a></div>
<div class="silver"><p> <a class="x" href="https://cryptotracker.com" rel="sponsored"><img src="pix/silver/crypto-tracker.svg" alt="crypto-tracker"></a></div>
<div class="silver"><p> <a class="x" href="https://www.partitionwizard.com" rel="sponsored"><img src="pix/silver/partitionwizard-2.svg" alt="Partitionwizard-2"></a></div>
<div class="silver"><p> <a class="x" href="https://www.premium-minds.com" rel="sponsored"><img src="pix/silver/premium-minds.svg" alt="Premium-minds"></a></div>
<div class="silver"><p> <a class="x" href="https://ipinfo.io/" rel="sponsored"><img src="pix/silver/ipinfo.svg" alt="Ipinfo"></a></div>
<div class="silver"><p> <a class="x" href="https://serpapi.com" rel="sponsored"><img src="pix/silver/serpapi.svg" alt="Serpapi"></a></div>
<div class="silver"><p> <a class="x" href="https://proxy-hub.com/" rel="sponsored"><img src="pix/silver/proxyhub.svg" alt="Proxyhub"></a></div>
<div class="silver"><p> <a class="x" href="https://cryptotracker.com" rel="sponsored"><img src="pix/silver/crypto-tracker.svg" alt="Crypto-tracker"></a></div>
<div class="silver"><p> <a class="x" href="https://iboysoft.com" rel="sponsored"><img src="pix/silver/iBoysoft.svg" alt="iBoysoft"></a></div>
<div class="silver"><p> <a class="x" href="https://fineproxy.org/" rel="sponsored"><img src="pix/silver/fineproxy.jpg" alt="fineproxy"></a></div>
<div class="silver"><p> <a class="x" href="https://www.testarna.se/casino/utan-svensk-licens" rel="sponsored"><img src="pix/silver/testarna.png" alt="Testarna"></a></div>
<div class="silver"><p> <a class="x" href="https://fineproxy.org/" rel="sponsored"><img src="pix/silver/fineproxy.jpg" alt="Fineproxy"></a></div>
<div class="silver"><p> <a class="x" href="https://bountii.coupons/" rel="sponsored"><img src="pix/silver/bountii.png" alt="Bountii"></a></div>
<div class="silver"><p> <a class="x" href="https://proxy.coupons" rel="sponsored"><img src="pix/silver/proxycoupons.png" alt="Proxycoupons"></a></div>
<div class="silver"><p> <a class="x" href="https://earthweb.com/" rel="sponsored"><img src="pix/silver/earthweb.png" alt="Earthweb"></a></div>

<!-- Silver via other means -->
<div class="silver"><p> <a class="x" href="https://www.airlock.com/" rel="sponsored"><img src="pix/silver/airlock.svg" alt="Airlock"></a></div>
<div class="silver"><p> <a class="x" href="https://www.babiel.com/" rel="sponsored" aria-label="Babiel">
Expand Down
40 changes: 28 additions & 12 deletions mk-sponsors.pl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/perl
use strict;

# https://rest.opencollective.com/v2/curl/tier/silver-sponsor/orders/active
my $SSURL = "https://rest.opencollective.com/v2/curl/tier/silver-sponsor/orders/active";

## Silver sponsors

# URLs must match exactly the one retrieved from opencollective.com
# URLs must match exactly the one retrieved from opencollective.com or if null the "slug"
my %silver = (
"https://ipinfo.io/" => 'ipinfo.svg',
"https://www.romab.com" => '[none]',
"https://www.airbnb.com/" => 'airbnb.svg',
"https://www.premium-minds.com" => 'premium-minds.svg',
"https://www.partitionwizard.com" => 'partitionwizard-2.svg',
Expand All @@ -18,20 +18,35 @@
"https://proxy-hub.com/" => 'proxyhub.svg',
'https://cryptotracker.com' => 'crypto-tracker.svg',
'https://iboysoft.com' => 'iBoysoft.svg',
# https://opencollective.com/ivan13 has a 'null' website in profile
"null" => 'fineproxy.jpg',
'https://www.casino.xyz' => 'testarna.png',
"flutter-enterprises" => 'fineproxy.jpg',
'https://www.hityah.com/' => 'testarna.png',
'https://bountii.coupons/' => 'bountii.png',
'https://earthweb.com/' => 'earthweb.png',
'https://proxy.coupons' => 'proxycoupons.png',

# Sponsors that don't get images
'babiel-gmbh' => '[none]', # special case handled in _sponsors.html
'thebestsolution' => '[none]', # link denied 16 May 2024 due to social media manipulation
'https://onelessthing.co.uk/' => '[none]', # no request received for image
"https://www.romab.com" => '[none]', # historical
);

# URLs that are changed from the one in the profile
my %modurl = (
'null' => 'https://fineproxy.org/',
'https://www.casino.xyz' => 'https://www.testarna.se/casino/utan-svensk-licens',
'flutter-enterprises' => 'https://fineproxy.org/',
'https://www.hityah.com/' => 'https://www.testarna.se/casino/utan-svensk-licens',
);

# the URLs
open(S, "curl https://rest.opencollective.com/v2/curl/tier/silver-sponsor/orders/active -s | jq '.nodes[].fromAccount.website'|");
@urls=<S>;
# Get the list of Silver Sponsor URLs
# Some users don't have web sites configured, in which case use the username
# instead and map it to a URL with %modurl
open(S, "curl -sRL --compressed --proto -all,+https --max-redirs 3 --max-time 10 $SSURL | jq '.nodes[] | if (.fromAccount.website == null) then .fromAccount.slug else .fromAccount.website end'|");
my @urls=<S>;
close(S);

my %found;
my $images;
my $count;
for my $u (reverse @urls) {
{
my $url = $u;
Expand All @@ -45,7 +60,8 @@
if($img ne '[none]') {
my $alt = $img;
my $href = $url;
$alt =~ s/(.*)\..../$1/;
$alt =~ s/(.*)\....$/$1/; # strip the extension
$alt =~ s/^([-a-z0-9]*)$/\u$1/; # capitalize only if all lowercase
if($modurl{$url}) {
$href=$modurl{$url};
$found{$href}=1;
Expand Down
Binary file added pix/silver/bountii.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/silver/earthweb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/silver/proxycoupons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 23dcb6c

Please sign in to comment.