Skip to content

Instantly share code, notes, and snippets.

View llonchj's full-sized avatar

Jordi Llonch llonchj

  • Victoria / Australia
View GitHub Profile
@llonchj
llonchj / main.go
Created October 17, 2018 21:46
Proof of concept
package main
import (
"fmt"
"net/http"
"github.com/gocolly/colly"
)
type MyCollector struct {
name: string @index(exact) .
child: uid @reverse @count .
Starting api_zero_1 ...
Recreating api_dgraph_1 ... done
Recreating api_ratel_1 ... done
Attaching to api_zero_1, api_dgraph_1, api_ratel_1
zero_1 | Setting up grpc listener at: 0.0.0.0:7080
zero_1 | Setting up http listener at: 0.0.0.0:8080
zero_1 | 2018/01/04 03:09:42 node.go:248: Found hardstate: {Term:9 Vote:1 Commit:2079 XXX_unrecognized:[]}
ratel_1 | 2018/01/04 03:10:13 Listening on port 8081...
zero_1 | 2018/01/04 03:09:42 node.go:260: Group 0 found 2079 entries
zero_1 | 2018/01/04 03:09:42 raft.go:400: Restarting node for dgraphzero
zero:
image: dgraph/dgraph:latest
volumes:
- dgraph-zero-data:/dgraph
# ports:
# - 5080:5080
# - 6080:6080
restart: on-failure
command: dgraph zero --my=zero:7080
dgraph:
Attaching to api_zero_1, api_dgraph_1, api_ratel_1
zero_1 | Setting up grpc listener at: 0.0.0.0:7080
ratel_1 | 2018/01/04 00:38:07 Listening on port 8081...
zero_1 | Setting up http listener at: 0.0.0.0:8080
zero_1 | 2018/01/04 00:38:05 node.go:248: Found hardstate: {Term:3 Vote:1 Commit:2057 XXX_unrecognized:[]}
zero_1 | 2018/01/04 00:38:05 node.go:260: Group 0 found 2057 entries
zero_1 | 2018/01/04 00:38:05 raft.go:400: Restarting node for dgraphzero
zero_1 | Running Dgraph zero...
zero_1 | 2018/01/04 00:38:05 raft.go:567: INFO: 1 became follower at term 3
zero_1 | 2018/01/04 00:38:05 raft.go:315: INFO: newRaft 1 [peers: [], term: 3, commit: 2057, applied: 0, lastindex: 2057, lastterm: 3]
version: '3'
services:
nginx:
image: nginx
labels:
traefik.backend: nginx
traefik.frontend.rule: Host:nginx.local
traefik.enable: "true"
Feature: Browsing Google
Scenario: Search
Given I browse "https://www.google.com/"
And I am on "/"
When I fill in "input[name='q']" with "Hello"
And I press "button[name='btnG']"
#And I wait 5 seconds
Then I should see 10 "div[class='g']" elements