我正在尝试使用Slack Custom命令,并且不太确定如何使用延迟消息,因为Yoda Speak External API需要3秒以上的响应时间.
我做了以下事情:
/Yoda在我的情况下发送了slack命令并收到了reponse_url.post对响应URL 使用以下内容.Run Code Online (Sandbox Code Playgroud)$data_string = '{"response_type": "in_channel", "text":"Checking,please wait..."}' ; $chs = curl_init(); curl_setopt($chs, CURLOPT_URL, $response_url); curl_setopt($chs, CURLOPT_POST, true); curl_setopt($chs, CURLOPT_POSTFIELDS, $data_string); curl_setopt($chs, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($chs, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($chs, CURLOPT_RETURNTRANSFER, true); curl_setopt($chs, CURLOPT_POST, 1); curl_setopt($chs, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); $results = curl_exec($chs);
Run Code Online (Sandbox Code Playgroud)$chsres = curl_init(); curl_setopt($chsres, CURLOPT_URL, "https://yoda.p.mashape.com/yoda?sentence=welcome+to+stack"); curl_setopt($chsres, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($chsres, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($chsres, CURLOPT_VERBOSE, true); curl_setopt($chsres, CURLOPT_TIMEOUT, 45); curl_setopt($chsres, CURLOPT_RETURNTRANSFER, true); curl_setopt($chsres, CURLOPT_HTTPHEADER, array('Content-Type:application/json', "X-Mashape-Key:> …
如何找到本月的第2和第4个星期六.我写了这些文字: -
echo "may 2nd sat ".date('d', strtotime('may 2013 second saturday'));
echo '<br/>may 4th sat '.date('d', strtotime('may 2013 fourth saturday'));
echo '<br/>june 2nd sat '.date('d', strtotime('june 2013 second saturday'));
echo '<br/>june 4th sat '.date('d', strtotime('june 2013 fourth saturday'));
Run Code Online (Sandbox Code Playgroud)
它给出了以下输出: -
may 2nd sat 11
may 4th sat 25
june 2nd sat 15
june 4th sat 29
Run Code Online (Sandbox Code Playgroud)
它在may月份给出正确的答案, 但不是june 2013,在jun 1013第二和第四个星期六分别应该是8和22.我怎么能解决这个问题.
我需要在当前时间增加15分钟.例如:现在是 20:48,需要添加15分钟,所以现在它将是21:03,但我需要设置21:15,也就是说,它应该是的倍数15,30,45,00.帮助/指导将有很大帮助.
<?php
$current_date_time = date('d/m/Y H:i:s');
$current_date = date("d/m/Y H:i", strtotime($current_date_time."+15 minutes"));
echo $current_date;exit;
Run Code Online (Sandbox Code Playgroud) 我有一个开发网站https://text-domain.com.(不是真实的网站)当我访问https://duckduckgo.com并搜索text-domain.com时,它会返回结果.
到目前为止我尝试了什么:
robots.txt使用以下代码创建文件(放在我的根目录中,即在text-domain.com/robots.txt中):
User-agent: *
Disallow: /
Run Code Online (Sandbox Code Playgroud)
然后在我的模板文件中添加了这样的元标记:
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
Run Code Online (Sandbox Code Playgroud)
即便在这样做之后,我搜索了DuckDuckGo并得出了相同的结果.欢迎大家提出意见.
PS
嗨,等了几天后有2个发现:
但是我看到一条消息说:"我们想在这里向您展示一个描述,但该网站不允许我们."
是否有可能完全阻止在结果中显示?
php ×3
datetime ×2
curl ×1
duckduckgo ×1
php-5.4 ×1
robot ×1
robots.txt ×1
slack ×1
slack-api ×1
timeout ×1
web-crawler ×1