Jump to content
  • Hello visitors, welcome to the Hacker World Forum!

    Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

    TheHackerWorld Official

Recommended Posts

最近抖音上面给女盆友送早安问候的视频比较火。作为大表哥应该以身作则。通过简单的配置让你的女盆友也能收到早安问候是我义不容辞的责任。

1514748220.png

配置

首先访问下面连接,用你的微信扫码授权登录!
https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login
1311295371.png
记录得到的appIDappsecret值!
317492387.png
接着往下翻,新增测试模板。
添加模板标题和模板内容

{{first.DATA}}
今天天气:{{keyword1.DATA}}
今天温度:{{keyword2.DATA}}
我们已经恋爱了:{{keyword3.DATA}}
距离小宝生日还有:{{keyword4.DATA}}
{{remark.DATA}}

3463328047.png
添加完成后,记录模板ID
然后让女朋友关注测试公众号,获取到微信号并记录。
1134085322.png

获取天气接口

访问下面连接http://www.tianqiapi.com/
注册并登录,获取appidappsecret并记录,测试当地城市天气信息。
API接口如下:

https://www.yiketianqi.com/free/day?appid=你的id&appsecret=你的值&unescape=1&city=%E5%85%B0%E5%B7%9E

获取甜言蜜语接口

访问www.alapi.cn,注册并登录。获取Token并记录。
API接口如下:

https://v2.alapi.cn/api/qinghua?token=你的值

配置PHP

<?php

$appId = '1'; //对应自己的appId
$appSecret = '2'; //对应自己的appSecret
$wxgzhurl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $appId . "&secret=" . $appSecret;
$access_token_Arr = https_request($wxgzhurl);
$access_token = json_decode($access_token_Arr, true);
$ACCESS_TOKEN = $access_token['access_token']; //ACCESS_TOKEN


// 什么时候恋爱的(格式别错)
$lovestart = strtotime('2022-08-01');
$end = time();
$love = ceil(($end - $lovestart) / 86400);

// 下一个生日是哪一天(格式别错)
$birthdaystart = strtotime('2023-01-25');
$end = time();
$diff_days = ($birthdaystart - $end);
$birthday = (int)($diff_days/86400);
$birthday = str_replace("-", "", $birthday);


$tianqiurl = 'https://www.yiketianqi.com/free/day?appid=95943915&appsecret=5KNSKu9y&unescape=1&city=武汉'; //修改为自己的
$tianqiapi = https_request($tianqiurl);
$tianqi = json_decode($tianqiapi, true);

$qinghuaqiurl = 'https://v2.alapi.cn/api/qinghua?token=BFlSa9Ny7qTZHwYk'; //修改为自己的
$qinghuaapi = https_request($qinghuaqiurl);
$qinghua = json_decode($qinghuaapi, true);


// 你自己的一句话
$yjh = ''; //可以留空 也可以写上一句

$touser = 'oOBhas1F-h6rP9DxsTZGCP7xgjeQ';  //这个填你女朋友的openid
$data = array(
    'touser' => $touser,
    'template_id' => "ujSRYGrQep4A8o0JCyW4pdy5cZ0YXrT6QXwMZC5tAf11111111110", //改成自己的模板id,在微信后台模板消息里查看
    'data' => array(
        'first' => array(
            'value' => "$yjh",
            'color' => "#000"
        ),
        'keyword1' => array(
            'value' => $tianqi['wea'],
            'color' => "#000"
        ),
        'keyword2' => array(
            'value' => $tianqi['tem_day'],
            'color' => "#000"
        ),
        'keyword3' => array(
            'value' => $love . '天',
            'color' => "#000"
        ),
        'keyword4' => array(
            'value' => $birthday . '天',
            'color' => "#000"
        ),
        'remark' => array(
            'value' => $qinghua['data']['content'],
            'color' => "#f00"
        ),
    )
);

// 下面这些就不需要动了————————————————————————————————————————————————————————————————————————————————————————————
$json_data = json_encode($data);
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" . $ACCESS_TOKEN;
$res = https_request($url, urldecode($json_data));
$res = json_decode($res, true);

if ($res['errcode'] == 0 && $res['errcode'] == "ok") {
    echo "发送成功!<br/>";
}else {
        echo "发送失败!请检查代码!!!<br/>";
}
function https_request($url, $data = null)
{
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
    if (!empty($data)) {
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
    }
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $output = curl_exec($curl);
    curl_close($curl);
    return $output;
}

修改php文件后,上传到本地服务器或者远程服务器,测试链接!如果提示发送成功则配置完成!

添加定时任务

要想女朋友早上醒来,收到的第一条消息就是来自你的问候。你必须设置定时任务。
命令如下:

00 08 * * * /usr/bin/curl https://bbskali.cn/love.php

即每天的8:00访问https://bbskali.cn/love.php

这样便完成了,每日对女盆友的关怀!

效果

2544660081.png


版权属于:逍遥子大表哥

本文链接:https://blog.bbskali.cn/3658.html

按照知识共享署名-非商业性使用 4.0 国际协议进行许可,转载引用文章应遵循相同协议。

Link to post
Link to comment
Share on other sites

 Share

discussion group

discussion group

    You don't have permission to chat.
    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...