Giter Site home page Giter Site logo

book-it's Introduction

๐Ÿ“ NYC

book-it's People

Contributors

bthuilot avatar

Watchers

 avatar  avatar

book-it's Issues

Error in booking: slice bounds out of range [:25] with length 12

First of all, great project.

Here is what I've done

export RESY_EMAIL="email"
export RESY_PASSWORD="pwd"
go build -o book-it
./book-it -v 64154 -d 05/17/23 -t 07:30PM -s 3600 -p 2 --include-types "Lounge Seating"

Test resy: https://resy.com/cities/ny/kyu?date=2023-05-17&seats=2

Error

./book-it -v 64154 -d 05/17/23 -t 07:30PM -s 3600 -p 2 --include-types "Lounge Seating"
INFO[0000] constructing Resy client
panic: runtime error: slice bounds out of range [:25] with length 12

goroutine 1 [running]:
github.com/bthuilot/book-it/pkg/resy.(*client).passwordAuth(0x140001205c0)
	/Users/codchang/Desktop/Coda/book-it/pkg/resy/auth.go:45 +0x248
github.com/bthuilot/book-it/pkg/resy.(*client).refreshToken(...)
	/Users/codchang/Desktop/Coda/book-it/pkg/resy/auth.go:38
github.com/bthuilot/book-it/pkg/resy.NewClient()
	/Users/codchang/Desktop/Coda/book-it/pkg/resy/api.go:49 +0xdc
github.com/bthuilot/book-it/cmd.glob..func2(0x102da7200?, {0x1029b15fa?, 0xc?, 0xc?})
	/Users/codchang/Desktop/Coda/book-it/cmd/root.go:88 +0xc8
github.com/spf13/cobra.(*Command).execute(0x102da7200, {0x1400001e5c0, 0xc, 0xc})
	/Users/codchang/go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x5b0
github.com/spf13/cobra.(*Command).ExecuteC(0x102da7200)
	/Users/codchang/go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/codchang/go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/bthuilot/book-it/cmd.Execute()
	/Users/codchang/Desktop/Coda/book-it/cmd/root.go:104 +0x28
main.main()
	/Users/codchang/Desktop/Coda/book-it/main.go:8 +0x1c

pull resy global API key dynmically

Currently the production rest API key is hard-coded into the file /pkg/resy/client.go.
This should be refactored so it is pulled dynamically on application startup.

It can be accessed vie the Resy web-app console, by evaluating the expression

apiConfig.Config.apiKey

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.