trunk
nate smith 2023-05-25 21:13:30 -07:00
parent 8652c31ed8
commit 1447b954d5
4 changed files with 4 additions and 301 deletions

1
.gitignore vendored 100644
View File

@ -0,0 +1 @@
*.swp

3
go.mod 100644
View File

@ -0,0 +1,3 @@
module git.tilde.town/vilmibm/longway
go 1.18

13
main.go
View File

@ -11,18 +11,11 @@ import (
"time" "time"
) )
//go:embed platforms.json
var platformJSON []byte
type Platform struct { type Platform struct {
ID int `json:"platform_id"` ID int `json:"platform_id"`
Name string `json:"platform_name"` Name string `json:"platform_name"`
} }
type platformData struct {
Platforms []Platform
}
type gameData struct { type gameData struct {
Games []struct { Games []struct {
Title string Title string
@ -34,12 +27,6 @@ func _main(apiKey string) error {
var foundGame string var foundGame string
var foundPlatform string var foundPlatform string
var pd platformData
if err := json.Unmarshal(platformJSON, &pd); err != nil {
panic(err)
}
//ps := pd.Platforms
v := url.Values{} v := url.Values{}
v.Add("format", "normal") v.Add("format", "normal")
v.Add("api_key", apiKey) v.Add("api_key", apiKey)

View File

@ -1,288 +0,0 @@
{
"platforms": [
{
"platform_id": 35,
"platform_name": "3DO"
},
{
"platform_id": 265,
"platform_name": "Altair 680"
},
{
"platform_id": 222,
"platform_name": "Altair 8800"
},
{
"platform_id": 19,
"platform_name": "Amiga"
},
{
"platform_id": 56,
"platform_name": "Amiga CD32"
},
{
"platform_id": 245,
"platform_name": "Apple I"
},
{
"platform_id": 31,
"platform_name": "Apple II"
},
{
"platform_id": 51,
"platform_name": "Apple IIgs"
},
{
"platform_id": 28,
"platform_name": "Atari 2600"
},
{
"platform_id": 33,
"platform_name": "Atari 5200"
},
{
"platform_id": 34,
"platform_name": "Atari 7800"
},
{
"platform_id": 92,
"platform_name": "BBC Micro"
},
{
"platform_id": 73,
"platform_name": "CD-i"
},
{
"platform_id": 29,
"platform_name": "ColecoVision"
},
{
"platform_id": 27,
"platform_name": "Commodore 64"
},
{
"platform_id": 2,
"platform_name": "DOS"
},
{
"platform_id": 8,
"platform_name": "Dreamcast"
},
{
"platform_id": 102,
"platform_name": "FM Towns"
},
{
"platform_id": 10,
"platform_name": "Game Boy"
},
{
"platform_id": 12,
"platform_name": "Game Boy Advance"
},
{
"platform_id": 11,
"platform_name": "Game Boy Color"
},
{
"platform_id": 25,
"platform_name": "Game Gear"
},
{
"platform_id": 14,
"platform_name": "GameCube"
},
{
"platform_id": 16,
"platform_name": "Genesis"
},
{
"platform_id": 30,
"platform_name": "Intellivision"
},
{
"platform_id": 17,
"platform_name": "Jaguar"
},
{
"platform_id": 18,
"platform_name": "Lynx"
},
{
"platform_id": 57,
"platform_name": "MSX"
},
{
"platform_id": 74,
"platform_name": "Macintosh"
},
{
"platform_id": 135,
"platform_name": "Mattel Aquarius"
},
{
"platform_id": 97,
"platform_name": "Microvision"
},
{
"platform_id": 32,
"platform_name": "N-Gage"
},
{
"platform_id": 22,
"platform_name": "NES"
},
{
"platform_id": 36,
"platform_name": "Neo Geo"
},
{
"platform_id": 52,
"platform_name": "Neo Geo Pocket"
},
{
"platform_id": 53,
"platform_name": "Neo Geo Pocket Color"
},
{
"platform_id": 174,
"platform_name": "New Nintendo 3DS"
},
{
"platform_id": 101,
"platform_name": "Nintendo 3DS"
},
{
"platform_id": 9,
"platform_name": "Nintendo 64"
},
{
"platform_id": 44,
"platform_name": "Nintendo DS"
},
{
"platform_id": 75,
"platform_name": "Odyssey"
},
{
"platform_id": 78,
"platform_name": "Odyssey 2"
},
{
"platform_id": 149,
"platform_name": "PC-6001"
},
{
"platform_id": 201,
"platform_name": "PC-8000"
},
{
"platform_id": 94,
"platform_name": "PC-88"
},
{
"platform_id": 95,
"platform_name": "PC-98"
},
{
"platform_id": 59,
"platform_name": "PC-FX"
},
{
"platform_id": 105,
"platform_name": "PS Vita"
},
{
"platform_id": 46,
"platform_name": "PSP"
},
{
"platform_id": 112,
"platform_name": "Pippin"
},
{
"platform_id": 6,
"platform_name": "PlayStation"
},
{
"platform_id": 7,
"platform_name": "PlayStation 2"
},
{
"platform_id": 81,
"platform_name": "PlayStation 3"
},
{
"platform_id": 21,
"platform_name": "SEGA 32X"
},
{
"platform_id": 20,
"platform_name": "SEGA CD"
},
{
"platform_id": 26,
"platform_name": "SEGA Master System"
},
{
"platform_id": 23,
"platform_name": "SEGA Saturn"
},
{
"platform_id": 15,
"platform_name": "SNES"
},
{
"platform_id": 131,
"platform_name": "Sinclair QL"
},
{
"platform_id": 127,
"platform_name": "SuperGrafx"
},
{
"platform_id": 40,
"platform_name": "TurboGrafx-16"
},
{
"platform_id": 38,
"platform_name": "Virtual Boy"
},
{
"platform_id": 82,
"platform_name": "Wii"
},
{
"platform_id": 132,
"platform_name": "Wii U"
},
{
"platform_id": 3,
"platform_name": "Windows"
},
{
"platform_id": 13,
"platform_name": "Xbox"
},
{
"platform_id": 69,
"platform_name": "Xbox 360"
},
{
"platform_id": 41,
"platform_name": "ZX Spectrum"
},
{
"platform_id": 118,
"platform_name": "ZX80"
},
{
"platform_id": 119,
"platform_name": "ZX81"
},
{
"platform_id": 211,
"platform_name": "Zune"
}
]
}