@@ -59,17 +59,17 @@ var (
5959const userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.4 Safari/605.1.15"
6060
6161// Extract fetches page and retrieves article
62- func (f UReadability ) Extract (ctx context.Context , reqURL string ) (* Response , error ) {
62+ func (f * UReadability ) Extract (ctx context.Context , reqURL string ) (* Response , error ) {
6363 return f .extractWithRules (ctx , reqURL , nil )
6464}
6565
6666// ExtractByRule fetches page and retrieves article using a specific rule
67- func (f UReadability ) ExtractByRule (ctx context.Context , reqURL string , rule * datastore.Rule ) (* Response , error ) {
67+ func (f * UReadability ) ExtractByRule (ctx context.Context , reqURL string , rule * datastore.Rule ) (* Response , error ) {
6868 return f .extractWithRules (ctx , reqURL , rule )
6969}
7070
7171// ExtractWithRules is the core function that handles extraction with or without a specific rule
72- func (f UReadability ) extractWithRules (ctx context.Context , reqURL string , rule * datastore.Rule ) (* Response , error ) {
72+ func (f * UReadability ) extractWithRules (ctx context.Context , reqURL string , rule * datastore.Rule ) (* Response , error ) {
7373 log .Printf ("[INFO] extract %s" , reqURL )
7474 rb := & Response {}
7575
@@ -140,7 +140,7 @@ func (f UReadability) extractWithRules(ctx context.Context, reqURL string, rule
140140// getContent retrieves content from raw body string, both content (text only) and rich (with html tags)
141141// if rule is provided, it uses custom rule, otherwise tries to retrieve one from the storage,
142142// and at last tries to use general readability parser
143- func (f UReadability ) getContent (ctx context.Context , body , reqURL string , rule * datastore.Rule ) (content , rich string , err error ) {
143+ func (f * UReadability ) getContent (ctx context.Context , body , reqURL string , rule * datastore.Rule ) (content , rich string , err error ) {
144144 // general parser
145145 genParser := func (body , _ string ) (content , rich string , err error ) {
146146 doc , err := readability .NewDocument (body )
@@ -192,7 +192,7 @@ func (f UReadability) getContent(ctx context.Context, body, reqURL string, rule
192192}
193193
194194// makes all links absolute and returns all found links
195- func (f UReadability ) normalizeLinks (data string , reqContext * http.Request ) (result string , links []string ) {
195+ func (f * UReadability ) normalizeLinks (data string , reqContext * http.Request ) (result string , links []string ) {
196196 absoluteLink := func (link string ) (absLink string , changed bool ) {
197197 if r , err := reqContext .URL .Parse (link ); err == nil {
198198 return r .String (), r .String () != link
0 commit comments