28 lines
650 B
Lua
28 lines
650 B
Lua
|
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()
|