Skip to content
Permalink
Browse files

first connect attempts

  • Loading branch information...
k4k committed Sep 14, 2017
1 parent da2fe99 commit 1dd7b1ba6fbb1a9160524eeffc9e16936c3c1ce9
Showing with 18 additions and 0 deletions.
  1. +18 −0 main.go
18 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"
}
@@ -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 {

0 comments on commit 1dd7b1b

Please sign in to comment.
You can’t perform that action at this time.