Coder Social home page Coder Social logo

go-yql's Introduction

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)
}

go-yql's People

Contributors

agentydragon avatar araddon avatar mattn avatar vifino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-yql's Issues

Inconsistent results while pulling info from yahoo.finance.quotes

Hello,

Curious about a behaviour I'm observing.

The following query works well :
select * from yahoo.finance.quotes where symbol in ("bnp.pa","bcp.ls")

While this one gets an error

"YQL query failed : Unsupported result"

select * from yahoo.finance.quotes where symbol in ("bnp.pa")

Any idea ?

Thanks in advance.

Stéphane

oauth doesn't work

I tried with my own key and secret today. And I got this error.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0xda7d8]

goroutine 1 [running]:
github.com/akrennmair/goauth.(_OAuthConsumer).oAuthRequest(0xc820061a78, 0x3b57c0, 0x28, 0xc820010620, 0x2, 0x3, 0x0, 0x354e50, 0x3, 0x3, ...)
/Users/jianyangzhao/tmp/src/github.com/akrennmair/goauth/oauthconsumer.go:269 +0x23d8
github.com/akrennmair/goauth.(_OAuthConsumer).Get(0xc820061a78, 0x3b57c0, 0x28, 0xc820010620, 0x2, 0x3, 0x0, 0x1, 0x0, 0x0)
/Users/jianyangzhao/tmp/src/github.com/akrennmair/goauth/oauthconsumer.go:253 +0x96
github.com/mattn/go-yql.(_YQLStmt).Query(0xc8200105c0, 0x50ef38, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/Users/jianyangzhao/tmp/src/github.com/mattn/go-yql/yql.go:107 +0x66e
database/sql.rowsiFromStatement(0x704620, 0xc82001a180, 0x7045e0, 0xc8200105c0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/database/sql/sql.go:1536 +0x3ba
database/sql.(_DB).queryConn(0xc82009a320, 0xc82001a180, 0xc82000ad70, 0x3e4cc0, 0x91, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/database/sql/sql.go:1004 +0x48b
database/sql.(_DB).query(0xc82009a320, 0x3e4cc0, 0x91, 0x0, 0x0, 0x0, 0x1, 0x28e6d, 0x0, 0x0)
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/database/sql/sql.go:964 +0x126
database/sql.(_DB).Query(0xc82009a320, 0x3e4cc0, 0x91, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/database/sql/sql.go:947 +0xa3
main.main()
/Users/jianyangzhao/tmp/src/yqltest.go:16 +0x168

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [chan receive]:
database/sql.(*DB).connectionOpener(0xc82009a320)
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/database/sql/sql.go:634 +0x45
created by database/sql.Open
/opt/boxen/homebrew/Cellar/go/1.5.3/libexec/src/database/sql/sql.go:481 +0x336
exit status 2

exit status 1

LICENSE missing

Does this code have a license associated with it?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.