aboutsummaryrefslogtreecommitdiffstats
path: root/skate/cmd/skate-dot
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-04-22 17:08:18 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-04-22 17:08:18 +0200
commit1dd4b22d20d466ff896ad28bc57e824a9eb10c15 (patch)
tree5aef8fddad8475180af57e513fd221cf4b55b7b1 /skate/cmd/skate-dot
parentd9ead73de0001f77a54521deb0eeeae9c400f1d8 (diff)
downloadrefcat-1dd4b22d20d466ff896ad28bc57e824a9eb10c15.tar.gz
refcat-1dd4b22d20d466ff896ad28bc57e824a9eb10c15.zip
wip: skate-dot
Diffstat (limited to 'skate/cmd/skate-dot')
-rw-r--r--skate/cmd/skate-dot/main.go19
1 files changed, 6 insertions, 13 deletions
diff --git a/skate/cmd/skate-dot/main.go b/skate/cmd/skate-dot/main.go
index 97b70ad..3ef99d5 100644
--- a/skate/cmd/skate-dot/main.go
+++ b/skate/cmd/skate-dot/main.go
@@ -1,4 +1,5 @@
-// skate-dot generates dot files from inbound and outbound citation links.
+// skate-dot generates dot files from inbound and outbound citation links. Just
+// a demo, replacement for a couple python scripts.
package main
import (
@@ -22,13 +23,7 @@ var (
func main() {
flag.Parse()
- // s := "The Determination of Concentration and Type of Ownership on Bank Performance and Risks in Indonesia"
- // fmt.Printf("%s\n", wordwrap.WrapString(s, 20))
- cfg := elasticsearch.Config{
- Addresses: []string{
- *es,
- },
- }
+ cfg := elasticsearch.Config{Addresses: []string{*es}}
es, err := elasticsearch.NewClient(cfg)
if err != nil {
log.Fatal(err)
@@ -38,9 +33,7 @@ func main() {
Es: es,
Index: *index,
}
- log.Println(client)
client.Outbound(*ident)
- client.Inbound(*ident)
}
// A client for fatcat and elasticsearch.
@@ -56,9 +49,9 @@ func (c *Client) String() string {
}
func (c *Client) Inbound(ident string) []string {
- resp, err := esapi.Search(
- esapi.Search.WithContext(context.Background()),
- esapi.Search.WithIndex(c.Index),
+ resp, err := c.Es.Search(
+ c.Es.Search.WithContext(context.Background()),
+ c.Es.Search.WithIndex(c.Index),
)
if err != nil {
log.Fatal(err)