Module:RandomArchiveVideo
Documentation for this module may be created at Module:RandomArchiveVideo/doc
local p = {} function p.main(frame) local http = require('http') -- Loads the http module explicitly now local xmlData = p.fetchXmlData(http) local videoUrl = p.getRandomVideoUrl(xmlData) return p.embedVideo(videoUrl) end function p.fetchXmlData(http) local url = 'https://tonyy.us-southeast-1.linodeobjects.com/' local result, data = pcall(http.get, url) if result then return data else return '' end end function p.getRandomVideoUrl(xmlData) return 'https://example.com/sample.mp4' -- Replace with actual logic pls end function p.embedVideo(videoUrl) local width = 640 local height = 360 return mw.getCurrentFrame():expandTemplate{ title = '#widget:Html5media', args = { url = videoUrl, width = width, height = height } } end return p