details

package
v0.0.0-...-57057ef Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImg

func GetImg(imgURL string, proxyURL *url.URL) (string, []byte, error)

func GetMainRoomIds

func GetMainRoomIds(mainURL string, proxyURL *url.URL) ([]int64, error)

func ParseBodyDetails

func ParseBodyDetails(body []byte) (Data, PriceDependencyInput, error)

Types

type Amenity

type Amenity struct {
	Title     string
	Subtitle  string
	Available bool
	Icon      string
}

type AmenityGroup

type AmenityGroup struct {
	Title  string
	Values []Amenity
}

type Cohost

type Cohost struct {
	ID   string
	Name string
}

type Coordinates

type Coordinates struct {
	Latitude float64
	Longitud float64
}

type Data

type Data struct {
	Title                string
	URL                  string
	RoomType             string
	Language             string
	HomeTier             int
	PersonCapacity       int
	IsSuperHost          bool
	Price                Price
	Rating               Rating
	Coordinates          Coordinates
	Host                 Host
	CoHosts              []Cohost
	SubDescription       SubDescription
	Description          string
	Highlights           []Highlight
	Amenities            []AmenityGroup
	HouseRules           HouseRules
	LocationDescriptions []LocationDetail
	Images               []Img
}

func GetFromRoomID

func GetFromRoomID(roomID int64, currency string, proxyURL *url.URL) (Data, error)

func GetFromRoomIDAndDomain

func GetFromRoomIDAndDomain(roomID int64, domain, currency string, proxyURL *url.URL) (Data, error)

func GetFromRoomURL

func GetFromRoomURL(roomURL, currency string, proxyURL *url.URL) (Data, error)

optimized to work on this format: "https://www.airbnb.com/rooms/[roomID]"

func (*Data) SetImages

func (data *Data) SetImages(proxyURL *url.URL) error

type DescriptionItems

type DescriptionItems struct {
	Typename string `json:"__typename"`
	Title    string `json:"title"`
}

type HTML

type HTML struct {
	Typename string `json:"__typename"`
	HTMLText string `json:"htmlText"`
}

type Highlight

type Highlight struct {
	Title    string
	Subtitle string
	Icon     string
}

type Host

type Host struct {
	ID          string
	Name        string
	JoinedOn    string
	Description string
}

type HouseRule

type HouseRule struct {
	Title  string
	Values []HouseRuleValue
}

type HouseRuleValue

type HouseRuleValue struct {
	Title string
	Icon  string
}

type HouseRules

type HouseRules struct {
	Aditional string
	General   []HouseRule
}

type Img

type Img struct {
	Title       string
	URL         string
	ContentType string
	Extension   string
	Content     []byte `json:"-"`
}

func (*Img) SetImage

func (img *Img) SetImage(proxyURL *url.URL) error

type Item

type Item struct {
	Typename string `json:"__typename"`
	Title    string `json:"title"`
	Subtitle string `json:"subtitle"`
	Icon     string `json:"icon"`
	HTML     HTML   `json:"html"`
}

type LocationDetail

type LocationDetail struct {
	Title   string
	Content string
}

type PdpSectionsRequest

type PdpSectionsRequest struct {
	Adults                        string   `json:"adults"`
	BypassTargetings              bool     `json:"bypassTargetings"`
	CategoryTag                   *string  `json:"categoryTag"`
	CauseId                       *string  `json:"causeId"`
	Children                      *string  `json:"children"`
	DisasterId                    *string  `json:"disasterId"`
	DiscountedGuestFeeVersion     *string  `json:"discountedGuestFeeVersion"`
	DisplayExtensions             *string  `json:"displayExtensions"`
	FederatedSearchId             *string  `json:"federatedSearchId"`
	ForceBoostPriorityMessageType *string  `json:"forceBoostPriorityMessageType"`
	Infants                       *string  `json:"infants"`
	InteractionType               *string  `json:"interactionType"`
	Layouts                       []string `json:"layouts"`
	Pets                          int      `json:"pets"`
	PdpTypeOverride               *string  `json:"pdpTypeOverride"`
	PhotoId                       *string  `json:"photoId"`
	Preview                       bool     `json:"preview"`
	PreviousStateCheckIn          *string  `json:"previousStateCheckIn"`
	PreviousStateCheckOut         *string  `json:"previousStateCheckOut"`
	PriceDropSource               *string  `json:"priceDropSource"`
	PrivateBooking                bool     `json:"privateBooking"`
	PromotionUuid                 *string  `json:"promotionUuid"`
	RelaxedAmenityIds             *string  `json:"relaxedAmenityIds"`
	SearchId                      *string  `json:"searchId"`
	SelectedCancellationPolicyId  *string  `json:"selectedCancellationPolicyId"`
	SelectedRatePlanId            *string  `json:"selectedRatePlanId"`
	SplitStays                    *string  `json:"splitStays"`
	StaysBookingMigrationEnabled  bool     `json:"staysBookingMigrationEnabled"`
	TranslateUgc                  *string  `json:"translateUgc"`
	UseNewSectionWrapperApi       bool     `json:"useNewSectionWrapperApi"`
	SectionIds                    []string `json:"sectionIds"`
	CheckIn                       *string  `json:"checkIn"`
	CheckOut                      *string  `json:"checkOut"`
	P3ImpressionId                string   `json:"p3ImpressionId"`
}

type Price

type Price struct {
	Amount         float32
	CurrencySymbol string
	Qualifier      string
}

type PriceDependencyInput

type PriceDependencyInput struct {
	ProducID    string
	ImpresionID string
	ApiKey      string
}

func (PriceDependencyInput) GetPrice

func (pdi PriceDependencyInput) GetPrice(currency string, cookies []*http.Cookie, proxyURL *url.URL) (Price, error)

type Rating

type Rating struct {
	Accuracy          float32
	Checking          float32
	CleaningLiness    float32
	Comunication      float32
	Location          float32
	Value             float32
	GuestSatisfaction float32
	ReviewCount       int
}

type SbuiData

type SbuiData struct {
	Typename             string               `json:"__typename"`
	SectionConfiguration sectionConfiguration `json:"sectionConfiguration"`
}

type SeeAllAmenitiesGroup

type SeeAllAmenitiesGroup struct {
	Typename string    `json:"__typename"`
	Title    string    `json:"title"`
	Amenity  []amenity `json:"amenities"`
}

type SubDescription

type SubDescription struct {
	Title string
	Items []string
}

Jump to

Keyboard shortcuts

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