Skip to content

Commit

Permalink
修改readme,添加example目录
Browse files Browse the repository at this point in the history
  • Loading branch information
easychen committed Feb 22, 2022
1 parent 9114bc6 commit 7677c81
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
PushDeer是一个可以自行架设的无APP推送服务。

当前状态:API、iOS、Android和Mac第一版已完成,快应用正在开发🚧

**🔥 全新子项目 DeerESP 推送消息到自制设备**
PushDeer是一个可以自行架设的无APP推送服务,同时也为因为某些原因无法使用无APP推送方案的同学提供有APP/自制设备方案。

[🐙🐱 GitHub仓库](https://github.com/easychen/pushdeer) [🔮 中国大陆镜像仓库@Gitee](https://gitee.com/easychen/pushdeer)

本项目已经实现的方案/端包括:

||||
|-|-|-|
|[👨🏻‍🏫 教程](iot/README.md)|[⌨️ 源码](iot/deeresp/)|[📼 演示视频,可以听到提示音♪](https://weibo.com/1088413295/LfUwivPoh)|
- 无APP方案:
- 轻APP(APP Clip)
- 快应用
- 有APP方案:
- iOS客户端
- Mac客户端
- Android客户端
- 自制设备方案:
- DeerESP(ESP8266/ESP32)

![](iot/image/deeresp.gif)

👉[点此查看如何将消息推送到成本35元左右的自制设备上](iot/README.md)
👉[点此查看如何将PushDeer消息推送到成本不到40元的自制设备上](iot/README.md)

---

[🐙🐱 GitHub仓库](https://github.com/easychen/pushdeer) [🔮 中国大陆镜像仓库@Gitee](https://gitee.com/easychen/pushdeer)

|登入|设备|Key|消息|设置|
|-|-|-|-|-|
|![](doc/design_and_resource/登入.png)|![](doc/design_and_resource/设备.png)|![](doc/design_and_resource/key.png)|![](doc/design_and_resource/消息.png)|![](doc/design_and_resource/设置.png)
Expand Down
20 changes: 20 additions & 0 deletions examples/demo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

// 调用函数
function pushdeer_send($text, $desp = '', $type='text', $key = '[PUSHKEY]')
{
$postdata = http_build_query(array( 'text' => $text, 'desp' => $desp, 'type' => $type , 'pushkey' => $key ));
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata));

$context = stream_context_create($opts);
return $result = file_get_contents('https://api2.pushdeer.com/message/push', false, $context);
}



// 使用实例
print_r(pushdeer_send('服务器又宕机了主人', '', 'text', 'PDU...'));

0 comments on commit 7677c81

Please sign in to comment.