Skip to content

Commit

Permalink
Remove unused data
Browse files Browse the repository at this point in the history
  • Loading branch information
chunvv committed Mar 6, 2021
1 parent 04c731c commit e27a150
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions ogp.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"github.com/PuerkitoBio/goquery"
"github.com/julianshen/go-readability"
"io/ioutil"
"net/http"
"reflect"
Expand All @@ -18,19 +17,14 @@ type OgpImage struct {
Url string `meta:"og:image,og:image:url"`
Width int `meta:"og:image:width"`
Height int `meta:"og:image:height"`
Type string `meta:"og:image:type"`
}

// OgpPageInfo presents for article
type OgpPageInfo struct {
Title string `meta:"og:title"`
Type string `meta:"og:type"`
Url string `meta:"og:url"`
SiteName string `meta:"og:site_name"`
Description string `meta:"og:description"`
Locale string `meta:"og:locale"`
Images []*OgpImage
Content string
Title string `meta:"og:title"`
Url string `meta:"og:url"`
SiteName string `meta:"og:site_name"`
Images []*OgpImage
}

func GetPageDataFromHtml(html []byte, data interface{}) error {
Expand Down Expand Up @@ -62,14 +56,6 @@ func GetPageInfoFromResponse(response *http.Response) (*OgpPageInfo, error) {
if err != nil {
return nil, err
}

r, err := readability.NewDocument(string(html))
if err != nil {
return nil, err
}

info.Content = r.Text()

return &info, nil
}

Expand Down

0 comments on commit e27a150

Please sign in to comment.