Skip to content

Commit

Permalink
Wikidata.org might also be a source
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaran committed Oct 16, 2019
1 parent ca1cd28 commit 840db39
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,12 @@ Ideas
* `openssh-multiple-bindaddress` (AUR)
* `openssh-with-hpn` (nixpkgs)

* Another source might be [Wikidata's OpenSSH
entry](https://www.wikidata.org/wiki/Q847062) and [its JSON
representation](https://www.wikidata.org/wiki/Special:EntityData/Q847062.json).
* Probably less reliable than repology because likely only manual
/ crowd-sourced data updates.

* Add support for more [Debian
derivatives](https://wiki.debian.org/Derivatives/Census):

Expand Down
25 changes: 25 additions & 0 deletions bin/newest-openssh-version-on-wikidata.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/perl

use strict;
use warnings;
use 5.014;

use Mojo::UserAgent;
use Mojo::Collection qw(c);
use List::Util qw(max);
# Maybe use Mojo::Collection::Role::UtilsBy later.

my $api_url = 'https://www.wikidata.org/wiki/Special:EntityData/Q847062.json';
my $ua = Mojo::UserAgent->new;

say max
@{
c(
@{
$ua->get($api_url)->result->json->{entities}{Q847062}{claims}{P348}
}
)
->map(sub { $_->{mainsnak}{datavalue}{value} })
->grep(sub { !/p\d+$/ })
->to_array
};

0 comments on commit 840db39

Please sign in to comment.