AWTRIX NG Facebook Follower Counter
| System | AWTRIX NG Scripts |
|---|---|
| Firmware | AWTRIX NG |
| Topic | Social |
| Built by | el_alquimista_de_bits |
| File | PgwaqYNkNc84.ax · 3.9 KB |
| Icons | — |
| Published | 26 Aug 2026 |
Displays the follower count of a Facebook Page on AWTRIX NG.
Features:
Facebook 8×8 pixel icon
Blue gradient follower count
Full number when it fits
Automatic K, M, and B abbreviations
Configurable refresh interval
Saves the last successful follower count
Uses the Meta Graph API
Setup
You need:
Your Facebook Page ID
A valid Facebook Page Access Token
After installing the script, open the app settings and enter:
Page ID: YOUR_PAGE_ID
Access Token: YOUR_PAGE_ACCESS_TOKEN
Refresh: 60 minutes
The script requests:
https://graph.facebook.com/PAGE_ID?fields=followers_count
using your Page Access Token.
Important
Do not share your access token publicly.
If you share this script on GitHub, Discord, Reddit, etc., leave the token empty so each user can enter their own.
The script uses followers_count, which represents Facebook Page followers.
Credits
Facebook version adapted from Blueforcer's AWTRIX NG Instagram follower counter.
PgwaqYNkNc84.ax
# @name Facebook
# @desc Follower count of a Facebook Page
# @author elalquimistadebits
# @version 1.2
# @config page text "Facebook Page ID" default="" maxlen=32
# @config token text "Page Access Token" default="" maxlen=256
# @config every number "Refresh interval" default=60 min=5 max=1440 unit=min
# @config color color "Facebook color" default=#0866FF
class Facebook
var url, page, token, period, color
var count, label, full, err
var ticks, busy
var opts, ramp
def init()
self.page = store.get("page")
self.token = store.get("token")
self.period = store.get("every") * 60
self.color = store.get("color")
self.url = "https://graph.facebook.com/" +
self.page +
"?fields=followers_count"
self.count = store.get("who") == self.page ? store.get("n") : nil
self.label = self.count == nil ? nil : self.human(self.count)
self.full = self.count == nil ? nil : str(self.count)
self.err = false
self.ticks = 9
self.busy = false
self.opts = {
'headers': {
'Authorization': "Bearer " + self.token,
'User-Agent': 'AWTRIX-NG'
},
'find': "\"followers_count\"",
'keep': 64
}
# Facebook blue gradient for follower count
self.ramp = [0x0866FF, 0x5FA8FF]
end
def human(n)
if n < 1000
return str(n)
end
var d = 1000
var suf = "K"
if n >= 1000000000
d = 1000000000
suf = "B"
elif n >= 1000000
d = 1000000
suf = "M"
end
var v = n / (d + 0.0)
if v >= 10
return str(round(v)) + suf
end
var t = round(v * 10)
return str(int(t / 10)) + "." + str(t % 10) + suf
end
def on_body(body, status)
self.busy = false
shared.set("f", 0)
if status != 200 || body == nil
self.err = true
return
end
var m = re.search(
"\"followers_count\"\\s*:\\s*(\\d+)",
body
)
if m == nil
self.err = true
return
end
var n = num(m[1])
if n == nil
self.err = true
return
end
self.err = false
if n == self.count
return
end
self.count = n
self.full = str(n)
self.label = self.human(n)
store.set("n", n)
store.set("who", self.page)
end
def tls_busy()
for k : shared.keys()
if size(k) > 2 &&
k[size(k) - 2 .. size(k) - 1] == ".f" &&
shared.get(k) == 1
var a = shared.age(k)
if a != nil && a < 20000
return true
end
end
end
return false
end
def loop()
if self.ticks <= 0
if !self.busy && !self.tls_busy()
self.ticks = self.period
self.busy = true
shared.set("f", 1)
http.get(
self.url,
/ b, st -> self.on_body(b, st),
self.opts
)
end
end
self.ticks -= 1
end
def draw()
clear()
# Facebook 8x8 icon
rect_fill(0, 0, 8, 8, self.color)
# Slim Facebook "f"
pixel(4, 1, 0xFFFFFF)
pixel(5, 1, 0xFFFFFF)
pixel(4, 2, 0xFFFFFF)
pixel(3, 3, 0xFFFFFF)
pixel(4, 3, 0xFFFFFF)
pixel(5, 3, 0xFFFFFF)
pixel(4, 4, 0xFFFFFF)
pixel(4, 5, 0xFFFFFF)
pixel(4, 6, 0xFFFFFF)
if self.label != nil
var avail = width() - 9
var s = self.full
var w = text_ink_width(s)
if w > avail
s = self.label
w = text_ink_width(s)
end
# Gradient follower count
ramp_text(
9 + (avail - w) / 2,
6,
s,
self.ramp
)
return
end
var s = self.err ? "?" : "..."
var w = text_ink_width(s)
text(
9 + (width() - 9 - w) / 2,
6,
s,
self.err ? 0xCC7722 : 0x555555
)
end
end
return Facebook()
Install it on your AWTRIX NG
Your browser writes the script straight to the device on your network. It joins the app rotation right away.
Some browsers refuse to talk to a device on your network from a public page. Download the flow and paste it into the Scripts tab of your device, or install it from a terminal:
More flows for AWTRIX NG Scripts or Social
Something wrong with this flow? Report it.