Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Pipello authored May 17, 2024
1 parent b42cf6e commit f8df512
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Basic usage

The original aim of this package is to help scrapping expat.cz articles as such:

```golang
func main() {
link, err := scraper.FindLinkWith("weekend", scraper.BaseURL)
if err != nil {
log.Fatal(err)
}
ct, err := scraper.GetArticleContent(link)
if err != nil {
log.Fatal(err)
}
file, err := os.Create("events.json")
if err != nil {
log.Fatal(err)
}
err = json.NewEncoder(file).Encode(ct)
if err != nil {
log.Fatal(err)
}
}
```
giving result like this
```json
{
"Content": "On May 18, peruse military equipment and weapons at Atrium Flora, which will be transformed into a military base...",
"Title": "MILITARY MARVELS "
}
```

0 comments on commit f8df512

Please sign in to comment.