Support HTTP and HTTPS links (#16)

* accept http and https links

* support http and https links
This commit is contained in:
itchylol742 2018-10-18 15:26:55 -04:00 committed by Samar Dhwoj Acharya
parent 0eb199559e
commit dadc89618d

View file

@ -78,6 +78,10 @@ function initDT() {
function fetchAndShow( repo ) { function fetchAndShow( repo ) {
repo = repo.replace('https://github.com/', '');
repo = repo.replace('http://github.com/', '');
repo = repo.replace('.git', '');
fetch( `https://api.github.com/repos/${repo}/forks?sort=stargazers` ) fetch( `https://api.github.com/repos/${repo}/forks?sort=stargazers` )
.then( ( response ) => { .then( ( response ) => {
if ( !response.ok ) if ( !response.ok )