Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mobeets/mpm
Browse files Browse the repository at this point in the history
  • Loading branch information
mobeets committed Jan 12, 2018
2 parents d95e61f + f3f961c commit a202b5a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mpm.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ function mpm(action, varargin)
% path
% - install: installs a package by name
% - uninstall: installs a package by name
% - search: finds a url for a package by name (searches Github and
% - search: finds a url for a package by name
% (searches Github and File Exchange)
% - freeze: list all installed packages (optional: in installdir)
% File Exchange)
% name [optional]: name of package (e.g., 'matlab2tikz')
%
% name-value arguments:
Expand Down Expand Up @@ -249,10 +249,13 @@ function listPackages(opts)

url = '';

% query github for matlab repositories, sorted by stars
% query github for matlab repositories
% https://developer.github.com/v3/search/#search-repositories
% ' ' will be replaced by '+', which seems necessary
% ':' for search qualifiers can be sent encoded on the other hand
q_url = 'https://api.github.com/search/repositories';
html = webread(q_url, 'q', pkg.name, 'language', 'matlab', ...
'sort', 'stars', 'order', 'desc');
q_req = [pkg.name, ' language:matlab'];
html = webread(q_url, 'q', q_req);
if isempty(html) || ~isfield(html, 'items') || isempty(html.items)
return;
end
Expand Down

0 comments on commit a202b5a

Please sign in to comment.