Skip to content

Commit

Permalink
Update update-repositories.php
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Jun 5, 2020
1 parent b0c3029 commit 686631a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions update-repositories.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<?php
// Max Base
// https://github.com/BaseMax/GitHubBackupArchiver
include "NetPHP.php";
$username="basemax"
$count=260;
$page=ceil($count / 100);
// $path="/root/repositories";
$path=getcwd();
for($i=1;$i<=$page;$i++) {
$data=get("https://api.github.com/users/".$username."/repos?per_page=100&page=".$i);
$json=json_decode($data[0], true);
foreach($json as $item) {
$name=$item["name"];
print $name."\n";
if(file_exists($path."/".$name)) {
chdir($path."/".$name);
exec("git pull");
}
}
}

0 comments on commit 686631a

Please sign in to comment.