From 7db782ee1ae7ef5847e064e0925a67338a3c5f88 Mon Sep 17 00:00:00 2001 From: Steven Selph Date: Sun, 5 Feb 2017 15:32:48 -0500 Subject: [PATCH] Add arcadeitalia database --- adb/adb.go | 32 ++++++++++++++++---------------- ds/adb.go | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/adb/adb.go b/adb/adb.go index 0806598..bad74dc 100644 --- a/adb/adb.go +++ b/adb/adb.go @@ -1,17 +1,17 @@ package adb -import( +import ( + "encoding/json" "errors" "fmt" + "io/ioutil" "net/http" "net/url" - "encoding/json" - "io/ioutil" ) const ( baseURL = "http://adb.arcadeitalia.net" - path = "/service_scraper.php" + path = "/service_scraper.php" ) var Source = "adb.arcadeitalia.net" @@ -20,19 +20,19 @@ var Source = "adb.arcadeitalia.net" var ErrNotFound = errors.New("rom not found") type Result struct { - ID string `json:"game_name"` - Genre string `json:"genre"` - History string `json:"history"` - CopyRightLong string `json:"history_copyright_long"` + ID string `json:"game_name"` + Genre string `json:"genre"` + History string `json:"history"` + CopyRightLong string `json:"history_copyright_long"` CopyRightShort string `json:"history_copyright_short"` - Manufacturer string `json:"manufacturer"` - Players string `json:"players"` - Name string `json:"title"` - Cabinet string `json:"url_image_cabinet"` - Snap string `json:"url_image_ingame"` - Marquee string `json:"url_image_marquee"` - Title string `json:"url_image_title"` - Year string `json:"year"` + Manufacturer string `json:"manufacturer"` + Players string `json:"players"` + Name string `json:"title"` + Cabinet string `json:"url_image_cabinet"` + Snap string `json:"url_image_ingame"` + Marquee string `json:"url_image_marquee"` + Title string `json:"url_image_title"` + Year string `json:"year"` } type GameResp struct { diff --git a/ds/adb.go b/ds/adb.go index 59a1258..00f53aa 100644 --- a/ds/adb.go +++ b/ds/adb.go @@ -2,9 +2,9 @@ package ds import ( "fmt" + "path/filepath" "regexp" "strconv" - "path/filepath" "github.com/sselph/scraper/adb" ) @@ -12,7 +12,7 @@ import ( var bioRE = regexp.MustCompile(`- (CAST|CONTRIBUTE|PORTS|SCORING|SERIES|STAFF|TECHNICAL|TRIVIA|UPDATES) -`) // ADB is a Data Source using arcadeitalia and arcade-history. -type ADB struct {} +type ADB struct{} // getID gets the ID for the game.. func (a *ADB) getID(p string) (string, error) {