From a9f96e335f6f982272629f62b2bdf42c9e7f47fa Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Fri, 22 Jul 2022 18:49:27 -0500 Subject: [PATCH] Updating data scrappers to new JSON data format and location. --- .../class/collectionFromRepository.language..st | 7 +++++-- .../SfAsset.class/class/collectionFromRepostory.st | 2 +- RoloLudo.package/SfAsset.class/instance/fromDictionary..st | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/RoloLudo.package/SfAsset.class/class/collectionFromRepository.language..st b/RoloLudo.package/SfAsset.class/class/collectionFromRepository.language..st index edbead4..980abdd 100644 --- a/RoloLudo.package/SfAsset.class/class/collectionFromRepository.language..st +++ b/RoloLudo.package/SfAsset.class/class/collectionFromRepository.language..st @@ -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 ] \ No newline at end of file +^ rawData collect: [:assetDict | + (assetDict at: #Assets) collect: [ :assetSubdict | + self new fromDictionary: assetSubdict; language: isoCode + ]. +] \ No newline at end of file diff --git a/RoloLudo.package/SfAsset.class/class/collectionFromRepostory.st b/RoloLudo.package/SfAsset.class/class/collectionFromRepostory.st index fea6a10..1b03a82 100644 --- a/RoloLudo.package/SfAsset.class/class/collectionFromRepostory.st +++ b/RoloLudo.package/SfAsset.class/class/collectionFromRepostory.st @@ -1,3 +1,3 @@ accessing collectionFromRepostory - ^ self collectionFromRepository: 'https://raw.githubusercontent.com/rsek/dataforged/main/assets.json' language: 'en' \ No newline at end of file + ^ self collectionFromRepository: 'https://raw.githubusercontent.com/rsek/dataforged/main/dist/starforged/assets.json' language: 'en' \ No newline at end of file diff --git a/RoloLudo.package/SfAsset.class/instance/fromDictionary..st b/RoloLudo.package/SfAsset.class/instance/fromDictionary..st index 295c41c..edaa15e 100644 --- a/RoloLudo.package/SfAsset.class/instance/fromDictionary..st +++ b/RoloLudo.package/SfAsset.class/instance/fromDictionary..st @@ -1,6 +1,6 @@ accessing fromDictionary: aDictionary name := aDictionary at: #Name. - category := aDictionary at: 'Asset Type'. - abilities := self populateAbilities: (aDictionary at: #Abilities) + category := aDictionary at: 'Name'. + abilities := self populateAbilities: (aDictionary at: #Abilities) \ No newline at end of file