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)
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:
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
~ $ go get -u github.com/rjeczalik/kkm/cmd/kkm-history
Example
~ $ 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
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:
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
~ $ go get -u github.com/rjeczalik/kkm/cmd/kkm-detail
Example
~ $ kkm-detail -id 123456722 -kkm 1234567890
{
"first_name": "Twoja",
"last_name": "Stara",
"email": "Pierze",
"phone": "W rzece"
}