Skip to content

Latest commit

 

History

History
64 lines (52 loc) · 1.51 KB

readme.md

File metadata and controls

64 lines (52 loc) · 1.51 KB

libplattentests-go

library to interact with plattentests.de from go

currently supports scraping the following:

usage

mainpage

import (
	"fmt"

	"github.com/janwillies/libplattentests-go/pkg/mainpage"
)

func main() {
    mc, err := mainpage.New()
    if err != nil {
        log.Fatal(err)
    }
    
    mainpage, err := mc.GetMainpage()
    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Printf("%+v\n", mainpage)
}

review

import (
	"fmt"

	"github.com/janwillies/libplattentests-go/pkg/reviews"
)
func main() {
    rc, err := reviews.New("https://www.plattentests.de/rezi.php?show=3073")
    if err != nil {
        log.Fatal(err)
    }
    
    review, err := rc.GetReview()
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("%+v\n", review)
}

tests

some initial tests, I'm sure there could be more. PRs welcome

$ go test -coverpkg=./... ./...

?   	github.com/janwillies/libplattentests-go	[no test files]
ok  	github.com/janwillies/libplattentests-go/pkg/mainpage	0.294s	coverage: 81.3% of statements in ./...
ok  	github.com/janwillies/libplattentests-go/pkg/reviews	0.434s	coverage: 86.0% of statements in ./...

credit

all credit goes to plattentests.de for maintaining such a cool project for over 20 years now!