-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (32 loc) · 942 Bytes
/
Copy pathmain.go
File metadata and controls
38 lines (32 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"flag"
"log"
"strconv"
)
var (
max_tries_per_download = 3
max_nr_of_magazines_per_year = 13 //number of issues per year, e.g. ct=27, ix=13 (due to special editions)
LOGIN_URL = "https://www.heise.de/sso/login/login"
verbose bool
)
// Array all magazines
func main() {
email := flag.String("email", "", "email address")
password := flag.String("password", "", "password")
flag.Bool("help", false, "help")
flag.Bool("version", false, "version")
verbose = *flag.Bool("verbose", false, "Verbose Logging")
flag.String("magazines", "", "magazines")
//flag.String("beginYear")
//flag.String("endYear")
flag.Parse()
sessionCookie, err := loginSSO(*email, *password)
if err != nil {
log.Fatal(err)
}
getAccessRights(sessionCookie)
for i := 1; i <= max_nr_of_magazines_per_year; i++ {
downloadMagazine(sessionCookie, "ct", "2025", strconv.Itoa(i))
}
}