Skip to content
This repository has been archived by the owner on May 30, 2021. It is now read-only.

Commit

Permalink
remove Example check #84
Browse files Browse the repository at this point in the history
  • Loading branch information
sotetsuk committed May 8, 2016
1 parent 05fda31 commit 6b13937
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ $ goscholar -h

```go
// create Query and generate URL
q := Query{Keywords:"deep learning", Author:"y bengio"}
url = q.SearchUrl()
q := Query{Keywords:"nature 2015", Author:"y bengio", Title:"Deep learning"}
url := q.SearchUrl()

// fetch document sending the request to the URL
doc, err := goscholar.Fetch(url)
doc, err := Fetch(url)
if err != nil {
log.Error(err)
log.Error(err)
return
}

// parse articles
ch := make(chan *goscholar.Article, 10)
go goscholar.ParseDocument(ch, doc)

ch := make(chan *Article, 10)
go ParseDocument(ch, doc)
for a := range ch {
fmt.Println("---")
fmt.Println(a)
}
```
Expand Down
30 changes: 8 additions & 22 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,38 +75,24 @@ func checkWithFirst(doc *goquery.Document, aExpected *Article) (err error) {
}

func Example() {
ch := make(chan *Article, 10)

// create Query and generate URL
q := Query{Keywords:"nature 2015", Author:"y bengio", Title:"Deep learning"}
url := q.SearchUrl()

// fetch document sending the request to the URL
doc, err := Fetch(url)
if err != nil {
log.Error(err)
return
}

// parse articles
ch := make(chan *Article, 10)
go ParseDocument(ch, doc)
a := <- ch
fmt.Println(a)
// Output:
/*[Title]
Name: Deep learning
Url: http://www.nature.com/nature/journal/v521/n7553/abs/nature14539.html
[Year]
2015
[ClusterId]
5362332738201102290
[NumCite]
390
[NumVer]
7
[InfoId]
0qfs6zbVakoJ
[Link]
Name: psu.edu
Url: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.436.894&rep=rep1&type=pdf
Format: PDF*/
for a := range ch {
fmt.Println("---")
fmt.Println(a)
}
}

func TestParseSelection(t *testing.T) {
Expand Down

0 comments on commit 6b13937

Please sign in to comment.