diff --git a/src/config/main.go b/src/config/main.go index d052a22..0e99d7f 100644 --- a/src/config/main.go +++ b/src/config/main.go @@ -40,11 +40,13 @@ func (config *Config) GetConfig() error { 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" config.QrzGroups = []string{ - "01", - "03", - "09", + "1", + "2", + "3", + "9", "103", "104", "107", @@ -60,7 +62,6 @@ func (config *Config) GetConfig() error { "163", "18", "188", - "2", "214", "233", "25", diff --git a/src/database/main.go b/src/database/main.go index e5e92cb..bd6f45e 100644 --- a/src/database/main.go +++ b/src/database/main.go @@ -25,6 +25,7 @@ func Initialize(config *config.Config) (err error) { config.Db.SetMapper(names.GonicMapper{}) config.Db.CreateTables(qrz.Qrz{}) + config.Db.Sync2(qrz.Qrz{}) config.Db.ShowSQL(config.Debug) return diff --git a/src/qrz/main.go b/src/qrz/main.go index 388d50e..b995d22 100644 --- a/src/qrz/main.go +++ b/src/qrz/main.go @@ -66,6 +66,29 @@ func Run(config config.Config) (err error) { 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 func getBody(url string) (string, error) { var client http.Client diff --git a/templates/index.html b/templates/index.html index 9a4db5c..1395306 100644 --- a/templates/index.html +++ b/templates/index.html @@ -20,8 +20,8 @@
-Mirror of http://groupe-frs.hamstation.eu list of users
+Indexed mirror of http://groupe-frs.hamstation.eu list of users