Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: 添加网站文章更新订阅功能,给注册用户通知文章更新功能! || [Feature]: Add website article update subscription function to notify registered users of article update function! #2580

Open
appotry opened this issue Jun 23, 2024 · 2 comments
Labels
discussion Question or dicussion enhancement New feature or request Inactive

Comments

@appotry
Copy link

appotry commented Jun 23, 2024

功能概述 | Describe the feature

为什么要添加这个功能

  • 这是一个非常实用的功能,增加网站用户粘性
  • 已有的留言邮件通知功能和文章更新通知功能 重合度非常高。稍加改动即可完成这个文章通知功能

如何设计实现

  • 在 waline 后台用户界面添加一个选项,是否订阅最新文章,默认勾选

  • waline 后台添加api ,数据格式可以参考 下面 google push 的json格式,在网站文章更新的时候调用api来邮件通知waline注册用户

  • 有了waline 后台api,就可以稍加改进,就把hexo-web-push-notification 插件改为waline通知插件

  • 可以使用邮件订阅,也可以使用其它电报,微信等通知服务

google push 的json格式

下面是hexo 插件 hexo-web-push-notification 生成的json 通知文件

可以参考这个json文件格式定义来实现本地或者云端文章更新通知功能

newPost.json

{"title":"如何防止密码泄露,保护密码安全?","id":"posts/1d87ed2/","date_published":"05/31/2024","summary":"背景\n\n密码安全:现代数字生活的必需品\n\n ...","url":"https://blog.17lai.site/posts/1d87ed2/","tags":["安全","web","密码","bitwarden"],"categories":["web"]}

Feature Overview | Describe the feature

Why add this feature?

  • This is a very practical function that increases the user stickiness of the website
  • The existing message email notification function and article update notification function have a high degree of overlap. This article notification function can be completed with slight modifications

How to design and implement

  • Add an option to the waline backend user interface, whether to subscribe to the latest articles, checked by default

  • Waline adds API in the background. For data format, please refer to the json format of google push below. When website articles are updated, the API is called to notify registered users of waline by email.

  • With the waline backend api, you can make a slight improvement and change the hexo-web-push-notification plug-in to the waline notification plug-in

  • You can subscribe by email or other notification services such as Telegram and WeChat

json format of google push

The following is the json notification file generated by the hexo plug-in hexo-web-push-notification

You can refer to this json file format definition to implement the local or cloud article update notification function

newPost.json

{"title":"How to prevent password leakage and protect password security?","id":"posts/1d87ed2/","date_published":"05/31/2024","summary":"Background\n\n Password security: a necessity for modern digital life\n\n ...","url":"https://blog.17lai.site/posts/1d87ed2/","tags":["security","web" ,"password","bitwarden"],"categories":["web"]}
@appotry appotry added discussion Question or dicussion enhancement New feature or request labels Jun 23, 2024
@github-actions github-actions bot changed the title [Feature]: 添加网站文章更新订阅功能,给注册用户通知文章更新功能! [Feature]: 添加网站文章更新订阅功能,给注册用户通知文章更新功能! || [Feature]: Add website article update subscription function to notify registered users of article update function! Jun 23, 2024
@CCKNBC
Copy link

CCKNBC commented Jun 30, 2024

事实上,由于 Waline 本身插件化的功能实现,一些功能你甚至可以自定义(而对于单独推送文章更新这件事,我认为 Webpush 的时效性,以及转换率,比邮件或者其他三方通知高,用户只需要点击允许通知权限即可,开机有网就会收到推送。

个人认为其实可以结合 follow.it 等第三方服务 API 让用户选取是否接收通知,甚至于说独立出来,发布月报,给评论区挂个插件

用户可能只是因为注册了一下需要发布评论而已, Waline 是否有必要去做文章更新通知这个功能

Webpush 对于个人站长来说足够好用了,比如评论通知,我可以在用户发布评论后立即收到回复,以及发布文章更新的时候推送更新,以及分类订阅 https://blog.ccknbc.cc/posts/hexo-webpushr-notification/

个人看法,具体考量还得看开发者如何决策 https://blog.ccknbc.cc/sub/


In fact, due to the plug-in function implementation of Waline itself, you can even customize some functions (as for pushing article updates individually, I think Webpush’s timeliness and conversion rate are higher than email or other third-party notifications. Users Just click to allow notification permission, and you will receive the push when you turn on the phone and have an internet connection.

Personally, I think it can actually be combined with third-party service APIs such as follow.it to allow users to choose whether to receive notifications, or even become independent, publish monthly reports, and hang a plug-in for the comment area.

Users may just need to post comments because they have registered. Is it necessary for Waline to implement the article update notification function?

Webpush is easy enough for individual webmasters, such as comment notifications. I can receive replies immediately after users post comments, push updates when articles are updated, and category subscriptions https://blog.ccknbc.cc/ posts/hexo-webpushr-notification/

Personal opinion, specific considerations depend on how developers make decisions https://blog.ccknbc.cc/sub/

@appotry
Copy link
Author

appotry commented Jul 1, 2024

@CCKNBC Webpush 当然是好用的,但有个严重问题是webpush 的几个域名都被gfw屏蔽了,国内用户享受不到。
邮件订阅是webpush不可用的下位替代,作为下位替代还是合格的

个人博客使用pwa劫持本地webpush域名到代理地址,网页刷新三次才显示webpush消息,可以测试是否可用


@CCKNBC Webpush is certainly easy to use, but there is a serious problem. Several domain names of webpush have been blocked by gfw, and domestic users cannot enjoy it.
Email subscription is a lower-level alternative to webpush that is not available. It is still qualified as a lower-level alternative.

My personal blog uses pwa to hijack the local webpush domain name to the proxy address. The webpush message is displayed after the webpage is refreshed three times. You can test whether it is available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Question or dicussion enhancement New feature or request Inactive
Projects
None yet
Development

No branches or pull requests

2 participants