Code Monkey home page Code Monkey logo

nuscrape's People

Contributors

dependabot[bot] avatar fty4 avatar renovate[bot] avatar

Watchers

 avatar  avatar

nuscrape's Issues

add spielplan approved and note

🔽 low priority

sometimes the spielplan gets approved which could be added.
also sometimes a additional note will be at the last column.

spielplan approved should be one after the meeting report with id 9 (meeting report does not use ids).
the note will follow after spielplan approved and has id 10.

spielplan approved
<td nowrap="nowrap">
          <img alt="Spielbericht genehmigt" border="0" title="Spielbericht genehmigt" src="/WebObjects/nuLiga.woa/Frameworks/nuLigaFramework.framework/WebServerResources/img/icons/check.gif" width="13" height="11">
        </td>
note
<td nowrap="nowrap">
          <img border="0" alt="HT Halberstadt hat telefonisch abgesagt. SL MB" title="HT Halberstadt hat telefonisch abgesagt. SL MB" src="/WebObjects/nuLiga.woa/Frameworks/nuLigaFramework.framework/WebServerResources/img/icons/note_14x14.gif" width="14" height="14">&nbsp; 
          <span></span>
        </td>

example at: courtInfo?federation=HVSA&location=19274

Timezone not correct

In the func parseGermanTime a static timezone is used. This causes wrong display time in calendar.

func parseGermanTime(d, t string) time.Time {
split_date := strings.Split(d, ".")
datetimeFormatted := fmt.Sprintf("%s-%s-%sT%s:00.000Z", split_date[2], split_date[1], split_date[0], t)
dt, err := time.Parse(time.RFC3339, datetimeFormatted)
if err != nil {
fmt.Println(err)
}
return dt
}

add readme

Add a readme which describes the project

change GSP.Championship type

Currently only the Championship is a string element - all others are a own type:

// Matches represents a slice of multiple Match structs.
type Gesamtspielplan struct {
Matches []Match `json:"matches" binding:"required"`
Season season.Season `json:"season" binding:"required"`
Championship string `json:"championship" binding:"required"`
Group group.Group `json:"group" binding:"required"`
AgeCategory ageCategory.AgeCategory `json:"agecategory" binding:"required"`
Class class.Class `json:"class" binding:"required"`
Relay relay.Relay `json:"relay"`
}

It would be useful to also change the type and get the full name support here.

This would be great for e.g. GetDescription:

func (gsp Gesamtspielplan) GetDescription() string {
desc := ""
desc += "Liga: " + gsp.Championship + " - " + gsp.Class.GetName() + " " + gsp.Relay.GetName() + "\n"

Here only the Championship will be returned as abbreviation.

centralize urls for tests

The URL https://bhv-handball.liga.nu/cgi-bin/WebObjects/nuLigaHBDE.woa/wa/groupPage?championship=AV+2021%2F22&displayDetail=meetings&displayTyp=gesamt&group=281103 is mentioned for many tests - this should be centralized to be changed better.

Maybe it is possible to add a file with static configurations.

result annotation values

add result annotations as const or struct as e.g. relay or class.

This will be parsed here:

if regexp.MustCompile(`(WH|WG|NH|NG|ZH|ZG)`).MatchString(resultString) {
// check if result annotation is available
// this may be the case if e.g. the game has been postponed
attr, isAttr := html_element.Attr("alt")
if isAttr {
annotation = attr
}

The values are as described here:

Legende
v ... Spiel wurde in/auf genannte/n Halle/Termin verlegt
u ... Spiel wird in/auf noch unbekannte/n Halle/Termin verlegt
h ... Halle wurde geändert
t ... Heimrecht wurde getauscht
NH ... Heimmannschaft nicht angegreten
NG ... Gastmannschaft nicht angetreten
N2 ... Heim- und Gastmannschaft nicht angetreten
WH ... Wertung gegen Heimmannschaft
WG ... Wertung gegen Gastmannschaft
W2 ... Wertung gegen Heim- und Gastmannschaft
U ... Begegnung wurde umgewertet
ZH ... Heimmannschaft zurückgezogen
ZG ... Gastmannschaft zurückgezogen

example in gsp:

{"season": "2021_22", "championship": "AV", "group": "273516"}

example from sourcecode:

<td nowrap="nowrap" alt="Wertung gegen Gastmannschaft" class="center" title="Wertung gegen Gastmannschaft">
          
           
	          
          	WG&nbsp;
          
        </td>

Add build pipeline

Add a pipeline to build the app and if possible add it as asset to releases

Add API doc

If possible add swagger file or equal to describe the API

match id always zero

The match id will always be zero in the JSON response instead of e.g. 27031301.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
Dockerfile
github-actions
.github/workflows/build.yml
  • actions/checkout v3
  • docker/login-action v2.0.0
  • docker/metadata-action v4.0.1
  • docker/build-push-action v3.0.0
.github/workflows/codecov.yml
  • actions/checkout v3
  • actions/setup-go v3
.github/workflows/labeler.yml
  • actions/labeler v4
.github/workflows/release-drafter.yml
  • release-drafter/release-drafter v5
.github/workflows/test.yml
  • actions/checkout v3
  • actions/setup-go v3
gomod
go.mod
  • go 1.17
  • github.com/PuerkitoBio/goquery v1.8.0
  • github.com/gin-gonic/gin v1.8.1
  • github.com/gocolly/colly v1.2.0
  • github.com/sirupsen/logrus v1.8.1
  • github.com/stretchr/testify v1.8.0
  • github.com/taskmedia/roundrobintournament v1.1.0
helm-values
k8s/helm/values.yaml

  • Check this box to trigger a request for Renovate to run again on this repository

Full parsing test

Add a full parsing test (old season) which checks if the generated Gesamtspielplan struct will be correctly parsed and created.

labeler not adding expected labels

the added labeler configuration from #38 did not work as expected in #39.

  • if a README.md will be added / modified it should be added (also subdirectories)
  • k8s/ changes were not tracked

dockerize the app

Add a Dockerfile to containerize the application (automatic upload at build)

depends on #10

GroupID and MatchId not available

The following table was present at 2021_22/SW/273332:

Screenshot 2021-11-15 at 21 21 06

red: no match id was present
orange: no location id was present

this occured in following log messages:

{
  "error":"strconv.Atoi: parsing \"\": invalid syntax",
  "level":"warning",
  "locationId":"",
  "msg":"can not parse location ID",
  "time":"2021-11-15T21:23:30+01:00"
}

The error is no problem because no location was given.

But to avoid invalid matches to be added to the DB it is required to check if the ID of the match is 0.
In this case the match entry should be dropped.

Go routine

run go scripts as go routine (async) - this may help performance on multi requests?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.