Skip to content
YQL database driver for golang.
Go
Find file
Latest commit c2d1079 Mar 3, 2016 @mattn Get Access Token
Failed to load latest commit information.
example Allow passing custom env to query Jan 7, 2016
README.md Update README.md Mar 17, 2015
yql.go Get Access Token Mar 3, 2016

README.md

YQL GoLang api wrapper

Simple Yql Queries

db, _ := sql.Open("yql", "")

stmt, err := db.Query(
    "select * from rss where url = ?",
    "http://blog.golang.org/feeds/posts/default?alt=rss")

if err != nil {
    return
}
for stmt.Next() {
    var data map[string]interface{}
    stmt.Scan(&data)
    fmt.Printf("%v\n", data["link"])
    fmt.Printf("  %v\n\n", data["title"])
}

Private Yql Queries

db, _ := sql.Open("yql", *conKey+"|"+*conSecret)

stmt, err := db.Query(
    "select * from contentanalysis.analyze where url=?",
    "http://www.espn.com")

if err != nil {
    return
}
for stmt.Next() {
    var data interface{}
    stmt.Scan(&data)
    fmt.Printf("%v\n", data)
}
Something went wrong with that request. Please try again.