mirror of https://github.com/helloxz/MDtoHTML
beta
parent
e76e07ab6a
commit
edf2c9e1cb
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
error_reporting(E_ALL^E_NOTICE^E_WARNING^E_DEPRECATED);
|
||||
include_once("Parsedown.php");
|
||||
|
||||
$Parsedown = new Parsedown();
|
||||
//获取URL地址
|
||||
$url = $_GET['url'];
|
||||
//获取文件后缀
|
||||
$suffix = explode(".",$url);
|
||||
$suffix = end($suffix);
|
||||
//判断文件后缀
|
||||
if($suffix != 'md') {
|
||||
echo '尚未识别的文件!';
|
||||
exit;
|
||||
}
|
||||
//对URL进行md5加密用于文件存储
|
||||
$filename = md5($url);
|
||||
$filename = "caches/".$filename.".md";
|
||||
//获取样式
|
||||
$style = $_GET['style'];
|
||||
//获取方法
|
||||
$method = $_GET['method'];
|
||||
|
||||
//判断URL地址
|
||||
if(!filter_var($url, FILTER_VALIDATE_URL)) {
|
||||
echo 'URL地址不合法!';
|
||||
exit;
|
||||
}
|
||||
//清除缓存
|
||||
if($method == 'clear') {
|
||||
unlink($filename);
|
||||
}
|
||||
|
||||
//如果文件存在
|
||||
if(is_file($filename)) {
|
||||
$text = file_get_contents($filename);
|
||||
}
|
||||
//文件不存在
|
||||
else{
|
||||
$curl = curl_init($url);
|
||||
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36");
|
||||
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
$text = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
$myfile = fopen($filename, "w");
|
||||
fwrite($myfile, $text);
|
||||
fclose($myfile);
|
||||
}
|
||||
|
||||
$html = $Parsedown->text($text);
|
||||
|
||||
// 是否带有样式
|
||||
switch ( $style )
|
||||
{
|
||||
case 'none':
|
||||
echo $html;
|
||||
break;
|
||||
default:
|
||||
include_once('style.php');
|
||||
break;
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,57 @@
|
|||
### GET方式
|
||||
```php
|
||||
<?php
|
||||
//初始化
|
||||
$ch = curl_init();
|
||||
//设置选项,包括URL
|
||||
curl_setopt($ch, CURLOPT_URL, "http://www.jb51.net");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
//执行并获取HTML文档内容
|
||||
$output = curl_exec($ch);
|
||||
//释放curl句柄
|
||||
curl_close($ch);
|
||||
//打印获得的数据
|
||||
print_r($output);
|
||||
?>
|
||||
```
|
||||
|
||||
### POST方式
|
||||
```
|
||||
<?php
|
||||
$url = "http://localhost/web_services.php";
|
||||
$post_data = array ("username" => "bob","key" => "12345");
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
// post数据
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
// post的变量
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
//打印获得的数据
|
||||
print_r($output);
|
||||
?>
|
||||
```
|
||||
### HTTPS
|
||||
```
|
||||
<?php
|
||||
$curl = curl_init("https://www.xiaoz.me/");
|
||||
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");
|
||||
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
$html = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
var_dump($html);
|
||||
?>
|
||||
```
|
||||
|
||||
___
|
||||
|
||||
> 测试是否删除了缓存
|
|
@ -0,0 +1,77 @@
|
|||
# LACY
|
||||
Linux一键安装Aria2 + Caddy + YAAW实现离线下载,非要取个名字的话就叫LACY吧。
|
||||
|
||||
### 功能
|
||||
* 支持多种Linux发行版
|
||||
* 一键安装Aria2 + Caddy + YAAW
|
||||
* 文件管理
|
||||
* 离线下载 + 在线播放
|
||||
|
||||
### 环境要求
|
||||
* CentOS 6/7 X64
|
||||
* Debian 8+ X64 or Ubuntu 16+ X64
|
||||
* 不支持32位系统,不支持32位系统,不支持32位系统。
|
||||
|
||||
### 开始安装
|
||||
|
||||
直接复制下面的命令,一行一个,根据提示完成操作。
|
||||
|
||||
```
|
||||
#Centos用户
|
||||
yum -y install wget unzip
|
||||
#如果是Debian or Ubuntu用户
|
||||
apt-get install -y wget unzip
|
||||
#下面的命令通用,直接复制
|
||||
wget https://github.com/helloxz/aria2/archive/master.zip
|
||||
unzip master.zip && cd aria2-master && chmod u+x *.sh && ./install_aria2.sh
|
||||
```
|
||||
|
||||
详细使用说明: [https://www.xiaoz.me/archives/9694](https://www.xiaoz.me/archives/9694)
|
||||
|
||||
### 相关命令
|
||||
```
|
||||
#启动
|
||||
/data/aria2/aria2.sh start
|
||||
#停止
|
||||
/data/aria2/aria2.sh stop
|
||||
#重启
|
||||
/data/aria2/aria2.sh restart
|
||||
#卸载
|
||||
cd aria2-master && ./uninstall.sh
|
||||
#Caddy server配置文件
|
||||
/data/aria2/caddy.conf
|
||||
#Aria2配置文件
|
||||
/data/aria2/aria2.conf
|
||||
#离线下载目录
|
||||
/data/aria2/download
|
||||
#日志目录
|
||||
/data/aria2/aria2.log
|
||||
/data/aria2/caddy.log
|
||||
```
|
||||
|
||||
### 常见问题
|
||||
#### YAAW提示Error: Internal server error 错误?
|
||||
* YAAW提示Error: Internal server error 错误?
|
||||
* 原因二:输入`netstat -apn|grep 'aria2c'`查看进程,如果没有任何信息,可以确定Aria2服务未启动,输入命令`nohup aria2c --conf-path=/data/aria2/aria2.conf > /data/aria2/aria2.log 2>&1 &`重新启动服务,如果依然不行,请查看错误日志`/data/aria2/aria2.log`
|
||||
* 原因三:防火墙未放行6800端口,请自行放行下端口或关闭服务器防火墙。
|
||||
|
||||
#### 重启了服务器就打不开了?
|
||||
脚本并未设置开机启动,重启服务器后请输入`/data/aria2/aria2.sh start`来运行服务。
|
||||
|
||||
#### 我是Debian/Ubuntu用户,提示安装成功,但是打不开?
|
||||
Debian/Ubuntu并未自动放行端口,请放行6080/6800两个端口,或者直接关闭防火墙,如果您的服务商支持安全组还需要额外检查。
|
||||
|
||||
### 问题反馈
|
||||
可以我Blog留言,或者Github Issues,为了方便排查,请提供以下信息。
|
||||
* 使用的操作系统
|
||||
* 报错信息或截图
|
||||
* `/data/aria2/aria2.log`里面的日志内容
|
||||
|
||||
### 部分截图
|
||||
![](https://www.xiaoz.me/wp-content/uploads/2017/12/snipaste_20171208_184105.png)
|
||||
![](https://www.xiaoz.me/wp-content/uploads/2017/12/snipaste_20171209_150754.png)
|
||||
|
||||
### 联系我
|
||||
* 详细使用说明:[Linux一键安装Aria2 + YAAW实现离线下载](https://www.xiaoz.me/archives/9694)
|
||||
* Blog:[https://www.xiaoz.me/](https://www.xiaoz.me/)
|
||||
* Q Q:337003006
|
|
@ -0,0 +1,24 @@
|
|||
# IPinfo
|
||||
IPinfo是一个整合多接口的IP地址查询工具
|
||||
|
||||
### 主要功能
|
||||
* 自动获取内网IP、公网IP
|
||||
* 支持多个数据接口
|
||||
* 支持一键查询所有IP接口,方便对比数据
|
||||
|
||||
### 使用
|
||||
IPinfo使用PHP开发,开箱即用,下载源码后直接放到站点根目录即可。
|
||||
|
||||
### Demo
|
||||
* [https://ip.awk.sh/](https://ip.awk.sh/)
|
||||
|
||||
![](https://imgurl.org/upload/1803/cb30735507513797.png)
|
||||
|
||||
![](https://imgurl.org/upload/1803/7a747d7002a6097e.png)
|
||||
|
||||
![](https://imgurl.org/upload/1803/02f8ffeb41418ef6.png)
|
||||
|
||||
### 联系我
|
||||
* Blog:[https://www.xiaoz.me/](https://www.xiaoz.me/)
|
||||
* Q Q:337003006
|
||||
* E-mail:xiaoz93#outlook.com
|
|
@ -0,0 +1,18 @@
|
|||
# 小z博客 - 软件库
|
||||
|
||||
### 为什么要搭建软件库?
|
||||
在办公过程中经常会用到一些常用软件,如果一旦重装系统或者更换电脑,那么又得重新上网寻找并下载,不利于效率提高,于是直接搭建一个常用软件库,将常用的软件收集整理,节省时间,方便自己也利于他人。
|
||||
|
||||
### 什么人可以使用?
|
||||
小z博客 - 软件库欢迎任何一位访客下载使用,大部分软件来源于软件官方,少部分是第三方修改或汉化,所有软件都经博主测试,可放心下载,若有问题请及时反馈。如果您有优秀的软件推荐,也可以私信博主进行上传。
|
||||
|
||||
### 服务器托管
|
||||
小z博客 - 软件库托管与[UltraVPS](https://www.xiaoz.me/archives/9633 "UltraVPS").
|
||||
|
||||
### 关于下载
|
||||
由于服务器在海外直接使用浏览器单线程下载速度可能较慢,推荐使用第三方下载工具,如迅雷、QQ旋风等进行下载,可提高下载速度。另外晚上的速度可能低于白天的下载速度。
|
||||
|
||||
### 联系方式
|
||||
* E-mail:xiaoz93#outlook.com
|
||||
* QQ:337003006
|
||||
* Blog:[www.xiaoz.me](https://www.xiaoz.me/ "小z博客")
|
|
@ -0,0 +1,29 @@
|
|||
# ImgURL
|
||||
ImgURL是一个简单、纯粹的图床程序,使用PHP脚本开发,不需要数据库支持,也没有复杂的配置。
|
||||
|
||||
### 环境要求
|
||||
* PHP >= 5.6
|
||||
* 需要exif函数支持
|
||||
|
||||
### 开发计划
|
||||
- [x] 图片上传与预览
|
||||
- [x] 一键生成链接
|
||||
- [x] 浏览与删除图片
|
||||
- [x] 图片压缩
|
||||
- [x] 图片鉴黄
|
||||
- [ ] 图片水印
|
||||
- [ ] 多图上传
|
||||
- [ ] API上传
|
||||
|
||||
### 安装
|
||||
<p>访问:<a href="https://github.com/helloxz/imgurl/archive/master.zip" target = "_blank" rel = "nofollow">master.zip</a>下载最新版ImgURL程序,放到您的站点根目录并解压。修改一下<code>config.php</code>设置你自己的域名和密码,访问<code>http(s)://domain.com/</code>即可,就是这么简单。</p>
|
||||
|
||||
### 演示
|
||||
Demo:[http://imgurl.org/](http://imgurl.org/)
|
||||
|
||||
|
||||
![](https://i.bk.tn/uploads/1712/230615302734.png)
|
||||
|
||||
### 联系我
|
||||
* Blog:[https://www.xiaoz.me/](https://www.xiaoz.me/)
|
||||
* QQ:337003006
|
|
@ -0,0 +1,84 @@
|
|||
body{
|
||||
background-color: #f2f2f2;
|
||||
font-size:14px;
|
||||
}
|
||||
.md-html{
|
||||
background-color: #FFFFFF;
|
||||
margin-top:30px;
|
||||
box-shadow: 5px 5px 5px 5px #888888;
|
||||
padding:18px;
|
||||
color:#393D49;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
code{
|
||||
font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
|
||||
color: #b94a48;
|
||||
padding: 2px 4px;
|
||||
background: #f3f3f0 none repeat scroll 0 0;
|
||||
margin-left:0.3em;
|
||||
margin-right:0.3em;
|
||||
}
|
||||
.md-html a{
|
||||
color:#01AAED;
|
||||
}
|
||||
.md ul{
|
||||
margin-top:0.5em;
|
||||
margin-bottom:0.5em;
|
||||
}
|
||||
.md-html ul li{
|
||||
list-style-type:square;
|
||||
line-height:1.6em;
|
||||
margin-left:2em;
|
||||
}
|
||||
h1, h2, h3, h4, h5, h6 ,p{
|
||||
color:#393D49;
|
||||
}
|
||||
h1{
|
||||
font-size:2.2em;
|
||||
line-height:2em;
|
||||
|
||||
}
|
||||
h2{
|
||||
font-size:1.8em;
|
||||
line-height:2em;
|
||||
}
|
||||
h3{
|
||||
font-size:1.6em;
|
||||
line-height:2em;
|
||||
}
|
||||
h4{
|
||||
font-size:1.4em;
|
||||
line-height:2em;
|
||||
}
|
||||
.md-html p{
|
||||
line-height:1.6em;
|
||||
}
|
||||
.md-html pre{
|
||||
margin-top:0.5em;
|
||||
margin-bottom:0.5em;
|
||||
}
|
||||
.md-html blockquote{
|
||||
margin-top:1em;
|
||||
font-size:1.2em;
|
||||
background-color: #eeeeee;
|
||||
padding-left:0.6em;
|
||||
padding-right:0.6em;
|
||||
border-left:5px solid #009688;
|
||||
}
|
||||
.md-html blockquote p{
|
||||
line-height:2em;
|
||||
}
|
||||
.md-html img{
|
||||
max-width:100%;
|
||||
margin-top:1em;
|
||||
border:1px solid #ECECEC;
|
||||
border-radius:6px;
|
||||
}
|
||||
.footer{
|
||||
text-align:center;
|
||||
margin-bottom:20px;
|
||||
color:#393D49;
|
||||
}
|
||||
.footer a{
|
||||
color:#01AAED;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh-cmn-Hans" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>MDtoHTML</title>
|
||||
<meta name="generator" content="EverEdit" />
|
||||
<meta name="author" content="" />
|
||||
<meta name="keywords" content="MDtoHTML,markdown" />
|
||||
<meta name="description" content="MDtoHTML快速将Markdown文件转换为HTML" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://cdn.bootcss.com/highlight.js/9.12.0/styles/github.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://libs.xiaoz.top/layui-v2.2.5/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="static/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="container" class = "layui-bg-gray">
|
||||
<div class="layui-container">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-lg8 layui-col-sm12 layui-col-xs12 layui-col-md12 layui-col-md-offset2">
|
||||
<div class="md-html">
|
||||
<?php echo $html; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<p>©2018 本文档使用 <a href="https://markdown.win/" target = "_blank">MDtoHTML</a> 构建 | The author <a href="https://www.xiaoz.me/" target = "_blank" title = "小z博客">xiaoz</a></p>
|
||||
</div>
|
||||
<script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
|
||||
<script>hljs.initHighlightingOnLoad();</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,57 @@
|
|||
### GET方式
|
||||
```php
|
||||
<?php
|
||||
//初始化
|
||||
$ch = curl_init();
|
||||
//设置选项,包括URL
|
||||
curl_setopt($ch, CURLOPT_URL, "http://www.jb51.net");
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
//执行并获取HTML文档内容
|
||||
$output = curl_exec($ch);
|
||||
//释放curl句柄
|
||||
curl_close($ch);
|
||||
//打印获得的数据
|
||||
print_r($output);
|
||||
?>
|
||||
```
|
||||
|
||||
### POST方式
|
||||
```
|
||||
<?php
|
||||
$url = "http://localhost/web_services.php";
|
||||
$post_data = array ("username" => "bob","key" => "12345");
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
// post数据
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
// post的变量
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
//打印获得的数据
|
||||
print_r($output);
|
||||
?>
|
||||
```
|
||||
### HTTPS
|
||||
```
|
||||
<?php
|
||||
$curl = curl_init("https://www.xiaoz.me/");
|
||||
|
||||
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)");
|
||||
curl_setopt($curl, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
$html = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
var_dump($html);
|
||||
?>
|
||||
```
|
||||
|
||||
___
|
||||
|
||||
> 测试是否删除了缓存
|
Loading…
Reference in New Issue