From 786aaccb966a4153c4c1e4561e6142bf29483eff Mon Sep 17 00:00:00 2001 From: mayx Date: Sun, 6 Dec 2026 16:14:43 +0000 Subject: [PATCH] Update 2 files - /_posts/2019-03-23-gitio.md - /_data/proxylist.yml --- _data/proxylist.yml | 1 - _posts/2019-03-23-gitio.md | 40 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/_data/proxylist.yml b/_data/proxylist.yml index cafafdd..f9a86b5 100644 --- a/_data/proxylist.yml +++ b/_data/proxylist.yml @@ -48,7 +48,6 @@ repos: - https://bitbucket.org/unmayx/mayx - https://sourcecraft.dev/mayx/mayx - https://code.forgejo.org/mayx/blog -- https://gitflic.ru/project/mayx/blog - https://rocketgit.com/user/mayx/blog/ - https://tangled.org/mayx.tngl.sh/blog/ - https://gitee.com/mabbs/mabbs diff --git a/_posts/2019-03-23-gitio.md b/_posts/2019-03-23-gitio.md index 5bb35b7..2e54253 100644 --- a/_posts/2019-03-23-gitio.md +++ b/_posts/2019-03-23-gitio.md @@ -9,8 +9,44 @@ tags: [无限制, Git.io, Github] 然而Git.io只能缩短Github域名的网址。 我还是挺喜欢Git.io这个域名的,尽管它比t.cn这种链接要长,但是Git(愚蠢)听起来就是很有意思啦23333 所以我想了一个办法来解决Git.io只能创建Github.com网站链接的限制。 + 演示效果: (尽管很想搞一个能自定义Git.io链接的选项,可惜我前端不好LOL) (其实要不是因为CORS这种问题,就不用PHP来浪费资源了……) -# REMOVED - 由于此脚本被滥用导致本博客被删,此服务将不再提供 +# Code + (由于此脚本被滥用导致本博客被删,此服务将不再提供,以下脚本仅作记录) +## 1.gitio.php +```php + array( + 'method' => 'POST', + 'header' => 'Content-type:application/x-www-form-urlencoded', + 'content' => $postdata, + 'timeout' => 15 * 60 + ) + ); + $context = stream_context_create($options); + $result = file_get_contents($url, false, $context); + + return $result; +} +if(get_headers($url)) { +$post_data = array('url'=>"https://mabbs.github.io/jump.html?url=".$url ); +$talkContent = send_post('https://git.io/create', $post_data); +header('text/html; charset=utf-8'); +header('Access-Control-Allow-Origin: *'); +echo $talkContent; +} else { +header('HTTP/1.1 500 Internal Server Error'); +header('text/html; charset=utf-8'); +header('Access-Control-Allow-Origin: *'); +echo "Invalid url: ".$url; +} +?> +```