Lines 23-28
use CGI qw ( -utf8 );
Link Here
|
23 |
|
23 |
|
24 |
use JSON qw(from_json); |
24 |
use JSON qw(from_json); |
25 |
use LWP::Simple qw(get); |
25 |
use LWP::Simple qw(get); |
|
|
26 |
use URI::Escape qw( uri_escape_utf8 ); |
26 |
|
27 |
|
27 |
use Koha::Plugins; |
28 |
use Koha::Plugins; |
28 |
use C4::Auth; |
29 |
use C4::Auth; |
Lines 72-80
if ($plugins_enabled) {
Link Here
|
72 |
$repos = { repo => [ $repos->{repo} ] }; |
73 |
$repos = { repo => [ $repos->{repo} ] }; |
73 |
} |
74 |
} |
74 |
|
75 |
|
|
|
76 |
my $plugin_search_uri = uri_escape_utf8( $plugin_search ); |
75 |
foreach my $r ( @{ $repos->{repo} } ) { |
77 |
foreach my $r ( @{ $repos->{repo} } ) { |
76 |
if ( $r->{service} eq 'github' ) { |
78 |
if ( $r->{service} eq 'github' ) { |
77 |
my $url = "https://api.github.com/search/repositories?q=$plugin_search+user:$r->{org_name}+in:name,description"; |
79 |
my $url = "https://api.github.com/search/repositories?q=$plugin_search_uri+user:$r->{org_name}+in:name,description"; |
78 |
my $response = from_json( get($url) ); |
80 |
my $response = from_json( get($url) ); |
79 |
foreach my $result ( @{ $response->{items} } ) { |
81 |
foreach my $result ( @{ $response->{items} } ) { |
80 |
next unless $result->{name} =~ /^koha-plugin-/; |
82 |
next unless $result->{name} =~ /^koha-plugin-/; |
Lines 91-97
if ($plugins_enabled) {
Link Here
|
91 |
} |
93 |
} |
92 |
elsif ( $r->{service} eq 'gitlab' ) { |
94 |
elsif ( $r->{service} eq 'gitlab' ) { |
93 |
my $org_name = $r->{org_name}; |
95 |
my $org_name = $r->{org_name}; |
94 |
my $url = "https://gitlab.com/api/v4/groups/$org_name/projects?with_issues_enabled=no\&with_merge_requests_enabled=no\&with_shared=no\&include_subgroups=yes\&search=koha-plugin+$plugin_search"; |
96 |
my $url = "https://gitlab.com/api/v4/groups/$org_name/projects?with_issues_enabled=no\&with_merge_requests_enabled=no\&with_shared=no\&include_subgroups=yes\&search=koha-plugin+$plugin_search_uri"; |
95 |
my $response = from_json( get($url) ); |
97 |
my $response = from_json( get($url) ); |
96 |
foreach my $result ( @{ $response } ) { |
98 |
foreach my $result ( @{ $response } ) { |
97 |
next unless $result->{name} =~ /^koha-plugin-/; |
99 |
next unless $result->{name} =~ /^koha-plugin-/; |
98 |
- |
|
|