mirror of
https://www.gitlink.org.cn/mayx/mayx.gitlink.net
synced 2026-12-06 19:00:22 +00:00
Update 2 files
- /_posts/2019-03-23-gitio.md - /_data/proxylist.yml
This commit is contained in:
@@ -48,7 +48,6 @@ repos:
|
|||||||
- https://bitbucket.org/unmayx/mayx
|
- https://bitbucket.org/unmayx/mayx
|
||||||
- https://sourcecraft.dev/mayx/mayx
|
- https://sourcecraft.dev/mayx/mayx
|
||||||
- https://code.forgejo.org/mayx/blog
|
- https://code.forgejo.org/mayx/blog
|
||||||
- https://gitflic.ru/project/mayx/blog
|
|
||||||
- https://rocketgit.com/user/mayx/blog/
|
- https://rocketgit.com/user/mayx/blog/
|
||||||
- https://tangled.org/mayx.tngl.sh/blog/
|
- https://tangled.org/mayx.tngl.sh/blog/
|
||||||
- https://gitee.com/mabbs/mabbs
|
- https://gitee.com/mabbs/mabbs
|
||||||
|
|||||||
@@ -9,8 +9,44 @@ tags: [无限制, Git.io, Github]
|
|||||||
然而Git.io只能缩短Github域名的网址。
|
然而Git.io只能缩短Github域名的网址。
|
||||||
我还是挺喜欢Git.io这个域名的,尽管它比t.cn这种链接要长,但是Git(愚蠢)听起来就是很有意思啦23333
|
我还是挺喜欢Git.io这个域名的,尽管它比t.cn这种链接要长,但是Git(愚蠢)听起来就是很有意思啦23333
|
||||||
所以我想了一个办法来解决Git.io只能创建Github.com网站链接的限制。
|
所以我想了一个办法来解决Git.io只能创建Github.com网站链接的限制。
|
||||||
|
演示效果:<https://git.io/GitIO>
|
||||||
(尽管很想搞一个能自定义Git.io链接的选项,可惜我前端不好LOL)
|
(尽管很想搞一个能自定义Git.io链接的选项,可惜我前端不好LOL)
|
||||||
(其实要不是因为CORS这种问题,就不用PHP来浪费资源了……)
|
(其实要不是因为CORS这种问题,就不用PHP来浪费资源了……)
|
||||||
|
|
||||||
# REMOVED
|
# Code
|
||||||
由于此脚本被滥用导致本博客被删,此服务将不再提供
|
(由于此脚本被滥用导致本博客被删,此服务将不再提供,以下脚本仅作记录)
|
||||||
|
## 1.gitio.php
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
$talkContent = "";
|
||||||
|
$url=addslashes($_POST['url']);
|
||||||
|
function send_post($url, $post_data) {
|
||||||
|
|
||||||
|
$postdata = http_build_query($post_data);
|
||||||
|
$options = array(
|
||||||
|
'http' => 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;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user