Skip to content

Commit 1850ec1

Browse files
authored
Update README.md
1 parent 027b466 commit 1850ec1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ feed, _ := fp.ParseURLWithContext("http://feeds.twit.tv/twit.xml", ctx)
114114
fmt.Println(feed.Title)
115115
```
116116

117+
##### Parse a feed from an URL with a custom User-Agent:
118+
119+
```go
120+
fp := gofeed.NewParser()
121+
fp.UserAgent = "MyCustomAgent 1.0"
122+
feed, _ := fp.ParseURL("http://feeds.twit.tv/twit.xml")
123+
fmt.Println(feed.Title)
124+
```
125+
117126
#### Feed Specific Parsers
118127

119128
You can easily use the `rss.Parser`, `atom.Parser` or `json.Parser` directly if you have a usage scenario that requires it:

0 commit comments

Comments
 (0)