ComputerCraft/RSS/main.lua

28 lines
650 B
Lua
Raw Normal View History

2024-03-10 23:45:44 +03:00
local LOG = require('log')
local GRAPHICS = require('graphics')
local FEEDS = require('feeds')
local REFRESH_INTERVAL = 8
local DEBUG = true
local MONITOR = assert(peripheral.find('monitor'), "No monitor detected")
local function main()
LOG:Info("RSS System init")
LOG:SetDebug(DEBUG)
LOG:SetTarget(term)
LOG:SetColours()
GRAPHICS:SetTarget(MONITOR)
GRAPHICS:SetColours()
local err = FEEDS:Load()
if err ~= nil then
return
end
LOG:Success("System fully loaded, beginning RSS processing")
while true do
GRAPHICS:Add(FEEDS:ParseLatest())
sleep(REFRESH_INTERVAL)
end
end
main()