parser

package module
v0.0.0-...-2aea580 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 9 Imported by: 0

README

marketmaker-auth-auto

Tracks the registered-user count of auth.marketmaker.cc — a project-level "audience" metric for w_popularity.

Endpoint

GET https://auth.marketmaker.cc/api/v1/stats/users-count{"count": N}

Public, no auth needed, 30-second cache on the upstream side.

Field mapping

Source ChannelSnapshot
count Followers
endpoint, metric=registered_users Raw

PostsCount, TotalLikes, etc. are zero — this is a single aggregate number, not a posting account.

Usage

import parser "github.com/suenot/marketmaker-auth-auto"

p := parser.New(parser.Config{})
snap, err := p.FetchChannel(ctx, "marketmaker")
// snap.Followers == total registered users on auth.marketmaker.cc

The handle argument is a label only; the API call is the same regardless.

License

MIT

Documentation

Overview

Package parser implements the w_popularity adapter for the auth.marketmaker.cc registered-user count.

Endpoint: GET https://auth.marketmaker.cc/api/v1/stats/users-count

response shape: {"count": <int>}

The endpoint is public, cached on the auth side for 30s, and exposes only an aggregate count — no PII. The "handle" passed to FetchChannel is a label (e.g. "marketmaker" or "global") that's used purely for the snapshot URL/title; the API call itself is identical for any handle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL     string // overrides https://auth.marketmaker.cc (test hook)
	Path        string // overrides /api/v1/stats/users-count (test hook)
	HTTPClient  *http.Client
	HTTPTimeout time.Duration
	UserAgent   string
}

type MMAuthParser

type MMAuthParser struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *MMAuthParser

func (*MMAuthParser) FetchChannel

func (p *MMAuthParser) FetchChannel(ctx context.Context, handle string) (shared.ChannelSnapshot, error)

FetchChannel returns a snapshot whose Followers = total registered users on auth.marketmaker.cc. The `handle` parameter is recorded verbatim on the snapshot but does not influence the API call.

func (*MMAuthParser) FetchRecentPosts

func (p *MMAuthParser) FetchRecentPosts(ctx context.Context, handle string, since time.Time) ([]shared.PostSnapshot, error)

FetchRecentPosts is a no-op — this is an aggregate metric, no post stream.

func (*MMAuthParser) Platform

func (p *MMAuthParser) Platform() shared.Platform

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL