various changes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2020-12-27 15:59:48 +01:00
parent 90ea866cd0
commit 8fac3c0a57
4 changed files with 31 additions and 6 deletions

View File

@ -40,11 +40,13 @@ func (config *Config) GetConfig() error {
config.Cron = qrzsection.Key("cron").MustString("@every 1h") config.Cron = qrzsection.Key("cron").MustString("@every 1h")
config.URLBase = `http://groupe-frs.hamstation.eu/index_qrz_liste_%s.php` config.URLBase = `http://groupe-frs.hamstation.eu/index_qrz_liste_%s.php`
//config.URLBase = "http://groupe-frs.hamstation.eu"
config.QrzGroups = []string{ config.QrzGroups = []string{
"01", "1",
"03", "2",
"09", "3",
"9",
"103", "103",
"104", "104",
"107", "107",
@ -60,7 +62,6 @@ func (config *Config) GetConfig() error {
"163", "163",
"18", "18",
"188", "188",
"2",
"214", "214",
"233", "233",
"25", "25",

View File

@ -25,6 +25,7 @@ func Initialize(config *config.Config) (err error) {
config.Db.SetMapper(names.GonicMapper{}) config.Db.SetMapper(names.GonicMapper{})
config.Db.CreateTables(qrz.Qrz{}) config.Db.CreateTables(qrz.Qrz{})
config.Db.Sync2(qrz.Qrz{})
config.Db.ShowSQL(config.Debug) config.Db.ShowSQL(config.Debug)
return return

View File

@ -66,6 +66,29 @@ func Run(config config.Config) (err error) {
return return
} }
func getGroups(urlbase string) (urls []string, err error) {
var client http.Client
resp, err := client.Get(urlbase)
if err != nil {
return nil, err
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, err
}
defer resp.Body.Close()
fmt.Println(string(body))
htmlpage, err := htmlquery.Parse(strings.NewReader(string(body)))
q := htmlquery.Find(htmlpage, `//*[@id="menu"]/center[2]/form/select`)
fmt.Println(q)
return
}
// getBody fetch html page // getBody fetch html page
func getBody(url string) (string, error) { func getBody(url string) (string, error) {
var client http.Client var client http.Client

View File

@ -20,8 +20,8 @@
</head> </head>
<body> <body>
<h1 class="display-3">FRS QRZ database</h1> <h1 class="display-3">QRZ FRS users database</h1>
<p>Mirror of <a href="http://groupe-frs.hamstation.eu">http://groupe-frs.hamstation.eu</a> list of users</p> <p>Indexed mirror of <a href="http://groupe-frs.hamstation.eu">http://groupe-frs.hamstation.eu</a> list of users</p>
<div> <div>
<table id="main_table" class="display table table-hover"> <table id="main_table" class="display table table-hover">
<thead class="thead-dark"> <thead class="thead-dark">