Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initialization of go-charset #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bobuhiro11
Copy link

The init function defined in the go-charset package must be called.
The following code causes a related bug.

$ cat test.go
package main

import (
        "github.com/advancedlogic/GoOse"
)

func main() {
        g := goose.New()
        url := "http://blog.livedoor.jp/unahide/archives/52966628.html"
        article, _ := g.ExtractFromURL(url)
        println("title", article.Title)
        println("description", article.MetaDescription)
        println("keywords", article.MetaKeywords)
        println("content", article.CleanedText)
        println("url", article.FinalURL)
        println("top image", article.TopImage)
}
$ go run test.go
charset: cannot open "charsets.json": open /usr/local/lib/go-charset/datafiles/charsets.json: no such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant