-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathShindanMaker.php
More file actions
48 lines (40 loc) · 1.83 KB
/
ShindanMaker.php
File metadata and controls
48 lines (40 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace plugin;
use phqagent\plugin\PluginBase;
use phqagent\message\Message;
use phqagent\console\MainLogger;
use phqagent\utils\Curl;
class ShindanMaker extends PluginBase{
public function onLoad(){
MainLogger::info('ShindanMaker外部引用插件已加载!');
}
private function getshindan($id, $nickname){
$curl = new Curl();
$html = $curl->setUrl("https://cn.shindanmaker.com/$id")->
setEncPost([
'u' => $nickname,
])->exec();
$a = explode('<div class="result2">', $html);
$b = explode('</div>', $a[1]);
$rs = str_replace(' ', ' ', strip_tags($b[0]));
$rs = str_replace("\n\n", "\n", $rs);
return $rs;
}
public function onMessageReceive(Message $message){
if(strstr($message->getContent(), '我的二次元美少女形象')){
$rs = $this->getshindan(162207, $message->getUser()->getCard());
MainLogger::info($message->getUser()->getCard(). ' 进行了 我的二次元美少女形象 测试');
new Message($message, "$rs\n\n本外部数据由 ShindanMaker 提供", true);
}
if(strstr($message->getContent(), '今日关键词')){
$rs = $this->getshindan(384482, $message->getUser()->getCard());
MainLogger::info($message->getUser()->getCard(). ' 进行了 今日关键词 测试');
new Message($message, "$rs\n\n本外部数据由 ShindanMaker 提供", true);
}
if(strstr($message->getContent(), '娘化穿越到异世界')){
$rs = $this->getshindan(635902, $message->getUser()->getCard());
MainLogger::info($message->getUser()->getCard(). ' 进行了 娘化穿越到异世界 测试');
new Message($message, "$rs\n\n本外部数据由 ShindanMaker 提供", true);
}
}
}