Skip to content

Every analytics tool wants a subscription. And your data. I built Twiligent instead. YouTube stats. Instagram stats. One dashboard. Runs locally on your machine.

3.4 KB
Raw Blame
{
    "lines": [
        [
            "log",
            "{\"level\":\"info\",\"message\":\"instagram token refreshed\",\"requestId\":\"cron-test\",\"accountId\":\"a1\",\"username\":\"soon\",\"tokenExpiresAt\":\"2026-10-31T12:00:00.000Z\"}"
        ],
        [
            "error",
            "{\"level\":\"error\",\"message\":\"instagram token refresh failed\",\"requestId\":\"cron-test\",\"accountId\":\"a6\",\"username\":\"failing\",\"error\":\"Session has expired\",\"errorName\":\"UpstreamError\"}"
        ]
    ],
    "requests": [
        {
            "url": "https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=T1",
            "method": "GET"
        },
        {
            "url": "https://graph.instagram.com/refresh_access_token?grant_type=ig_refresh_token&access_token=T6",
            "method": "GET"
        }
    ],
    "calls": [
        {
            "type": "select",
            "table": "accounts",
            "columns": "id, platform, data",
            "filters": [
                [
                    "platform",
                    "instagram"
                ]
            ]
        },
        {
            "type": "rpc",
            "table": "merge_account_data",
            "values": {
                "p_id": "a1",
                "p_user_id": null,
                "p_patch": {
                    "accessToken": "N1",
                    "tokenExpiresAt": "2026-10-31T12:00:00.000Z"
                }
            },
            "filters": []
        }
    ],
    "table": [
        {
            "id": "a1",
            "platform": "instagram",
            "user_id": "user-1",
            "data": {
                "username": "soon",
                "accessToken": "N1",
                "tokenExpiresAt": "2026-10-31T12:00:00.000Z"
            },
            "updated_at": "2026-09-01T12:00:00.000Z"
        },
        {
            "id": "a2",
            "platform": "instagram",
            "user_id": "user-1",
            "data": {
                "username": "later",
                "accessToken": "T2",
                "tokenExpiresAt": "2026-10-11T12:00:00.000Z"
            }
        },
        {
            "id": "a3",
            "platform": "instagram",
            "user_id": "user-1",
            "data": {
                "username": "notoken",
                "tokenExpiresAt": "2026-09-02T12:00:00.000Z"
            }
        },
        {
            "id": "a4",
            "platform": "instagram",
            "user_id": "user-1",
            "data": {
                "username": "noexpiry",
                "accessToken": "T4"
            }
        },
        {
            "id": "a5",
            "platform": "youtube",
            "user_id": "user-1",
            "data": {
                "channelId": "UC1",
                "accessToken": "T5",
                "tokenExpiresAt": "2026-09-02T12:00:00.000Z"
            }
        },
        {
            "id": "a6",
            "platform": "instagram",
            "user_id": "user-1",
            "data": {
                "username": "failing",
                "accessToken": "T6",
                "tokenExpiresAt": "2026-09-16T12:00:00.000Z"
            }
        },
        {
            "id": "a7",
            "platform": "instagram",
            "user_id": "user-2",
            "data": {
                "username": "expired",
                "accessToken": "T7",
                "tokenExpiresAt": "2026-08-30T12:00:00.000Z"
            }
        }
    ]
}