mirror of
https://bitbucket.org/skobkin/point-tools-crawler.git
synced 2024-12-05 02:25:53 +00:00
Point Tools token is now command-line parameter.
This commit is contained in:
parent
a2e6e55e36
commit
ac668ee2cd
|
@ -11,10 +11,11 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
var login, password string
|
||||
var login, password, pointToolsToken string
|
||||
|
||||
flag.StringVar(&login, "l", "", "Account login")
|
||||
flag.StringVar(&password, "p", "", "Account password")
|
||||
flag.StringVar(&pointToolsToken, "t", "", "Point Tools crawler API token")
|
||||
flag.Parse()
|
||||
|
||||
if len(login) < 1 || len(password) < 1 {
|
||||
|
@ -22,8 +23,13 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
if len(pointToolsToken) < 1 {
|
||||
fmt.Println("Point Tools token must be defined")
|
||||
return
|
||||
}
|
||||
|
||||
pointClient := point.NewClient("https://point.im/api/")
|
||||
pointToolsClient := point_tools.NewClient("http://point-tools.local:8000/api/crawler/", "test_token")
|
||||
pointToolsClient := point_tools.NewClient("http://point-tools.local:8000/api/crawler/", pointToolsToken)
|
||||
|
||||
_, loginErr := pointClient.Login(login, password)
|
||||
|
||||
|
|
Loading…
Reference in a new issue