Original link: https://5ime.cn/doyoulikeme.html
Someone should have noticed that the blogger added a Do You Like Me
widget to the sidebar. In fact, I think the easier way is to use PHP+SQL+AJAX
, but in the idea of tossing + reducing costs (white prostitution) , using Vercel
, LeandCloud
and Node.JS
to roll one out.
Node version
Since Node.Js
is in a semi-entry state, the code quality is not high, but the program runs in a strange way after all.
Project address: https://github.com/5ime/likeMe
PHP version
Since I am hosted by vercel
do not have permission to创建
or修改
files, I will request LeanCloud
every time I get the number of like
, resulting in a high number of requests, so I created a PHP
version and wrote the number of like
into the count.dat
file. , read count.dat
when requested and update count.dat
after clicking. The following code can be uploaded to your own server.
composer
install dependencies
1 |
|
The specific code is as follows, please refer to https://github.com/5ime/likeMe/参数获取
and组件调用
1 |
|
This article is reprinted from: https://5ime.cn/doyoulikeme.html
This site is for inclusion only, and the copyright belongs to the original author.