Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/financial data #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Anakin100100
Copy link

No description provided.

main.go Outdated
@@ -17,3 +32,39 @@ func main() {
r.POST("/commands", views.NewQuoteHandler(slackClient, signingSecret).QuoteServe)
r.Run()
}

func ParseFinancialTable(url string) []Table {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go to seperate package?

main.go Outdated
func main() {
tables := ParseFinancialTable("https://finanse.hs-silesia.pl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be as a separate endpoint? why this is inside main function?

main.go Outdated
return all_tables
}

func StringToFloat(s *goquery.Selection) float64 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has a misleading name. It says StringToFloat, while the first argument is goquery.Selection pointer.

main.go Outdated
Comment on lines 54 to 56
for i:=0; i<len(all_tables); i++ {
fmt.Println(all_tables[i].caption)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this is slice, wouldn't that be better?

Suggested change
for i:=0; i<len(all_tables); i++ {
fmt.Println(all_tables[i].caption)
}
for idx, table := range all_tables {
fmt.Println(table.caption)
}

Copy link
Member

@galuszkak galuszkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove binary from this PR.

@@ -1,2 +0,0 @@
SLACK_AUTH_TOKEN=
SLACK_SIGNING_SECRET=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why deleting this? Those are so people can do initial configuration easily by just copying it to .env file and sourcing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants