Documentation ¶
Index ¶
Constants ¶
const ConfigRoot = "./scraper/configs/"
ConfigRoot is the folder where scraper configs are stored
const InStockHTTP = "http://schema.org/InStock"
InStockHTTP is the standard in stock enum in HTTP
const InStockHTTPS = "https://schema.org/InStock"
InStockHTTPS is the standard in stock enum in HTTPS
Variables ¶
This section is empty.
Functions ¶
func GetDocument ¶
GetDocument returns the goquery document from an URL
Types ¶
type LazadaScraper ¶
type LazadaScraper struct{}
LazadaScraper is an empty struct to hold methods that implements Scraper
func (LazadaScraper) GetHost ¶
func (s LazadaScraper) GetHost() (host string)
GetHost returns the host name for the scraper
func (LazadaScraper) ScrapeInfo ¶
ScrapeInfo extracts the required information out of a page from the scraper config
func (LazadaScraper) ScrapePrice ¶
ScrapePrice returns the current price for an item
type Scraper ¶
type Scraper interface { ScrapeInfo(path *url.URL) (item models.Item, err error) ScrapePrice(item models.Item) (itemPrice models.ItemPrice, err error) GetHost() (host string) }
Scraper is an interface implemented by all Scrapers
type TikiScraper ¶
type TikiScraper struct{}
TikiScraper is an empty struct to hold methods that implements Scraper
func (TikiScraper) GetHost ¶
func (s TikiScraper) GetHost() (host string)
GetHost returns the host name for the scraper
func (TikiScraper) ScrapeInfo ¶
ScrapeInfo extracts the required information out of a page from the scraper config
func (TikiScraper) ScrapePrice ¶
ScrapePrice returns the current price for an item