Skip to content

Instantly share code, notes, and snippets.

@poitch
poitch / Plausible Today Visitor.js
Last active January 4, 2021 19:06
Scriptable iOS widget to display today's visitor count with Plausible analytics
// Put your website here
// Stats need to be public
const namespace = "plausible.io"
// Request visits
const today = new Date()
const fmt = new DateFormatter()
fmt.dateFormat = "yyyy-MM-dd"
const formatted_date = fmt.string(today)
const endpoint = "https://plausible.io/api/stats/" + namespace + "/main-graph?period=day&date=" + formatted_date + "&filters=%7B%7D"

Keybase proof

I hereby claim:

  • I am poitch on github.
  • I am poitch (https://keybase.io/poitch) on keybase.
  • I have a public key whose fingerprint is AFA0 05E9 0389 D8E1 D39F 7C88 36CE D14D FE37 CF26

To claim this, I am signing this object: