Updating data scrappers to new JSON data format and location.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-07-22 18:49:27 -05:00
parent 66526fb8da
commit a9f96e335f
3 changed files with 8 additions and 5 deletions

View File

@ -2,5 +2,8 @@ accessing
collectionFromRepository: jsonFileUrl language: isoCode
| rawData |
rawData := STON fromString: jsonFileUrl asUrl retrieveContents.
^ (rawData at: 'Assets') collect: [:assetDict |
self new fromDictionary: assetDict; language: isoCode ]
^ rawData collect: [:assetDict |
(assetDict at: #Assets) collect: [ :assetSubdict |
self new fromDictionary: assetSubdict; language: isoCode
].
]

View File

@ -1,3 +1,3 @@
accessing
collectionFromRepostory
^ self collectionFromRepository: 'https://raw.githubusercontent.com/rsek/dataforged/main/assets.json' language: 'en'
^ self collectionFromRepository: 'https://raw.githubusercontent.com/rsek/dataforged/main/dist/starforged/assets.json' language: 'en'

View File

@ -1,6 +1,6 @@
accessing
fromDictionary: aDictionary
name := aDictionary at: #Name.
category := aDictionary at: 'Asset Type'.
category := aDictionary at: 'Name'.
abilities := self populateAbilities: (aDictionary at: #Abilities)