OrLike
使用LeanCloud, 部署在vercel的博客点赞插件, 保障安全.
当前功能:
- 分离APPID/APPKEY, 保护账号安全
- 使用随机用户ID, 不保存用户其他信息, 保障用户隐私
- 支持设置用户过期时间
- 支持取消点赞/踩
- 将orlike发布为pipy包, 方便自动升级
- 加载动画
- 自定义图标和CDN
Branch
- server: server端代码
- client: client端代码
- master: demo
Deployment
在这里可以将OrLike部署到你的Vercel账户上.
我们更推荐使用这个零配置的例子.
Usage
在你期望嵌入OrLike的页面加入以下链接:
<script src="https://cdn.jsdelivr.net/gh/caibingcheng/orlike@client/orlike.min.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: "https://orlike.vercel.app/",
el: ".orlike-box",
days: 30,
icon: {like: "fa fa-heart", dislike: false},
style: "https://cdn.jsdelivr.net/gh/caibingcheng/orlike@client/orlike.min.css",
});
</script>
尽管可以使用公共的serverUrl, 但是更推荐使用私有的serverUrl, 这样更容易保证数据安全.
目前初始化需要的参数:
serverUrl: 必填, Vercel服务地址el: 必填, 放orlike的div名字(class或id)days: 可选, 用户id保存的时间, 默认是30天icon: 可选, 自定义点赞和踩的图标, 不填写这是默认, 如果是false, 则不显示对应的按扭style: 可选, 可自定义样式, 如果不填写, 则使用默认CDNifont: 可选, 可自定义font-awesome CDN, 如果不填写, 则使用默认CDN
到此为止, 本地工作已经做完了, 现在需要创建LeanCloud账户, 可以参考Valine的配置方法.
创建账户并且新建应用之后, 需要给应用添加一个名为OrLike的class, 并且设置读写权限为所有用户, 然后再拿到LeanCloud的APP ID 和 APP Key填入到Vercel的环境变量.
APPID对应APP IDAPPKEY对应APP Key
然后部署OrLike就可以正常工作了.
Todo & Contributes
项目初期, 还有很多想象空间, 加油↖(^ω^)↗
- 提供点赞/踩排名
Metadata
Release files for orlike 0.1.38
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| orlike-0.1.38.tar.gz | 8.0 kB | Without provenance | Details for orlike-0.1.38.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| orlike-0.1.38-py3-none-any.whl | Python 3 | none | any | Details for orlike-0.1.38-py3-none-any.whl |
Total release size: 14.2 kB
Release files / orlike-0.1.38.tar.gz
| Download URL | orlike-0.1.38.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8bfb0325c6734e2e5c42df3b3ec409cfd089ac09ae509ad9ff45bc7e07a46cab
|
|
BLAKE2b-256 checksum How to use checksums |
cbfe630fb460992b8b8f3689bcabbe5411d534fb262d1484929f01d7c3a0cf46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
|
Release files / orlike-0.1.38-py3-none-any.whl
| Download URL | orlike-0.1.38-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c0d8687a5d27ac25df38152f23bd414b2531fd122314e7328b6b256d11fdf0af
|
|
BLAKE2b-256 checksum How to use checksums |
a0f1b70347f566c8055f7e4d5c75022e67423d9be526e65ab5796d04b3325225
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.15
|
Security for orlike 0.1.38
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.