TikTok Follower Count
N8N

TikTok Follower Count

A simple TikTok Follower Count for AWTRIX
A flow by Brian Lovelace

Download flow

Flow Details

A simple TikTok Follower Count for AWTRIX via an HTML Web Scrape

Steps to Make this Work with Your Data & Clock

Step 1: Select Hour Interval for Updating Your Follower Count.

You can change how often this number updates by using the first trigger node. Select how many hours you'd like between each follower count update. Please note, this tool does NOT work via the TikTok API, but rather web scraping. Keep updating this to a minimum, as of now I have it set to every 12 hours.

Step 2: Changing the TikTok Username

Under Fetch HTML Data, please see the URL field. You'll see "https://www.tiktok.com/@yourusernamehere?is_copy_url=1&is_from_webapp=v1." Please change yourusernamehere to your TikTok username.

Step 3: Updating your Clock IP in n8n

Under the "Send to Clock" node and the "Remove App" node, please ensure that you change the IP in the URL to your clock's IP, if it differs from what is already written. Only change the IP, do not change any other syntax.

Step 4: Adding the Icon

You can either add the Icon from this Flow, or you can download the icon to your pixel clock directly from it's IP.

To do this go to the IP address of your clock in your browser, hit the 'Icons' tab, and paste in "35685" (without quotation marks) under Lametric Icon ID, and hit Download.

Removing the App from Your Clock

Keep "Remove from Clock" disconnected from all other nodes. To use this node to remove the app from your clock, ensure that your clock's IP address is correctly set under the URL Field, then click Execute Node (or hit the play button on the Node within the Canvas). Alternatively, you can remove the app from your clock by deactivating the n8n workflow and rebooting your clock by accessing http://[Clock IP]/api/reboot from your browser.

{ "name": "TikTok Follower Count on Clock", "nodes": [ { "parameters": { "method": "POST", "url": "http://192.168.1.255/api/custom", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "name", "value": "tiktok" } ] }, "options": {} }, "id": "1f69869a-7873-493e-a7e0-a9394476cd5c", "name": "Remove App", "type": "n8n-nodes-base.httpRequest", "typeVersion": 3, "position": [ 1080, 280 ] }, { "parameters": { "rule": { "interval": [ { "field": "hours", "hoursInterval": 12 } ] } }, "id": "5edff45f-0d97-4b2e-91ef-256e2714f4cd", "name": "Every 12 Hours", "type": "n8n-nodes-base.scheduleTrigger", "typeVersion": 1, "position": [ 680, 460 ] }, { "parameters": { "url": "https://www.tiktok.com/@yourusernamehere?is_copy_url=1&is_from_webapp=v1", "sendHeaders": true, "headerParameters": { "parameters": [ { "name": "User-Agent", "value": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0" } ] }, "options": {} }, "id": "b658c902-70c6-473e-bc5f-b7dba83c9b4d", "name": "Fetch HTML Data", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4.1, "position": [ 880, 460 ] }, { "parameters": { "jsCode": "const regex = /<strong title=\"Followers\" data-e2e=\"followers-count\">(\\d+\\.?\\d*[MK]?)<\\/strong>/;\nconst match = regex.exec(items[0].json.data);\nif (match) {\n const followerCount = parseInt(match[1]);\n return { followerCount };\n} else {\n return { followerCount: \"N/A\" };\n}" }, "id": "77e52f14-4f12-494a-a6ef-b8099cdbaef5", "name": "Extract Follower Count", "type": "n8n-nodes-base.code", "typeVersion": 1, "position": [ 1080, 460 ] }, { "parameters": { "method": "POST", "url": "http://192.168.1.255/api/custom", "sendQuery": true, "queryParameters": { "parameters": [ { "name": "name", "value": "tiktok" } ] }, "sendBody": true, "bodyParameters": { "parameters": [ { "name": "text", "value": "={{ $json.followerCount }}" }, { "name": "icon", "value": "35685" } ] }, "options": {} }, "id": "2ac10d71-31a8-414c-887a-9dba5e163915", "name": "Send to Clock", "type": "n8n-nodes-base.httpRequest", "typeVersion": 3, "position": [ 1280, 460 ] } ], "pinData": {}, "connections": { "Every 12 Hours": { "main": [ [ { "node": "Fetch HTML Data", "type": "main", "index": 0 } ] ] }, "Fetch HTML Data": { "main": [ [ { "node": "Extract Follower Count", "type": "main", "index": 0 } ] ] }, "Extract Follower Count": { "main": [ [ { "node": "Send to Clock", "type": "main", "index": 0 } ] ] } }, "active": true, "settings": {}, "versionId": "16b1e879-3e36-490c-954d-f93cce32c815", "id": "6", "meta": { "instanceId": "fad48ee50ab295e27486d400f427ed5b50baff0c1dc235dc9413ccebae5358c7" }, "tags": [] }
-- Flow first published on June 12, 2023.