yandex

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImageURL added in v0.4.1

func BuildImageURL(q core.Query, page int) (string, error)

BuildImageURL builds a Yandex image search URL for the provided query and page index. It returns an error when the resulting query text is empty.

func BuildURL

func BuildURL(q core.Query, page int) (string, error)

BuildURL builds a Yandex web search URL for the provided query and page index. It returns an error when the resulting query text is empty.

func Search(ctx context.Context, query core.Query) (results []core.SearchResult, err error)

Types

type ImageData added in v0.4.1

type ImageData struct {
	InitalState struct {
		SerpList struct {
			Items struct {
				Entities map[string]ImageEntity `json:"entities"`
			} `json:"items"`
		} `json:"serpList"`
	} `json:"initialState"`
}

ImageData maps the subset of Yandex JSON state used by parser code.

type ImageEntity added in v0.4.1

type ImageEntity struct {
	ID        string `json:"id"`
	Rank      int    `json:"pos"`
	Width     int    `json:"origWidth"`
	Height    int    `json:"origHeight"`
	Title     string `json:"alt"`
	OrigURL   string `json:"origUrl"`
	ThumbURL  string `json:"image"`
	Freshness string `json:"freshnessCounter"`
	IsGIF     bool   `json:"gifLabel"`
}

ImageEntity contains one image record from Yandex image search state JSON.

type Yandex

type Yandex struct {
	core.Browser
	core.SearchEngineOptions
	// contains filtered or unexported fields
}

Yandex implements core.SearchEngine for Yandex SERP pages.

func New

func New(browser core.Browser, opts core.SearchEngineOptions) *Yandex

New creates a Yandex engine instance with browser/runtime options applied.

func (*Yandex) GetRateLimiter added in v0.2.1

func (yand *Yandex) GetRateLimiter() *rate.Limiter

GetRateLimiter returns a limiter configured from SearchEngineOptions.

func (*Yandex) Name

func (yand *Yandex) Name() string

Name returns the stable engine identifier.

func (*Yandex) Search

func (yand *Yandex) Search(ctx context.Context, query core.Query) (results []core.SearchResult, err error)

Search executes a Yandex web search and returns normalized search results. It may return core.ErrCaptcha or core.ErrSearchTimeout.

func (*Yandex) SearchImage added in v0.4.1

func (yand *Yandex) SearchImage(ctx context.Context, query core.Query) ([]core.SearchResult, error)

SearchImage executes a Yandex image search and returns normalized image results. It may return core.ErrCaptcha or core.ErrSearchTimeout.

Jump to

Keyboard shortcuts

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