Check sauce is a general web content monitoring tool that can monitor web content changes and send changes to WeChat
Microsoft Edge | Google Chrome |
---|---|
Click the icon above to enter the store page or search for "Check Sauce" directly in the store
Detailed version, nearly 2 hours
For the Docker image installation command, please refer to the cloud installation section later.
Check Sauce is a web content monitoring tool produced by Sugar Cube Balloon. It includes an Edge/Chrome browser plug-in and a cloud that can be set up by yourself.
Based on a browser plug-in, it can theoretically monitor any content (text) on the web page through a visual selector . In addition to browser notifications, it can also cooperate with Server Sauce to push changes to WeChat or mobile phones.
The principle of Check sauce is to open web pages in the background through browser plug-ins for monitoring, thereby completely simulating the real behavior of users . It can monitor most complex dynamic web pages, various background pages that require login, and (in most cases) ) automatically continues the login state.
In addition to supporting the monitoring of web page content (Dom), it also supports HTTP status (monitoring through GET), JSON and RSS methods.
With the cloud that can be set up by yourself, the monitoring tasks can be synchronized to the server, so that when the browser and computer are closed, the monitoring tasks can still run regularly.
The plug-in can be used independently, but the scheduled monitoring task will not be executed after it is turned off.
Currently, Check Sauce is in internal testing and has not yet been put on the Edge store. It can only be loaded manually.
Download the plug-in ZIP package (Github download address, no registration required) and unzip it into a directory (hereinafter referred to as A).
Open the Edge plug-in page, open "Developer Mode", click "Load Unpacked", and select the directory A extracted above.
If loaded successfully, you can see the Check sauce interface. If it fails, it is usually caused by an extra directory when decompressing. You can try to reselect the directory below the A directory.
After installing the plug-in, open the webpage you want to monitor, right-click on the webpage, and you will see the "Locate Monitoring Object" item.
After clicking, the visual selector starts to be initialized.
Move the mouse to see the highlighted area, place it on the text to be monitored and click the left mouse button.
Note that the selection area must contain text, otherwise empty will be returned. There is a lot of text printed on the image, which will also return null.
You will be forwarded to the add page.
You can modify the name, set the monitoring interval, delay, and maximum number of retries. Before saving, it is best to click the测试
button after CSS选择器路径
column to test it.
If it prompts "The detection content is empty", it means there is a problem. Click again to observe:
If you find that the page is closed without the favicon coming out after it is opened, you can increase the number of seconds of "delayed reading"; if it still returns empty after opening, then the automatically generated selector path just now may be incorrect.
You can replace it with one automatically generated by the browser, as follows:
① Right-click on the text to be inspected and select "inspect/inspect element"
② At this time, the developer tools will automatically open and the corresponding line of the element in the source code will be automatically selected. Right-click on the highlighted line and select "Copy" → "Copy selector"
③ Enter the copied path to the clipboard into the "CSS Selector Path" line, and click the "Test" button again to test.
After the test passes, click "Submit" to save the monitoring points.
When adding and modifying monitoring points, fill in the Sendkey to push the message to the Server.
Log in to the Server Sauce official website, enter "Key&API", and click the "Copy" button.
Log in to the official website of Server Sauce, enter "Channel Configuration", select the channel to be pushed, and configure it according to the instructions on the page. Messages can be pushed to "PushDeer" and various group robots.
If the above channels cannot meet your needs, you can select the "custom" channel and send a customized http request. This method is compatible with most notification interfaces.
Click the up and down arrows on the upper right side of the monitoring point list to import and export all monitoring points.
Click "Clipboard" in the monitoring point list to export the settings of the current monitoring point to the clipboard.
Export data looks like this:
checkchan://title=Server%E9%85%B1%E5%AE%98%E6%96%B9%E7%BD%91%E7%AB%99%E7%8A%B6%E6%80%81&url=https%3A%2F%2Fsct.ftqq.com&type=get&code=200&rss_field=title&delay=3&retry=10
After copying the above characters, paste them through Ctrl+V in the Check browser plug-in interface, and it will automatically recognize and jump to the "Add Monitoring Point" interface.
Some tasks only need to be executed during a specific time period. In order to save resources, we have added a "monitoring cycle limit" function. For example, if an animation is updated every Friday at 10 am, then we can set the "monitoring cycle limit" as follows:
In this way, monitoring will no longer be started in other time periods. For tasks with unpredictable event periods, just use the default "every minute".
Note that on top of the "monitoring cycle limit", there is also a "monitoring interval".
If the "Monitoring Period Limit" is every minute and the "Monitoring Interval" is 60 minutes, then monitoring will be attempted every minute, and once the monitoring is successful, the next monitoring will be 60 minutes later.
At the same time, because executing the monitoring task itself takes time, when the "monitoring interval" is 1 minute, the task will usually only be run every one minute (that is, every two minutes).
The latest version supports a Selector extension syntax: since the underlying layer is implemented through document.querySelectorAll
, all matching elements will be returned in an array. When these elements belong to the same parent node, we can use :nth-of-type(1)
or :nth-child(1)
to specify an item in the array.
But if these elements do not belong to the same parent node, then the above method will fail. A selector@n syntax is added here, allowing us to specify an element from the array returned by Selector. For example, .booklist .item@0
will return document.querySelectorAll(.booklist .item)[0]
.
In addition to being used on DOM selectors, the @ syntax can also be used to specify RSS monitoring results. By default, RSS will return the first article of the entire feed. You can add @1 after the feed url to specify it to monitor the second article (counting still starts from 0).
The lowest level of Selector returns an element, but sometimes we need to monitor a certain attribute value of this element. For example, monitor href
of a link. In order to solve this problem, we extended the selector syntax to allow users to obtain an attribute value of an element through element%attribute. For example: article#post-180 > div > div > p > a%href
. When %
and @
are used at the same time, %
should follow the element, such as: article#post-180 > div > div > p > a%href@0
.
In order to have a clearer understanding of the execution of scheduled tasks, you can open "Developer Tools" (F12) and see the logs generated by the tasks in Console
tab.
Error information will also be displayed in red highlighted lines here. When encountering a bug, providing log error screenshots can help us locate the problem faster.
After being put on the store, it can be automatically upgraded. Before that, manual upgrade is required. The upgrade method is to download the zip package, unzip it, overwrite the original file, and then "reload" it in the browser's plug-in management panel.
The new version of the image has integrated the cloud and remote desktop versions, and can be used with only one installation.
️ Special note: Because the network and environment of the cloud are different from those of the local machine, there is no guarantee that tasks that can be run by the local machine will be successfully run in the cloud. Some complex web pages and web pages with more dynamic effects may fail.
Setting up a self-installed version of the cloud requires technical foundation. Non-technical users are recommended to purchase our official version of the cloud (will be released after the internal testing is completed)
Requires docker environment. If you don’t have a cloud server, you can check out Tencent Cloud’s special price servers for 30 to 50 yuan for the first order.
Click here to enter the tool interface
Log in to the server (assuming its IP is IPB), create a new directory data
under the directory to be installed, and make it writable:
mkdir data && chmod 0755 data
Create a new docker-compose.yml
file, adjust the following content as prompted, paste and save:
version : ' 3 '
services :
chrome :
image : easychen/checkchan:latest
volumes :
- " ./data:/checkchan/data "
environment :
- " CKC_PASSWD=<这里是远程桌面的密码,写一个你自己想的> "
- " VDEBUG=OFF "
- " VNC=ON "
# - "WIN_WIDTH=414"
# - "WIN_HEIGHT=896"
# - "XVFB_WHD=500x896x16"
- " API_KEY=<这里是云端的API KEY,写一个你自己想的> "
- " ERROR_IMAGE=NORMAL " # NONE,NORMAL,FULL
# - "SNAP_URL_BASE=<开启截图在这里写服务器地址(结尾不用加/),不开留空>..."
# - "SNAP_FULL=1"
- " TZ=Asia/Chongqing "
# - "WEBHOOK_URL=http://..." # 云端 Webhook地址,不需要则不用设置
# - "WEBHOOK_FORMAT=json" # 云端 Webhook POST 编码,默认是 Form
ports :
- " 5900:5900 "
- " 8080:8080 "
- " 8088:80 "
Replace <这里是远程桌面的密码,写一个你自己想的>
and <这里是云端的API KEY,写一个你自己想的>
with passwords that others do not know (hereinafter referred to as passwords C and D). Be careful not to include the $
character, and there will be no more surrounding angle brackets <>
after replacement.
If you do not want to start remote desktop, please change VNC=ON
to VNC=OFF
.
Ensure that the Docker user has write permissions to this directory and run the following command in the same directory:
docker-compose up -d
If it prompts that the docker service is not installed/not found/not started, you can add sudo before docker-compose and try again.
After waiting for the initialization to complete, visit http://$BBB:8080
(replace $BBB with IP B). When you see the NoVNC Web interface, it means that the container has been started.
The port where the service is located is:
You can also pass the parameters in docker-compose
to docker to start:
docker run -d -p 8088:80 -p 8080:8080 -p 5900:5900 -v ${PWD} /data:/checkchan/data -e API_KEY=123 -e VDEBUG=OFF -e VNC=ON -e SNAP_URL_BASE=http://localhost:8088 -e CKC_PASSWD=123 -e TZ=Asia/Chongqing easychen/checkchan:latest
Please replace 123 in the above command with the password you want to set, and replace SNAP_URL_BASE
with the external IP of the server (if you want to view the screenshot on your mobile phone).
Only Synology models that support Docker can install Check Sauce. In addition to installing it directly through the command line, you can also refer to the GUI installation tutorial.
Volume
and environment variables can refer to the above docker/compose settings.
After the Check Sauce cloud image is updated, you can upgrade the running cloud service to the latest version. Here's how:
First stop the existing container:
Run via docker-compose:
docker-compose down
Run docker ps
directly started by docker to query the container id, and stop by docker stop 容器id
.
Then run docker pull to pull the latest version:
docker pull easychen/checkchan:latest
After completion, just start the service.
Click云端服务
in the menu at the top right of the plug-in.
Enter http://$BBB:8088
in the服务器地址
column (replace $BBB with IP B, there is no need to add key parameters to the URL here); enter password C in the API_KEY
column.
Click Save. After the connection is successful, the configuration is completed.
After configuring the cloud, return to the list page. There will be an additional "Computer" icon on the far right of each row. When clicked, it will turn into a "Cloud" icon, and the task will be executed in the cloud instead.
Click the "Cloud + Arrow" button in the upper right corner to actively synchronize tasks to the cloud.
Check sauce will also automatically synchronize every ten minutes.
Check sauce's self-installed cloud supports taking screenshots of web page (dom) type tasks, which can be enabled by passing environment variables to the image:
Please refer to docker-compser.yml
above. Just add the environment variable and restart the service.
Notice
Check sauce’s self-hosted cloud has a built-in interface for RSS uplink of dynamic pages:
http://$ip:$port/rss/upload?key=$api_key
http://$ip:$port/image/rss.xml?key=$api_key
Check sauce has a built-in interface for cookie synchronization in the cloud:
http://$ip:$port/cookie/sync?key=$api_key
The principle of Check Sauce cloud task is to synchronize cookies to the cloud and then view them with a browser. The essence is the same as the user operation. However, because the export IP may be computer rooms and data centers, there is a possibility of risk control if the frequency is too high. If the cloud is deployed at home, the effect is the same as accessing it on a home computer.
Generally speaking, the problem that local tasks can be executed but cannot be executed in the cloud is due to differences in network environments and browser software between the two, such as:
Since server memory is usually not as large as our computers, many tasks that execute OK locally will fail midway due to the "delayed read" seconds being too small when synchronized to the cloud. If you encounter a similar situation, please try adding "delayed reading".
If this doesn't work, it's often because there are differences between the web page displayed by the cloud headless browser and the local one. For this situation, we generated a screenshot of the most recent failed task, which can be seen under the "Cloud Service" menu.
Click the "Failure Screenshot" button to see it. Note: You need to use only the latest image and pass ERROR_IMAGE=NORMAL
environment variable. If you want to capture an image of a complete web page, you can pass ERROR_IMAGE=FULL
.
If the task fails and there is no screenshot, it means that the task did not fail because the CSS selector was not hit. Try adding "delayed reading" to solve the problem.
You can also see the cloud task log on this page. The log here does not include tasks triggered by manually clicking the "Monitor" button. If there are no tasks that can be executed (tasks are triggered regularly), the log may also be empty.
In addition to our own cloud, we also integrated remote desktop mode into the image. It allows you to connect to the server via VNC and use it like a local browser.
The remote desktop version was previously a standalone image, but is now integrated into easychen/checkchan, so you can use it directly.
After the service is started, it can be connected through VNC client software.
In the remote desktop, you can directly connect to the cloud in the same container. Fill in http://localhost
as the server address and enter the API KEY as set in the YML above.
You can add environment variables and modify the screen width and height restrictions to make it easier to use on mobile phones:
- WIN_WIDTH=414
- WIN_HEIGHT=896
- XVFB_WHD=500x896x16
An example added to the docker command:
docker run -d -p 5900:5900 -v ${PWD} /data:/checkchan/data -e CKC_PASSWD=123 -e WIN_WIDTH=414 -e WIN_HEIGHT=896 -e XVFB_WHD=500x896x16 easychen/checkchan:latest
The daily consumption of containers is 300M~500M. A running environment with larger memory will be more stable. If you encounter problems, you can try increasing the memory.
You can use the cloud integrated in the same image to visually debug cloud tasks. Set VDEBUG
in the YML file to ON
, and then restart the container to see the detailed process of cloud monitoring web pages.
environment :
- " CKC_PASSWD=123 "
- " VDEBUG=ON "