Module:RandomSaintMedia
Jump to navigation
Jump to search
Documentation for this module may be created at Module:RandomSaintMedia/doc
-- Random saint media pools for Portal:Media featured player
-- Pools are curated page-title suffixes under Creator/
local p = {}
local pools = {
["Catholic Online"] = {
prefix = "Catholic Online/",
pages = {
"Blessed Mother Teresa of Calcutta HD",
"Mary, the Blessed Virgin HD",
"Mary, the Blessed Virgin Mother HD",
"Our Lady Of Guadalupe",
"Our Lady Of Guadalupe HD",
"Our Lady of Fatima",
"Our Lady of Fatima HD",
"Pope St. Gregory the Great HD",
"Santa Rosa de Lima HD",
"St. Abigail HD",
"St. Agatha",
"St. Agatha HD",
"St. Agnes",
"St. Agnes HD",
"St. Albert the Great",
"St. Albert the Great HD",
"St. Ambrose",
"St. Ambrose HD",
"St. Anastasia",
"St. Anastasia HD",
"St. Andrew",
"St. Andrew HD",
"St. Angela Merici HD",
"St. Anthony of Padua",
"St. Anthony of Padua HD",
"St. Athanasius HD",
"St. Augustine of Hippo",
"St. Augustine of Hippo HD",
"St. Barbara",
"St. Barbara HD",
"St. Benedict",
"St. Benedict HD",
"St. Bernadette",
"St. Bernadette HD",
"St. Blaise",
"St. Boniface",
"St. Brigid of Ireland",
"St. Brigid of Ireland HD",
"St. Catherine of Alexandria",
"St. Catherine of Alexandria HD",
},
},
["Franciscan Media"] = {
prefix = "Franciscan Media/",
pages = {
"Apr 10 - \"Bl.\" James Oldo - Franciscan Saint of the Day",
"Apr 11 - S. of God Nicholas of Montecorvino & Co - Franciscan Saint of the Day",
"Apr 12 - Bl. William Ward - Franciscan Saint of the Day",
"Apr 14 - \"Bl.\" Pica Bourlemont - Franciscan Saint of the Day",
"Apr 15 - Serv. of God Nicholas Wiggers - Franciscan Saint of the Day",
"Apr 1 - S. of God Caesar of Speyer - Franciscan Saint of the Day",
"Apr 2 - Bl. Leopold of Gaiche - Franciscan Saint of the Day",
"Apr 3 - Bl. Gandolph of Binasco - Franciscan Saint of the Day",
"Apr 5 - Bl. John of Penna - Franciscan Saint of the Day",
"Apr 6 - Bl. Mary Crescentia Hoess - Franciscan Saint of the Day",
"Apr 7 - Bl. Mary Assunta Pallotta - Franciscan Saint of the Day",
"Apr 8 - Bl. Julian of St. Augustine - Franciscan Saint of the Day",
"Apr 9 - Bl. William Cufitella of Scicli - Franciscan Saint of the Day",
"Aug 10 - \"Bl.\" Amadeus Menez - Franciscan Saint of the Day",
"Aug 11 - St. Clare of Assisi - Franciscan Saint of the Day",
"Aug 12 - S. of God John Bernal & Comp. - Franciscan Saint of the Day",
"Aug 13 - Bl. John of La Verna - Franciscan Saint of the Day",
"Aug 14 - St. Maximilian Kolbe - Franciscan Saint of the Day",
"Aug 15 - Bl. Novellon of Faenza - Franciscan Saint of the Day",
"Aug 16 - St. Clare of Montefalco - Franciscan Saint of the Day",
"Aug 17 - St. Roch of Montpellier - Franciscan Saint of the Day",
"Aug 18 - Bl. Vincent of Aquila - Franciscan Saint of the Day",
"Aug 19 - St. Louis of Toulouse - Franciscan Saint of the Day",
"Aug 1 - St. Peter Julian Eymard - Franciscan Saint of the Day",
"Aug 20 - Bl. Paula Montaldi - Franciscan Saint of the Day",
"Aug 21 - St. Pius X - Franciscan Saint of the Day",
"Aug 22 - S. of God Francis Quinones - Franciscan Saint of the Day",
"Aug 23 - \"Bl.\" Queen Blanche France - Franciscan Saint of the Day",
"Aug 24 - St. Joseph Calasanza - Franciscan Saint of the Day",
"Aug 25 - St. Louis IX - Franciscan Saint of the Day",
"Aug 26 - Bl. Timothy of Montecchio - Franciscan Saint of the Day",
"Aug 27 - Bl. Bernard of Offida - Franciscan Saint of the Day",
"Aug 28 - St. Juniper Serra - Franciscan Saint of the Day",
"Aug 29 - \"Bl.\" Gabriel Mary of the Annunciation - Franciscan Saint of the Day",
"Aug 2 - Our Lady of Angels - Franciscan Saint of the Day",
"Aug 30 - \"Bl.\" Davanzato of Poggibonzi - Franciscan Saint of the Day",
"Aug 31 - S. of God Martin of Valencia - Franciscan Saint of the Day",
"Aug 3 - S. of God Magdalen Daemen - Franciscan Saint of the Day",
"Aug 4 - St. John Baptist Mary Vianney - Franciscan Saint of the Day",
"Aug 5 - \"Bl.\" Albert of Sarziano - Franciscan Saint of the Day",
},
},
["Butler's Lives of the Saints"] = {
prefix = "Butler's Lives of the Saints/",
pages = {
"Sain of the Day: June 27th - King Saint Ladislas",
"Saint James of Nisibis",
"Saint Lewis, King of France",
"Saint Louis King of France",
"Saint of th Day: June 19th - SS Gervasius and Protasius",
"Saint of the Day: April 10th - Saint Bademus",
"Saint of the Day: April 11th - Saint Leo the Great",
"Saint of the Day: April 12th - St Sabas",
"Saint of the Day: April 13th - Saint Hermenegild",
"Saint of the Day: April 14th - SS Tiburtius, Valerian and Maximus",
"Saint of the Day: April 15th - Saint Peter Gonzalez",
"Saint of the Day: April 16th - The Eighteen Martyrs of Saragossa",
"Saint of the Day: April 17th - Saint Stephen of Citeaux",
"Saint of the Day: April 18th - Saint Apollonius the Apologist",
"Saint of the Day: April 1st - Saint Hugh",
"Saint of the Day: April 20th - Saint Agnes of Montepulciano",
"Saint of the Day: April 21st - Saint Anselm",
"Saint of the Day: April 22nd - SS Soter and Caius",
"Saint of the Day: April 23rd - Saint George",
"Saint of the Day: April 24th - Saint Mellitus",
"Saint of the Day: April 25th - Saint Mark the Evangelist",
"Saint of the Day: April 27th - Saint Zita",
"Saint of the Day: April 28th - Saint Vitalis",
"Saint of the Day: April 29th - Saint Peter of Verona",
"Saint of the Day: April 2nd - Saint Francis of Paula",
"Saint of the Day: April 30th - Saint Catherine of Sienna",
"Saint of the Day: April 4th - Saint Isidore of Seville",
"Saint of the Day: April 5th - Saint Vincent Ferrer",
"Saint of the Day: April 6th - Saint Sixtus I, Pope and Martyr",
"Saint of the Day: April 7th - Blessed Herman Joseph",
"Saint of the Day: April 8th - Saint Dionysius of Corinth",
"Saint of the Day: April 9th - Saint Mary of Egypt",
"Saint of the Day: August 10th - Saint Laurence",
"Saint of the Day: August 11th - SS Tiburtius and Chromatius",
"Saint of the Day: August 14th - Saint Eusebius",
"Saint of the Day: August 16th - Saint Hyacinth",
"Saint of the Day: August 17th - Saint Mamas, Martyr",
"Saint of the Day: August 18th - Saint Helen, Empress",
"Saint of the Day: August 19th - SS Timothy Agapius and Thecla",
"Saint of the Day: August 1st - Saint Peter's Chains",
},
},
["Biographies of the Saints"] = {
prefix = "Biographies of the Saints/",
pages = {
"Dec.10 — The Miracle Story of Our Lady of Loreto",
"Dec.10 — The Miracle Story of Our Lady of Loreto: The Holy House That Flew Across the Sky",
"Dec.11 — The Forgotten Story of Saint Damasus I: The Pope Who Preserved the Word of God",
"Dec.11 — The Untold Story of Saint Daniel the Stylite Who Lived on a Pillar for Heaven’s Sake",
"Dec.12 — The Miracle Story of Our Lady of Guadalupe",
"Dec.12 — The Miracle Story of Our Lady of Guadalupe: The Vision That Converted a Nation",
"Dec.13 — The Hidden Story of Saint Odilia: The Blind Princess Who Saw the Light of Christ",
"Dec.13 — The Untold Story of Saint Lucy",
"Dec.13 — The Untold Story of Saint Lucy: The Girl of Light Who Defied Darkness",
"Dec.14 — The Hidden Story of Saint John of the Cross: The Mystic Who Found God in the Dark Night",
"Dec.14 — The Secret Story of Saint Venantius Fortunatus: The Poet Who Shaped the Church’s Hymns",
"Dec.15 — The Secret Story of Saint Virginia Centurione Bracelli: The Widow Who Found God in the Poor",
"Dec.15 — The Untold Story of Blessed Mary Frances Schervier: The Nun Who Found Christ in the Sick",
"Dec.16 — The Forgotten Story of Saint Adelaide: The Queen Who Forgave Her Enemies",
"Dec.17 — The Untold Story of Saint John of Matha: The Founder Who Ransomed Captives from Slavery",
"Dec.18 — The Hidden Story of Saint Malachi: The Last Prophet Before Christ",
"Dec.19 — The Forgotten Story of Blessed Urban V: The Pope Who Tried to Bring the Church Back Home",
"Dec.1 — The Hidden Story of Saint Charles de Foucauld: The Desert Hermit Who Found God in Silence",
"Dec.1 — The Untold Story of Saint Edmund Campion: The Priest Who Died Preaching Truth",
"Dec.20 — The Untold Story of Saint Dominic of Silos: The Monk Who Worked Miracles Through Prayer",
"Dec.21 — The Hidden Story of Saint Peter Canisius: The Scholar Who Defended the Faith",
"Dec.21 — The Hidden Story of the Prophet Micah: The Voice Who Defended the Oppressed",
"Dec.22 — The Forgotten Story of Blessed Thomas Holland: The Jesuit Who Died Whispering Jesus’ Name",
"Dec.23 — The Secret Story of Saint Thorlac: The Icelandic Bishop Who Reformed a Nation",
"Dec.24 — The Untold Story of Saint Delphinus: The Shepherd Who Prepared the Way for Christ",
"Dec.2 — The Hidden Story of Saint Bibiana: The Young Woman Who Found Joy in Suffering",
"Dec.3 — The Untold Story of Saint Birinus: The Apostle Who Converted the West Saxons",
"Dec.4 — The Incredible Story of Saint Barbara: The Virgin-Martyr Who Defied an Empire",
"Dec.4 — The Secret Life of Saint John Damascene: The Monk Who Defended Faith with Reason",
"Dec.5 — The Forgotten Story of Saint Sabbas: The Hermit Who Brought Light to the Desert",
"Dec.5 — The Untold Story of Blessed Nicolas Steno: The Scientist Who Discovered God Through Creation",
"Dec.6 — The Hidden Life of Saint Asella: The Desert Saint Who Lived Unseen in Rome",
"Dec.6 — The True Story of Saint Nicholas",
"Dec.6 — The True Story of Saint Nicholas: The Bishop Who Inspired the Spirit of Giving",
"Dec.7 — The Hidden Life of Saint Ambrose: The Bishop Who Tamed Emperors with Truth",
"Dec.9 — The Forgotten Story of Saint Leocadia: The Virgin-Martyr Who Chose Christ Over Chains",
"Dec.9 — The Hidden Story of Saint Juan Diego",
"Dec.9 — The Hidden Story of Saint Juan Diego: The Humble Man Who Carried Heaven’s Image",
"Dec. 23 — The Hidden Story of Saint Servulus: The Paralyzed Beggar Who Thanked God for Everything",
"July 12 — The Secret Story of Saints Louis and Zélie Martin: The Parents of Saint Thérèse of Lisieux",
},
},
["Good Catholic"] = {
prefix = "Good Catholic/",
pages = {
"\"Our Black Mother\" St. Josephine Bakhita",
"A Beacon of Hope in Prison",
"A Holy Mother and A Holy Monarch",
"A Man of the People St. Pier Giorgio Frassati",
"A Quick Dive Into the Dominicans' Feast Day",
"A Statue Asked Him for Protection",
"A Story of Power and Service St. Adelaide of Burgundy",
"A Sword, a Soldier, and St. Anysia",
"A True Papal Leader in Challenging Times (Pope St. Hilary)",
"A Young Saint, With a Big Impact (St. John Berchmans)",
"An Angel Freed Him from Prison",
"An Important Church Fathers St. Irenaeus",
"An Unconventional Love Story St. Victoria",
"Arrogant Soldier Turned Humble Saint",
"At 14 She Knew God's Will For Her",
"Businessman Turned Priest",
"Can You Live 20 Years Without Food or Drink This Saint Did!",
"Carving a Path of Faith on Mount Carmel",
"Certified Teacher at 15 Years Old!",
"Cloak of Charity St. Martin of Tours",
"Could You Preach for Two Hours Straight? Meet Saint John Chrysostom",
"Did He Suffer the Worst Tortures?",
"Did Saint Catherine of Genoa See Purgatory?",
"Do You Know These Two Apostles?",
"Do You Know Who Made the IHS Symbol?",
"Do You Know the First Apostolic Father of the Church?",
"Do You Know the First Irish Saint Hint: It's Not St. Patrick",
"Do You Know the Patron Saint of Firefighters?",
"Do You Know the Patroness of the Americas? Our Lady of Guadalupe",
"Do You Know the Promise of the Scapular?",
"Do you Know Who Replaced Judas?",
"Do you know \"The Pope's Theologian\"?",
"Do you know about the \"Pearl of York\"? St. Margaret Clitherow",
"Educator, Missionary, and Founder (Bl. Thomas Maria Fusco)",
"Even When Threatened With Death, He Didn't Stand Down",
"Even in Prison, He Couldn't be Silenced",
"Even the Devil Could not Scare Her",
"Even the Dogs Knew She was Holy St. Bibiana",
"Exorcisms and Egos (St. Eleutherius)",
"Faith and Sacrifice: The Story of Saint Andrew Kim Taegon",
},
},
["Saint of the Day"] = {
prefix = "Saint of the Day/",
pages = {
"All Saints Day - November 1st",
"All Souls Day",
"Annunciation of the Blessed Virgin Mary",
"Blessed Charles the Good - March 2nd",
"Blessed Mary of the Incarnation - April 18th",
"Dedication of Saint Michael, Archangel - Sep 29th: Satan Fears This One Angel More Than All Others",
"Dedication of the Basilica of St. John Lateran - November 9th",
"Dedication of the Basilicas of Saint Peter and Saint Paul - November18th",
"Easter Sunday",
"Expectation of Our Lady - December 18",
"Feast of the Holy Relics - November 5th",
"Feast of the Most Holy Name of Mary, September 12th",
"Fourteen Holy Helpers - August 8th",
"Holy Saturday",
"Isabell of France - February 26th",
"John Baptist de la Salle, May 15th",
"Nativity of Saint John the Baptist - June 24th",
"Our Lady, Queen of the May",
"Our Lady Help of Christians - May 24th",
"Our Lady of Fatima, Sixth Apparition - October 13",
"Our Lady of Good Counsel, April 26th",
"Our Lady of Grace/Mentorella",
"Our Lady of Mercy (Ransom) - September 24th",
"Our Lady of Perpetual Help",
"Our Lady of Pontmain (or Our Lady of Hope) - January 17th",
"Our Lady of Prompt Succor - January 8th",
"Our Lady of Suffrage",
"Our Lady of the Pillar - October 12th",
"Our Lady of the Rosary – October 7th",
"Our Lady of the Snow - August 5th",
"Palm Sunday",
"Pentecost",
"Pentecost Sunday",
"Prayer to Christ the King",
"Saint (Denis) Dionysius and Companions, Martyrs - October 9th",
"Saint Adalbert, Martyr - April 23rd",
"Saint Aelred or Alfred, Abbot - January 12th",
"Saint Agapitus (or Agapetus), Martyr - August 18th",
"Saint Agatha, Virgin and Martyr - February 5th",
"Saint Agnes, Virgin and Martyr - January 21st",
},
},
["Sanctus"] = {
prefix = "Sanctus/",
pages = {
"A Pope Defender of Tradition",
"A Saint Consecrated to The Virgin Mary: Saint Louis de Montfort",
"All Saints' Day: Discover the Feast Celebrating the Saints of the Catholic Church",
"All Souls’ Day the Love That Overcomes Death",
"Annunciation of the Lord: The Beginning of Salvation",
"Are You Doing the Sign of the Cross Wrong? Avoid These Mistakes!",
"Assumption of Mary: Few People Know This Story",
"Assumption of Mary: History, Faith and Miracle",
"Cardinal Sarah Will Be the New Pope",
"Confessions of Saint Augustine",
"Corpus Christi The True Story",
"Day of the Dead / All Souls' Day: How the Catholic Church Commemorates",
"Did You Know? The Only Sin God Won't Forgive",
"Discover The 10 Most Important Facts Of The Life Of Pope Leo XIV",
"Discover What Jesus' Childhood Was Like.",
"Discover the Difference Between Pope Leo and Pope Francis",
"Discover the Incredible Story of Saint Philomena",
"Discover the Life of Saint Regina",
"Discover the Life of Saint Rosalia of Palermo",
"Discover the Miracles of Saint Anthony of Padua",
"Discover the Story of Carlo Acutis",
"Discover the Story of Our Lady of Guadalupe",
"Discover the Story of Our Lady of Mercy: Patroness of the Captives",
"Discover the Story of Saint Bridget",
"Discover the Story of The Holy Child of Atocha",
"Discover the Story of the Infant Jesus of Prague",
"Discover the Three Prophecies of Our Lady of Fátima",
"Do Catholics Worship Saints? Discover the Truth!",
"Do You Do This on Ash Wednesday?",
"Do You Know What Advent Is? Discover Its True Meaning!",
"Easter The Resurrection of Jesus",
"Epiphany of the Lord: The First Proclamation of Christ to the World",
"From Prince to Saint: The Journey of Saint Casimir",
"From Saint Nicholas to Santa Claus Do You Know This Story?",
"From Sinner to Saint: The Transformation of Mary Magdalene",
"From Soldier to Saint: The Spiritual Journey of Ignatius of Loyola",
"From Suffering to Sainthood: The Life of Saint Stanislaus Kostka",
"Gemma Galgani: The Saint of the Stigmata",
"Good Friday Love that Conquered Death",
"Has the Church Ever Had A Black Pope?",
},
},
["Saints and Angels TV"] = {
prefix = "Saints and Angels TV/",
pages = {
"\"Christ Is Stronger Than Fear\" Saint Bernard of Menthon saints",
"\"I Want to Imitate Jesus\" Saint Charles de Foucauld saints",
"\"Jesus Christ is the True God\" Saint Abanoub saints",
"\"The Brave Heart of Praxedes\" Story of Saint Prexedes",
"\"The King Shouts: ‘Take Her Away!’ Story of Saint Odile",
"\"They Tried to Poison Saint Anthony of Padua Saint Anthony of Padua saintanthony",
"\" Take Her Away \" The King Shouts Story of Saint Odile Saint Odile of Alsace saints",
"A Child Asked for Help Saint Thomas of Villanova saintsandangelstv saints",
"A Child Hero of Christianity Saint Abanoub saints",
"A Hero of Faith Saint John of Capistrano saints",
"A Journey of Faith Saint Edith Stein shorts",
"A Legless Man’s Impossible Run I Story of Saint Emma of Lesum I saintsandangelstv saints",
"A Life-Changing Encounter I Story of Saint John the Dwarf saintsandangelstv Saints",
"A Life Given in Love Saint Gianna Beretta Molla saints",
"A Life of Suffering, Faith, and Holiness Saint Servulus of Rome saints",
"A Missionary Without Fear Saint Laura Montoya Shorts",
"A Mother’s Sacrifice Saint Gianna Beretta Molla saints",
"A Saint Like No Other Saint Gianna Beretta Molla saints",
"Abandoned His Military Life for Faith I Story of Saint Menas of Egypt I Saints Saintsandangelstv",
"Abraham Finds Mary of Edessa Saint Mary of Edessa saints",
"Across the Ocean by Faith Saint Mother Cabrini saints",
"Angel Appeared Before Saint Bega Story of Saint Bega of Bees SaintsandAngels CatholicSaints",
"Angela of Foligno’s Journey I Story of Saint Angela of Foligno I saintsandangelstv saints",
"Angels Cooked for Saint Zita I Story of Saint Zita of Lucca I Saints Saintsandangelstv",
"April 25 - Saint Mark Evangelist Feast Day saintoftheday",
"Arriving in New York Saint Mother Cabrini saints",
"Attacked with Stones Saint Laura Montoya saints",
"Bega's Pilgrimage to Saint Bees Story of Saint Bega of Bees SaintsandAngels CatholicSaints",
"Bernard Refuses Marriage Saint Bernard of Menthon saints",
"Boy Who Chose Faith Over Fear Saint Abanoub saints saintabanoub",
"Brave Young Martyr Who Faced a Lion Story of Saint Prisca Saint",
"Bringing Faith to Pamplona Story of Saint Fermin saints",
"Captured by Slave Traders Saint Josephine Bakhita saints",
"Chosen for God Alone Saint Bernard of Menthon saints",
"Colombia’s First Saint Saint Laura Montoya saints",
"Deacon Who Defied an Empire Story of Saint Vincent of Saragossa saints",
"Devil Tried to Trick Saint Martin Saint Martin of Tours saints saintmartinoftours",
"Faith Beyond Fear Saint Laura Montoya saints",
"Faith That Couldn’t Be Silenced Story of Saint Vincent of Saragossa saints",
"Faith That Never Fell Saint John of Capistrano Part 2 saints",
},
},
}
local poolOrder = {
"Catholic Online",
"Franciscan Media",
"Butler's Lives of the Saints",
"Biographies of the Saints",
"Good Catholic",
"Saint of the Day",
"Sanctus",
"Saints and Angels TV",
}
local function seedRandom(frame)
-- prefer explicit seed=; do not treat pool name as a number
local seed = tonumber(frame.args.seed) or tonumber(frame.args[2]) or os.time()
math.randomseed(seed % 1000000007)
math.random(); math.random(); math.random()
return seed
end
local function pickFromPool(poolName)
local pool = pools[poolName]
if not pool or not pool.pages or #pool.pages == 0 then
return nil
end
local idx = math.random(1, #pool.pages)
return pool.prefix .. pool.pages[idx]
end
-- return full page title for a named pool
-- {{#invoke:RandomSaintMedia|getRandomPage|pool=Franciscan Media|seed={{#time:U}}}}
function p.getRandomPage(frame)
seedRandom(frame)
local poolName = frame.args.pool or frame.args[1]
if not poolName or poolName == '' then
poolName = poolOrder[math.random(1, #poolOrder)]
end
local title = pickFromPool(poolName)
if not title then
return ''
end
return title
end
-- pick a random pool then a random page title
function p.getRandomPageAny(frame)
seedRandom(frame)
local poolName = poolOrder[math.random(1, #poolOrder)]
return pickFromPool(poolName) or ''
end
-- transclude the page (portal-safe via Template:SaintMedia)
-- {{#invoke:RandomSaintMedia|embed|pool=Catholic Online|seed={{#time:U}}}}
function p.embed(frame)
local title = p.getRandomPage(frame)
if title == '' then
return "''No media available for this pool.''"
end
return frame:preprocess('{{:' .. title .. '}}')
end
function p.embedAny(frame)
seedRandom(frame)
local poolName = poolOrder[math.random(1, #poolOrder)]
local title = pickFromPool(poolName)
if not title then
return "''No media available.''"
end
return frame:preprocess('{{:' .. title .. '}}')
end
-- list pool names (for docs/debug)
function p.listPools(frame)
return table.concat(poolOrder, ', ')
end
return p