Skip to content

Commit 8b5150f

Browse files
committed
Merge branch 'master' of github.com:dyatlov/go-opengraph
2 parents 9bddacb + 63dbe25 commit 8b5150f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func main() {
3737
<meta property="og:url" content="https://wordpress.org/news/2015/08/billie/" /></head><body></body></html>`
3838

3939
og := opengraph.NewOpenGraph()
40-
err := og.ProcessHTML(strings.NewReader(html))
40+
err := og.ProcessHTML(strings.NewReader(html))
4141

4242
if err != nil {
4343
fmt.Println(err)
@@ -60,27 +60,27 @@ Example:
6060
package main
6161

6262
import (
63-
"fmt"
64-
"strings"
63+
"fmt"
64+
"strings"
6565

66-
"golang.org/x/net/html"
67-
"github.com/dyatlov/go-opengraph/opengraph"
66+
"github.com/dyatlov/go-opengraph/opengraph"
67+
"golang.org/x/net/html"
6868
)
6969

7070
func main() {
71-
h := `<html><head><meta property="og:type" content="article" />
71+
h := `<html><head><meta property="og:type" content="article" />
7272
<meta property="og:title" content="WordPress 4.3 &quot;Billie&quot;" />
7373
<meta property="og:url" content="https://wordpress.org/news/2015/08/billie/" /></head><body></body></html>`
7474

75-
og := opengraph.NewOpenGraph()
75+
og := opengraph.NewOpenGraph()
7676

77-
doc, err := html.Parse(strings.NewReader(h))
77+
doc, err := html.Parse(strings.NewReader(h))
7878
if err != nil {
79-
fmt.Println(err)
80-
return
79+
fmt.Println(err)
80+
return
8181
}
8282

83-
var parseHead func(*html.Node)
83+
var parseHead func(*html.Node)
8484
parseHead = func(n *html.Node) {
8585
for c := n.FirstChild; c != nil; c = c.NextSibling {
8686
if c.Type == html.ElementNode && c.Data == "meta" {
@@ -110,9 +110,9 @@ func main() {
110110
}
111111
f(doc)
112112

113-
fmt.Printf("Type: %s\n", og.Type)
114-
fmt.Printf("Title: %s\n", og.Title)
115-
fmt.Printf("URL: %s\n", og.URL)
116-
fmt.Printf("String/JSON Representation: %s\n", og)
113+
fmt.Printf("Type: %s\n", og.Type)
114+
fmt.Printf("Title: %s\n", og.Title)
115+
fmt.Printf("URL: %s\n", og.URL)
116+
fmt.Printf("String/JSON Representation: %s\n", og)
117117
}
118118
```

0 commit comments

Comments
 (0)