A blog like plugin
Project description
OrLike
使用LeanCloud, 部署在vercel的博客点赞插件, 保障安全.
当前功能:
- 分离APPID/APPKEY, 保护账号安全
- 使用随机用户ID, 不保存用户其他信息, 保障用户隐私
- 支持设置用户过期时间
- 支持取消点赞/踩
- 将orlike发布为pipy包, 方便自动升级
Deployment
在这里可以将OrLike部署到你的Vercel账户上.
Usage
在你期望嵌入OrLike
的页面加入以下链接:
<script src="https://cdn.jsdelivr.net/gh/caibingcheng/orlike@master/orlike.js"></script>
当然, 也可以使用自己的CDN. 本项目也依赖JQuery, 所以别忘记引用JQuery:
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
接下来, 在你期望嵌入OrLike
的位置加上一个div
标签, 并且加上class
或者id
:
<div class="orlike-box"></div>
然后在合适的地方初始化OrLike
:
<script>
new OrLike({ serverUrl: "http://orlike-caibingcheng.vercel.app/", el: ".orlike-box" });
</script>
目前初始化需要的参数:
serverUrl
: Vercel服务地址el
: 放orlike
的div
名字(class
或id
)days
: 用户id保存的时间, 默认是30天
到此为止, 本地工作已经做完了, 现在需要创建LeanCloud账户, 可以参考Valine的配置方法.
创建账户并且新建应用之后, 需要给应用添加一个名为OrLike
的class, 并且设置读写权限为所有用户, 然后再拿到LeanCloud的APP ID
和 APP Key
填入到Vercel的环境变量.
APPID
对应APP ID
APPKEY
对应APP Key
然后部署OrLike就可以正常工作了.
Todo & Contributes
项目初期, 还有很多想象空间, 加油↖(^ω^)↗
- 提供点赞/踩排名
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
orlike-0.1.2.tar.gz
(7.3 kB
view hashes)
Built Distribution
orlike-0.1.2-py3-none-any.whl
(5.6 kB
view hashes)