Restructure the existing codebase to support more inherited methods/classes. This extends into supporting other FinViz apps such as News.
Create a partially abstract base class View and interface ViewInterface:
type View struct {}
type ViewInterface interface {
GenerateURL() string
Scrape(document *goquery.Document) ([][]string, error)
}
Each app should have a derived object that inherits the predefined interface methods, such as for News:
type NewsView struct {
finviz.View
}
Going deeper, an app should derive its actual views from the app view base class, ex:
type SourceNewsView struct {
NewsView
}
This restructuring should help greatly with view URL generation as derived objects can call parent methods, thus generating the URL in a step by step basis: ('https://finviz.com' OR 'https://elite.finviz.com') + '/news.ashx' + '?v=2'.
Additionally, this restructuring will help clean up the file structure of the codebase and make it more presentable and less daunting on GitHub.
Restructure the existing codebase to support more inherited methods/classes. This extends into supporting other FinViz apps such as News.
Create a partially abstract base class
View
and interfaceViewInterface
:Each app should have a derived object that inherits the predefined interface methods, such as for News:
Going deeper, an app should derive its actual views from the app view base class, ex:
This restructuring should help greatly with view URL generation as derived objects can call parent methods, thus generating the URL in a step by step basis:
('https://finviz.com' OR 'https://elite.finviz.com') + '/news.ashx' + '?v=2'
.Additionally, this restructuring will help clean up the file structure of the codebase and make it more presentable and less daunting on GitHub.