基于Tasker的Bark推送端

Bark是一个简约好用的推送App。

下面这些Tasker任务可以从通知栏磁贴、文本选择菜单、分享菜单等等入口运行,帮你把剪贴板中或是传入的文本推送到Bark App。

本系列帖子导航:


1. 获取Push URL

iOS或者Android安装Bark,在App的主界面,可以看到形如 https://api.day.app/xxxxxxxxxx/ 的Push URL,记录下来

2.导入Tasker任务和profile

导入后要把https://api.day.app/xxxxxxxxxxxx/修改成自己的Bark Push URL

2-1 通知栏磁贴或者桌面图标

点我导入或者按照下方的描述手动创建一个Tasker任务

    Enter: Bark
    	A1: Status Bar [ Set:Collapsed ] 
    	A2: Variable Set [ Name:%clipboard To:%CLIP Recurse Variables:Off Do Maths:Off Append:Off Max Rounding Digits:3 ] 
    	A3: Variable Search Replace [ Variable:%clipboard Search:(http(s)?:\/\/)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?[-a-zA-Z0-9()@:%_\\\+\.~#?&//=]* Ignore Case:Off Multi-Line:Off One Match Only:On Store Matches In Array:%url Replace Matches:Off Replace With: Continue Task After Error:On ] 
    	A4: If [ %url1 Set ]
    	A5: HTTP Request [  Method:HEAD URL:https://api.day.app/xxxxxxxxxxxxxxxxxxxxxxxxxx/%e4%bb%8eAndroid%e7%bb%a7%e7%bb%ad?url=%url1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off ] 
    	A6: Else 
    	A7: HTTP Request [  Method:HEAD URL:https://api.day.app/xxxxxxxxxxxxxxxxxxxxxxxxxx/%CLIP?automaticallyCopy=1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off ] 
    	A8: End If 
    	A9: Flash [ Text:Pushed to Bark Long:Off ]  If [ %http_response_code ~ 200 ]

2-2 选中文本(需要AutoShare

点我导入或者按照下方的描述手动创建一个Tasker任务

    Profile: Push Text to Bark
    	Restore: no
    	Event: AutoShare Process Text [ Configuration:Text Processor: Tasker ]
    Enter: Push to Bark
    	A1: Variable Search Replace [ Variable:%astext Search:(http(s)?:\/\/)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?[-a-zA-Z0-9()@:%_\\\+\.~#?&//=]* Ignore Case:Off Multi-Line:Off One Match Only:On Store Matches In Array:%url Replace Matches:Off Replace With: Continue Task After Error:On ] 
    	A2: If [ %url1 Set ]
    	<修改成自己的Push URL>
    	A3: HTTP Request [  Method:HEAD URL:https://api.day.app/xxxxxxxxxxxx/%e4%bb%8eAndroid%e7%bb%a7%e7%bb%ad?url=%url1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off Continue Task After Error:On ] 
    	A4: Else 
    	<修改成自己的Push URL>
    	A5: HTTP Request [  Method:HEAD URL:https://api.day.app/xxxxxxxxxxxx/%astext?automaticallyCopy=1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off Continue Task After Error:On ] 
    	A6: End If 
    	A7: If [ %http_response_code ~ 200 ]
    	A8: Flash [ Text:Pushed to Bark Long:Off ] 
    	A9: Else 
    	A10: Flash [ Text:Failed to Push Long:Off ] 
    	A11: End If 

2-3 分享文本(需要AutoShare

点我导入或者按照下方的描述手动创建一个Tasker任务

    Profile: Share to Bark (21)
    	Restore: no
    	Event: AutoShare [ Configuration:Command: all
    Sender: all
    Subject: all
    Text: all
    File: all ]
    Enter: Push to Bark (51)
    	A1: Variable Search Replace [ Variable:%astext Search:(http(s)?:\/\/)?[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+(:[0-9]{1,5})?[-a-zA-Z0-9()@:%_\\\+\.~#?&//=]* Ignore Case:Off Multi-Line:Off One Match Only:On Store Matches In Array:%url Replace Matches:Off Replace With: Continue Task After Error:On ] 
    	A2: If [ %url1 Set ]
    	<修改成自己的Push URL>
    	A3: HTTP Request [  Method:HEAD URL:https://api.day.app/xxxxxxxxxxxx/%e4%bb%8eAndroid%e7%bb%a7%e7%bb%ad?url=%url1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off Continue Task After Error:On ] 
    	A4: Else 
    	<修改成自己的Push URL>
    	A5: HTTP Request [  Method:HEAD URL:https://api.day.app/xxxxxxxxxxxx/%astext?automaticallyCopy=1 Headers: Query Parameters: Body: File To Send: File/Directory To Save With Output: Timeout (Seconds):10 Trust Any Certificate:Off Automatically Follow Redirects:Off Use Cookies:Off Continue Task After Error:On ] 
    	A6: End If 
    	A7: If [ %http_response_code ~ 200 ]
    	A8: Flash [ Text:Pushed to Bark Long:Off ] 
    	A9: Else 
    	A10: Flash [ Text:Failed to Push Long:Off ] 
    	A11: End If 
1 Like

push lite介绍页面写了需要fcm,fcm需要Google服务…你懂的。所以约等于没法正常玩?

推荐一个服务「Server酱」 可以把消息推送到微信 如果内容比较少并且不涉及隐私可以试试

可以默认能用Tasker的人就能用Google服务吧

(不过我用Bark主要是从安卓往iPhone推文本,也没装Push Lite……

其实这就是个需求问题了 我的需求只是知道发生了特定事件(有空的显卡了) 只要看到微信通知就能及时处理了 没必要真的点开公众号 要这么监控的事件肯定比朋友圈啥的重要 :joy:

用IM接收推送有点太重了,复制消息还要进入App一通点点点,甚至有时要从退出朋友圈开始点,有时要从退出公众号开始点,每次点点点的顺序还不完全一样,连肌肉记忆都没办法形成 :joy:

我也用过server酱,忽然想到类似的奇技淫巧了。通过发送邮件的方式,可以绕过服务器稳定性和隐私的顾虑。接收端可以用qq邮箱,直接用qq/微信就能收到提醒。发送端需要打通破pop3协议有点费事。

邮箱我也用过 当时是用python的email库 除了账号密码要明文写在代码里面有些糟糕外没啥难度 不过邮箱的时效性感觉不太稳 邮箱客户端有收信间隔 qq邮箱也可能收不到邮件。。。。

实时可以用Exchange或者Gmail啊

用qq邮箱给qq邮箱发信速度还很OK的。我只搞过用php做发信