diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32bbaab --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea +hosts.txt +hosts.json +index.php diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..e69de29 diff --git a/fetch_hosts.php b/fetch_hosts.php new file mode 100644 index 0000000..93f4330 --- /dev/null +++ b/fetch_hosts.php @@ -0,0 +1,71 @@ +', $utc_date, $template)); +hosts_write('hosts.txt', $hosts_content); +hosts_write('hosts.json', json_encode($github_hosts)); + +echo "fetch success! ($utc_date)"; + + + + + diff --git a/index-template.php b/index-template.php new file mode 100644 index 0000000..e826859 --- /dev/null +++ b/index-template.php @@ -0,0 +1,35 @@ + + + + + + + Fetch Github IP + + + +

说明

+此服务为解决研究及学习人员访问 Github 过慢或其他问题而提供的免费的 Github hosts 同步服务,严禁用于任何非法用途,此服务仅供学习交流。 +

最近获取时间: + + + +   + [hosts.txt] + [hosts.json] +

+

使用方法

+

Unix/Linux

+sed -i "/# fetch-github-host begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts +

提示:可以设置定时任务定时获取更新即可

+

Chrome

+使用 FasterHosts 插件 +

Windows/MacOS及其他桌面端

+使用 SwitchHosts 程序,添加远程规则即可,远程地址为:https://hosts.gitcdn.top/hosts.txt +

仓库

+https://github.com/Licoy/fetch-github-hosts +

开源协议

+GPL 3.0 +

+ +