mirror of
https://bitbucket.org/skobkin/point-tools-crawler.git
synced 2024-12-05 02:25:53 +00:00
API urls moved to CLI parameters.
This commit is contained in:
parent
3e4cabcaf4
commit
f1d46ca56c
|
@ -11,11 +11,14 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
var pointApiUrl, pointToolsApiUrl string;
|
||||
var pointLogin, pointPassword, pointToolsToken string
|
||||
|
||||
flag.StringVar(&pointLogin, "l", "", "Account login")
|
||||
flag.StringVar(&pointPassword, "p", "", "Account password")
|
||||
flag.StringVar(&pointToolsToken, "t", "", "Point Tools crawler API token")
|
||||
flag.StringVar(&pointApiUrl, "s", "https://point.im/api/", "Point.im API url")
|
||||
flag.StringVar(&pointToolsApiUrl, "g", "https://point.skobk.in/api/crawler/", "Point Tools API url")
|
||||
flag.Parse()
|
||||
|
||||
if len(pointLogin) < 1 || len(pointPassword) < 1 {
|
||||
|
@ -28,8 +31,8 @@ func main() {
|
|||
return
|
||||
}
|
||||
|
||||
pointClient := point.NewClient("https://point.im/api/")
|
||||
pointToolsClient := point_tools.NewClient("http://point-tools.local:8000/api/crawler/", pointToolsToken)
|
||||
pointClient := point.NewClient(pointApiUrl)
|
||||
pointToolsClient := point_tools.NewClient(pointToolsApiUrl, pointToolsToken)
|
||||
|
||||
_, loginErr := pointClient.Login(pointLogin, pointPassword)
|
||||
|
||||
|
|
Loading…
Reference in a new issue