Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rjeczalik/kkm
Get your ticket payment history or reverse lookup your personal details with your student card ID.
https://github.com/rjeczalik/kkm
Last synced: about 2 months ago
JSON representation
Get your ticket payment history or reverse lookup your personal details with your student card ID.
- Host: GitHub
- URL: https://github.com/rjeczalik/kkm
- Owner: rjeczalik
- License: bsd-3-clause
- Created: 2015-03-25T08:54:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-25T20:20:19.000Z (almost 10 years ago)
- Last Synced: 2024-06-21T01:44:09.857Z (6 months ago)
- Language: Go
- Homepage: http://mpk.krakow.pl/pl/sprawdz-waznosc-biletu
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
kkm [![GoDoc](https://godoc.org/github.com/rjeczalik/kkm?status.svg)](https://godoc.org/github.com/rjeczalik/kkm)
---Get your ticket payment history or reverse lookup your personal details with your student card ID.
### License
Although the kkm project is licensed under the 3-clause BSD license, by using commands and libraries included herewith you must not lookup student card IDs and/or KKM card IDs that do not belong to you.
(§5.3 [Regulamin](https://ebilet.kkm.krakow.pl/ebilet/Content/Files/REGULAMIN.pdf))
### cmd/kkm-history [![GoDoc](https://godoc.org/github.com/rjeczalik/kkm/cmd/kkm-history?status.svg)](https://godoc.org/github.com/rjeczalik/kkm/cmd/kkm-history)
Get your ticket payment history. Outputs `[]kkm.Ticket` in JSON, sorted by `PurchasedAt` field in increasing order. The `kkm.Ticket` is defined as:
```go
type Ticket struct {
PurchasedAt time.Time `json:"purchased_at"`
ExpiredAt time.Time `json:"expires_at"`
Type string `json:"type"`
Price int `json:"price"`
StudentID int `json:"student_id"`
KKMID int `json:"kkm_id"`
}
```Times are always in UTC. The price is a decimal with scale=2.
*Installation*
```bash
~ $ go get -u github.com/rjeczalik/kkm/cmd/kkm-history
```*Example*
```bash
~ $ kkm-history -card UJ -id 1234567
[
{
"purchased_at": "2014-12-10T07:04:00Z",
"expires_at": "2015-01-09T00:00:00Z",
"type": "Ulgowy | Wszystkie dni tygodnia",
"price": 4900,
"student_id": 123456722,
"kkm_id": 1234567890
},
{
"purchased_at": "2015-01-13T07:25:00Z",
"expires_at": "2015-02-12T00:00:00Z",
"type": "Ulgowy | Wszystkie dni tygodnia",
"price": 4900,
"student_id": 123456722,
"kkm_id": 1234567890
}
]
```### cmd/kkm-detail [![GoDoc](https://godoc.org/github.com/rjeczalik/kkm/cmd/kkm-history?status.svg)](https://godoc.org/github.com/rjeczalik/kkm/cmd/kkm-history)
Reverse lookup your personal details with your student card ID (`(kkm.Ticket).StudentID`) and KKM card ID (`(kkm.Ticket).KKMID`). Outputs `*kkm.Detail` in JSON. The `kkm.Detail` is defined as:
```go
type Detail struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
Phone string `json:"phone"`
}
```The `Email` and `Phone` may be empty.
*Installation*
```bash
~ $ go get -u github.com/rjeczalik/kkm/cmd/kkm-detail
```*Example*
```bash
~ $ kkm-detail -id 123456722 -kkm 1234567890
{
"first_name": "Twoja",
"last_name": "Stara",
"email": "Pierze",
"phone": "W rzece"
}
```