opentable

package
v0.0.0-...-f7f9f22 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(data io.Reader) (map[string]Resturant, error)

Parse takes in html content via an io.Reader and parses out the reservation data

func Search(opts SearchOpts) (map[string]Resturant, error)

Search performs a search against opentable.com with the given SearchOpts to be encoded as query params and then parses the returned HTML response scraping out the resturant reservation data

Types

type Reservation

type Reservation struct {
	Time time.Time
	URL  string
}

Reservation struct that holds reservation data

type Resturant

type Resturant struct {
	ID           string
	Name         string
	URL          string
	Recommended  string
	Reservations []Reservation
}

Resturant struct that holds resturant data and reservation list

type SearchOpts

type SearchOpts struct {
	UserAgent string
	People    string
	Time      time.Time
	Latitude  string
	Longitude string
	Term      string
	Sort      string
	Opts      map[string]string
}

SearchOpts is a struct that holds the values required to form the url for an opentable search request

func (SearchOpts) String

func (s SearchOpts) String() string

String takes the values from the SearchOpts and encodes them into a usable opentable search url string

Jump to

Keyboard shortcuts

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