Documentation
¶
Overview ¶
Package goebaykleinanzeigen exposes a webscraping interface for eBay Kleinanzeigen
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdItem ¶
type AdItem struct {
ID string `json:"id"`
ListedSince time.Time `json:"listed_since"`
Title string `json:"title"`
Price int `json:"price"`
PriceNegotiable bool `json:"price_negotiable"`
Location string `json:"location"`
ZipCode string `json:"zip_code"`
Link string `json:"link"`
Description string `json:"description"`
Details []*Detail `json:"details"`
Extras []string `json:"extras"`
Seller *Seller `json:"seller"`
}
AdItem represents a single AdItem
type AdListItem ¶
type AdListItem struct {
ID string `json:"id"`
Title string `json:"title"`
Price int `json:"price"`
PriceNegotiable bool `json:"price_negotiable"`
Location string `json:"location"`
ZipCode string `json:"zip_code"`
Link string `json:"link"`
}
AdListItem a single item in the returned list
type AdListRepo ¶
type AdListRepo struct {
// contains filtered or unexported fields
}
AdListRepo represents an AdListRepo The AdListRepo resolves a list of ads
func NewAdListRepo ¶
func NewAdListRepo(client *http.Client) *AdListRepo
NewAdListRepo creates a new AdRepo, if client is nil, one will be created
func (*AdListRepo) Fetch ¶
func (al *AdListRepo) Fetch(ctx context.Context, param *SearchParam) (*AdListResponse, error)
Fetch fetches a list of ads based on the provided param
type AdListResponse ¶
type AdListResponse struct {
Items []*AdListItem
IsLastPage bool
}
AdListResponse represents the response from the Fetch() call
type AdRepo ¶
type AdRepo struct {
// contains filtered or unexported fields
}
AdRepo represents an AdRepo The AdRepo resolves a single ad
type Category ¶
type Category string
Category represents a specific category id
const ( Family Category = "17" Music Category = "73" HouseAndGarden Category = "80" Jobs Category = "102" Pets Category = "130" Fashion Category = "153" Electronics Category = "161" Hobby Category = "185" Property Category = "195" Boats Category = "211" Cars Category = "216" CarParts Category = "223" Tickets Category = "231" Education Category = "235" Services Category = "297" )
type LocationID ¶
type LocationID string
LocationID represents a specifc location retrived from https://www.ebay-kleinanzeigen.de/s-ort-empfehlungen.json?query=Berlin for example
type ParamName ¶
type ParamName string
ParamName represents a parameter name for a category specific parameter
type Provider ¶
type Provider string
Provider represents a specific provider (private or commercial seller)
type SearchParam ¶
type SearchParam struct {
Category Category `json:"category"`
Provider Provider `json:"provider"`
OfferType OfferType `json:"offer_type"`
Location LocationID `json:"location"`
Radius Radius `json:"radius"`
SpecificParameter SpecificParameter `json:"specific_parameter"`
// Which page should be scraped
Page int `json:"page"`
// Price from in euro
PriceFrom int `json:"price_from"`
// Price to in euro
PriceTo int `json:"price_to"`
}
SearchParam holds all parameters for a search
func ParamsFromJSON ¶
func ParamsFromJSON(data io.Reader) (*SearchParam, error)
ParamsFromJSON creates a SearchParam struct from JSON
type Seller ¶
type Seller struct {
Name string `json:"name"`
ActiveSince time.Time `json:"active_since"`
Friendliness string `json:"friendliness"`
Rating string `json:"rating"`
}
Seller represents the seller of an aditem
type SpecificParameter ¶
SpecificParameter represent specific parameters for each category