After launching up XM Core BBS a few years ago. One has found that there are areas of improvement. To achieve this we have started writing up some utililties to help.
Last Callers
#!/usr/bin/env python3
# lastcallers.py
# (CC No-By)2019-2034 Dallas Makerspace, Some Rights Reserved.
# : Authors: Dwight Spencer (denzuko) <[email protected]>
## TODO workout OptionData Array[1..10] of String[60] and Array[1..53] of Byte/“B”
## Reference
## http://donsnotes.com/tech/charsets/ascii.html
## https://en.wikipedia.org/wiki/C_data_types
## http://wiki.freepascal.org/Data_type
## https://docs.python.org/2/library/struct.html#examples
## Record “header”: http://web.synchro.net/?page=001-forum.ssjs&sub=fsx_mys&thread=1212
import os
import sys
from struct import Struct
Callers_t = Struct(“I ? 15s 50s B I 30s 25s 30s B 35s 30s 60s 54?”)
def main(callers=“callers.dat”):
with open(callers, ‘rb’).read() as data:
for caller in data:
print(Callers_t.unpack_from(data)[6].replace(“\t”, ‘’).strip())
# last caller or first caller ^^
If __name__ == ‘__main__’:
main()
Last callers is the beginning of the conversion from PASCAL headers found in docs/records.### over to a modern language. This is far from end all but merely the first steps. In this script we start parsing the callers.dat
file for user names that have visited the board recently (up to the last 10) and print that out to STDOUT. Later iterations would place this on a mqtt subject for consumption by the website and influxdata’s telegraf.
Furthermore this series will dive into how to process messages areas and other data formats used by BBS’s.
As always, releases will go live on XM Core and Dallas Makerspace’s Github.