Documentation
¶
Overview ¶
Package parser implements the w_popularity telegram adapter.
Strategy: scrape the public preview at https://t.me/s/<handle>. That endpoint exposes subscriber counts and the last ~20 posts inline for public CHANNELS. User handles (and private/missing channels) have no preview and return ErrNotFound.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Credential is unused for the public preview scraper; kept for
// symmetry with sibling parsers.
Credential string
// HTTPTimeout caps every outbound call. Default: 15s.
HTTPTimeout time.Duration
// CamoufoxURL is unused; reserved for future browser fallback.
CamoufoxURL string
// BaseURL overrides https://t.me. Used in tests.
BaseURL string
// HTTPClient overrides the default HTTP client. Used in tests.
HTTPClient *http.Client
// UserAgent overrides the request UA. Default: Mozilla/5.0.
UserAgent string
}
Config controls runtime behaviour.
type TelegramParser ¶
type TelegramParser struct {
// contains filtered or unexported fields
}
TelegramParser scrapes the public t.me/s/ preview.
func (*TelegramParser) FetchChannel ¶
func (p *TelegramParser) FetchChannel(ctx context.Context, handle string) (shared.ChannelSnapshot, error)
FetchChannel returns a snapshot for the given public channel or group. Channels expose subscribers + posts via the /s/ preview; groups expose only member count via the plain t.me/<handle> page. Private/missing entries return shared.ErrNotFound.
func (*TelegramParser) FetchRecentPosts ¶
func (p *TelegramParser) FetchRecentPosts(ctx context.Context, handle string, since time.Time) ([]shared.PostSnapshot, error)
FetchRecentPosts parses the embedded posts in the /s/ preview. Posts older than `since` are filtered out. Newest-first.
func (*TelegramParser) Platform ¶
func (p *TelegramParser) Platform() shared.Platform
Platform implements shared.Parser.