bing

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildImageURL

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

BuildImageURL builds a Bing image search URL from Query fields. It returns an error when the resulting query text is empty.

func BuildURL

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

BuildURL builds a Bing web search URL from Query fields. It returns an error when query text or date parameters are invalid.

Types

type Bing

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

Bing implements core.SearchEngine for Bing SERP pages.

func New

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

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

func (*Bing) GetRateLimiter

func (bing *Bing) GetRateLimiter() *rate.Limiter

GetRateLimiter returns a limiter configured from SearchEngineOptions.

func (*Bing) Name

func (bing *Bing) Name() string

Name returns the stable engine identifier.

func (*Bing) Search

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

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

func (*Bing) SearchImage

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

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

type BingImageData

type BingImageData struct {
	T      string `json:"t"`      // Title
	Desc   string `json:"desc"`   // Description
	IMGURL string `json:"imgurl"` // Original image URL
	W      int    `json:"w"`      // Width
	H      int    `json:"h"`      // Height
	PURL   string `json:"purl"`   // Page URL
	TURL   string `json:"turl"`   // Thumbnail URL
	MURL   string `json:"murl"`   // Image URL
}

BingImageData represents metadata encoded in the image result `m` attribute.

Jump to

Keyboard shortcuts

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