gohem

package
v0.0.0-...-4ec40a7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BostadRegex = regexp.MustCompile(`^https:\/\/www\.hemnet\.se\/bostad\/\S*$`)
View Source
var BostaderRegex = regexp.MustCompile(`^https:\/\/www\.hemnet\.se\/bostader\S*$`)

Functions

This section is empty.

Types

type CostPerUnit

type CostPerUnit struct {
	Cost     int    `json:"cost"`
	Currency string `json:"currency"`
	Unit     string `json:"unit"`
}

func NewCostPerUnit

func NewCostPerUnit(cost int, currency, unit string) (CostPerUnit, error)

type Properties

type Properties struct {
	Properties []Property `json:"properties"`
}

func ScrapeSearch

func ScrapeSearch(url string) (Properties, error)

type Property

type Property struct {
	Address            string      `json:"address"`
	Price              int         `json:"price"`
	Type               string      `json:"type"`
	Tenure             string      `json:"tenure"`
	Rooms              int         `json:"rooms"`
	Area               string      `json:"area"`
	Year               string      `json:"constructionYear"`
	HousingCooperative string      `json:"housingCooperative"`
	Fee                CostPerUnit `json:"fee"`
	OperatingCost      CostPerUnit `json:"operatingCost"`
	PriceSquareMeter   CostPerUnit `json:"priceSquareMeter"`
	Visits             int         `json:"visists"`
	Realtor            string      `json:"realtor"`
	Agency             string      `json:"agency"`
	Removed            bool        `json:"removed"`
	RemovedDate        string      `json:"removedDate,omitempty"`
}

func ScrapeProperty

func ScrapeProperty(url string) (Property, error)

func (*Property) AddField

func (p *Property) AddField(keyValuePairs ...string) ([]string, error)

Jump to

Keyboard shortcuts

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