Starting NitterInstance modelling.
This commit is contained in:
parent
27a8a66dd3
commit
abc2752292
@ -1,3 +0,0 @@
|
|||||||
accessing
|
|
||||||
columnKeys
|
|
||||||
^ #('url' 'healthy' 'healthy_percentage_overall' 'rss' 'version')
|
|
@ -0,0 +1,8 @@
|
|||||||
|
accessing
|
||||||
|
columnsDictionary
|
||||||
|
^ {
|
||||||
|
'url' -> 'url' .
|
||||||
|
'healthy' -> 'healthy'.
|
||||||
|
'healthy_percentage_overall' -> 'uptime' .
|
||||||
|
'rss' -> 'rss' .
|
||||||
|
'version' -> 'version'} asDictionary
|
@ -1,7 +1,8 @@
|
|||||||
accessing
|
accessing
|
||||||
instanceRows
|
instanceRows
|
||||||
^ (self instances at: 'hosts') collect: [:rawRow | | newRow |
|
^ (self instances at: 'hosts') collect: [:rawRow | | newRow |
|
||||||
newRow := OrderedCollection new.
|
newRow := NitterInstance new.
|
||||||
self columnKeys do: [:key | newRow add: (rawRow at: key) ].
|
self columnsDictionary keysAndValuesDo: [:key :value |
|
||||||
|
newRow writeSlotNamed: value value: (rawRow at: key) ].
|
||||||
newRow
|
newRow
|
||||||
].
|
].
|
@ -1,4 +1,3 @@
|
|||||||
accessing
|
accessing
|
||||||
instances
|
instances
|
||||||
|
^ self instancesCache
|
||||||
^ STONJSON fromString: 'https://status.d420.de/api/v1/instances' asUrl retrieveContents
|
|
@ -0,0 +1,9 @@
|
|||||||
|
accessing
|
||||||
|
instancesCache
|
||||||
|
| cache cacheFile |
|
||||||
|
cacheFile := FileLocator temp / 'nitter-instances.ston'.
|
||||||
|
cacheFile exists
|
||||||
|
ifFalse: [
|
||||||
|
cache := STON fromString: 'https://status.d420.de/api/v1/instances' asUrl retrieveContents.
|
||||||
|
MarkupFile exportAsFileOn: cacheFile containing: cache ].
|
||||||
|
^ STON fromString: cacheFile contents
|
@ -11,6 +11,6 @@ viewInstancesFor: aView
|
|||||||
columnNames doWithIndex: [:aName :index |
|
columnNames doWithIndex: [:aName :index |
|
||||||
columnedList
|
columnedList
|
||||||
column: aName
|
column: aName
|
||||||
text: [:instanceRow | (instanceRow at: index) ifNil: [''] ]
|
text: [:instanceRow | (instanceRow slots at: index) ifNil: [''] ]
|
||||||
].
|
].
|
||||||
^ columnedList
|
^ columnedList
|
@ -0,0 +1,5 @@
|
|||||||
|
accessing
|
||||||
|
printOn: aStream
|
||||||
|
super printOn: aStream.
|
||||||
|
^ aStream
|
||||||
|
nextPutAll: '( ', self url ,' | uptime: ', self uptime asString, ' )'
|
@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
uptime
|
||||||
|
^ uptime
|
@ -0,0 +1,3 @@
|
|||||||
|
accessing
|
||||||
|
url
|
||||||
|
^ url
|
17
Socialmetrica.package/NitterInstance.class/properties.json
Normal file
17
Socialmetrica.package/NitterInstance.class/properties.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"commentStamp" : "",
|
||||||
|
"super" : "Object",
|
||||||
|
"category" : "Socialmetrica",
|
||||||
|
"classinstvars" : [ ],
|
||||||
|
"pools" : [ ],
|
||||||
|
"classvars" : [ ],
|
||||||
|
"instvars" : [
|
||||||
|
"url",
|
||||||
|
"healthy",
|
||||||
|
"uptime",
|
||||||
|
"rss",
|
||||||
|
"version"
|
||||||
|
],
|
||||||
|
"name" : "NitterInstance",
|
||||||
|
"type" : "normal"
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user