diff --git a/README.md b/README.md index 265ceed..8e27ae1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@

+ 让我帮你百度一下 +

「Let Me Baidu That For You」

@@ -28,9 +30,19 @@ [http://lab.mkblog.cn/lmbtfy/](http://lab.mkblog.cn/lmbtfy/) + +### 相关项目 +----- + +- Let Me Google That For You https://github.com/xb2016/lmgtfy +- Let Me Baidu That For You 原版 https://github.com/bangbang93/lmbtfy.cn + ### 更新日志 ----- +#### 2019/10/8 +- 将网址缩短接口替换为 eps.gs,修复无法生成短网址的问题 + #### 2019/4/27 - 修复因 CDN 失效导致无法使用的问题 - 重构部分代码,界面更美观 diff --git a/api.php b/api.php index fb45679..5dfb0ba 100644 --- a/api.php +++ b/api.php @@ -1,7 +1,8 @@ urls[0]->url_short)? $obj->urls[0]->url_short: ''; // 取出短网址的值 - return $output? $output: $longUrl; + $result = file_get_contents('https://eps.gs/api/make.php?url='.$longUrl); + $result = json_decode($result, true); + if(isset($result['url_short'])) { + return $result['url_short']; + } else { + return $longUrl; + } }