Something that can be solved with one line of code has no business charging a subscription. That was my reaction when I looked at Server酱 Turbo.

I used to rely on Server酱 for daily reports and for telling me whether my Raspberry Pi had started up correctly. The API was convenient, and since I use WeChat all the time, getting a push message there was handy. When Turbo came out, I ignored it because the regular version still worked for me. Then a notice arrived saying the service might go down. I have little patience for unstable services. If you cannot keep a service running reliably, you should not run one at all; people end up depending on it and get burned. I had already dealt with LeanCloud being unreliable, which is why I wrote my own blog counter.

So I looked at Server酱 Turbo. Of course it was paid: ¥8 per month. That felt excessive for something that mostly calls WeChat APIs. I decided to find out how many resources this really takes.

I had seen them boast about 50 million monthly requests. That number is not impressive. A site I work on handles over 100 million requests a month without much cost. Bragging about 50 million—and even selling a course around it—seemed absurd. So I wanted to see how complicated the supposedly 'slightly complex' setup really was.

The one-file version

I read the WeChat test account API docs. It did not look complicated. I guessed it could be done in roughly one line, and tried it in PHP. This is what I ended up with:

<?php
$appid='appID';
$secret='appsecret';
$userid='微信号(OpenID)';
$template_id='模板ID';
$title='标题';
$content='内容';
file_get_contents('https://api.weixin.qq.com/cgi-bin/message/template/send?access_token='.json_decode(file_get_contents('https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$appid.'&secret='.$secret),true)['access_token'], false, stream_context_create(array('http' => array('method'=>'POST','header'=>"Content-Type: application/json;charset=utf-8",'content'=>'{"touser":"'.$userid.'","template_id":"'.$template_id.'","data":{"title": {"value":"'.$title.'"},"content": {"value":"'.$content.'"}}}'))));

I tested it and the result was close to what the Server酱 test account sends, except there is no clickable page. Adding one is easy: just include a URL. If you want more effects, the template API docs show what else you can do.

The limits are better than Server酱's. In theory my code can send 2,000 messages a day, mainly because the access_token endpoint is limited to 2,000 calls per day. If you cache the access_token, the theoretical limit becomes 100,000 sends per day—much better than Server酱's 1,000.

Getting the four parameters

The code is compatible with Server酱, so their setup guide can be followed if you already know it. For anyone who has not used it, the process is simple. Open the application page, scan the QR code to log in, and you will see the test account management page.

The first things shown are appID and appsecret, which gives you two parameters. Scroll down to the test account QR code, scan and follow it with WeChat, and your WeChat ID will appear. It is not your real WeChat ID; it works as an OpenID. That is the third parameter.

Next, find the template message interface and add a test template. The title can be 'push notification' or whatever you like. For the content, use:

{{title.DATA}}
{{content.DATA}}

This keeps it compatible with Server酱. You can change the code and use different fields, or leave the code alone and add a signature at the end, for example:

{{title.DATA}}
{{content.DATA}}
--By Me

Now you have the fourth parameter, the template ID, and the code above should work.

One caveat: for some inexplicable reason, the first appsecret you get after scanning may be wrong. If the code does not work, refresh the test account management page and check whether it has changed. If it has, use the latest appsecret.

Final thoughts

For developers, this kind of small job is worth doing yourself. There is no need to pay people who gate features behind 'sponsorship'. If something is truly sponsorship, there should be no different treatment for paying and non-paying users. Otherwise it is a fee, a commercial transaction. Calling that sponsorship is just dressing up a business model.