tore

package module
v0.0.0-...-f7c1ee7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2014 License: GPL-3.0 Imports: 6 Imported by: 0

README

tore

extract information for web page

How to use

package main

import (
    "log"
    "net/http"
    "time"

    "github.com/pengfei-xue/tore"
    "github.com/pengfei-xue/tore/libs"
)

func main() {
    log.Println("Runing on 0.0.0.0:8080")
    s := &http.Server{
        Addr:         "0.0.0.0:8080",
        Handler:      tore.NewHttpHandler(),
        ReadTimeout:  10 * time.Second,
        WriteTimeout: 10 * time.Second,
    }
    log.Fatal(s.ListenAndServe())
}

func init() {
    // tore.SetAlg("simple")
    tore.SetAlg("ttr")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetText

func GetText(url string) (string, string)

get text from url

func NewHttpHandler

func NewHttpHandler() http.Handler

handler http request

func SetAlg

func SetAlg(name string)

Types

type Page

type Page struct {
	Title string
	Text  template.HTML
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL