Skip to content

Commit

Permalink
first connect attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
tedwardd committed Sep 14, 2017
1 parent da2fe99 commit 1dd7b1b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions main.go
@@ -1,12 +1,26 @@
package main

import (
"fmt"
"io"
"net/http"
"time"

"github.com/clarkf/libirc"
"golang.org/x/net/html"
)

func ircConnect(svr string, cnl string) {
c := libirc.NewClient("webby", "webby-bot", "Webby Bot")

connErr := c.ConnectAndListen(fmt.Sprintf("%s:6667", svr))
if connErr != nil {
panic(connErr)
}

c.Join(cnl)
}

func isTitleElement(n *html.Node) bool {
return n.Type == html.ElementNode && n.Data == "title"
}
Expand Down Expand Up @@ -35,6 +49,10 @@ func GetHtmlTitle(r io.Reader) (string, bool) {
}

func main() {

ircConnect("irc.freenode.net", "#foaas")
time.Sleep(time.Duration(5) * time.Second)

url := "http://google.com"
resp, getErr := http.Get(url)
if getErr != nil {
Expand Down

0 comments on commit 1dd7b1b

Please sign in to comment.