Mô đun:Librivox book

local p = {}

function p.book(frame)

  local pframe = frame:getParent()
  local args = pframe.args

  local tname = "Librivox book" -- name of calling template. Change if template rename.

  local title   = nil -- display and search title (default: article name w/out dab)
  local dtitle  = nil -- display title (default: title)
  local stitle  = nil -- search title (default: title)
  local lname   = nil -- last name
  local id      = nil -- unsupported argument
  local author  = nil -- author
  local tagline = "- sách nói thuộc phạm vi công cộng tại [[LibriVox]]"
  local urlhead = "https://librivox.org/search?"
  local italic   = "''"

  id = trimArg(args.id)
  if id then
    error("Lỗi bản mẫu:" .. tname .. " - id không được hỗ trợ - xin hãy xem tài liệu hướng dẫn tại [[Bản mẫu:Librivox author]]")
  end

  title = trimArg(args.title)
  if not title then
    title = mw.title.getCurrentTitle().text
  end
  dtitle = mw.ustring.gsub(title,'%s+%([^%(]-%)$', '')        -- Remove the final disambig paren
  stitle = dtitle

  if trimArg(args.stitle) then
    stitle = trimArg(args.stitle)
    if not trimArg(args.title) then                           -- For when used outside main article space
      dtitle = stitle
    end
  end
  if trimArg(args.dtitle) then
    dtitle = trimArg(args.dtitle)
    italic  = ""
  end

  local stitle = mw.ustring.gsub(stitle," ", "+")             -- replace "<space>" with "+"

  author = trimArg(args.author)
  if not author then
    lname = ""
  else
    --- Split name into words, count words, set name to last word
    local N = mw.text.split(author, " ")
    local l, count = mw.ustring.gsub(author, "%S+", "")
    lname = N[count]
  end

  local url = "[[File:Speaker Icon.svg|15px|link=|alt=]] " .. "[" .. urlhead .. "title=" .. stitle .. "&author=" .. lname .. "&reader=&keywords=&genre_id=0&status=all&project_type=either&recorded_language=&sort_order=catalog_date&search_page=1&search_form=advanced" .. " " .. italic .. dtitle .. italic .. "]" .. " " .. tagline

  return url

end

function trimArg(arg)
  if arg == "" or arg == nil then
    return nil
  else
    return mw.text.trim(arg)
  end
end

return p
Chúng tôi bán
Bài viết liên quan
[Genshin Impact] Tại sao Eula lại hot đến vậy
[Genshin Impact] Tại sao Eula lại hot đến vậy
Bài viết sẽ tổng hợp mọi nội dung liên quan đến nhân vật mới Eula trong Genshin Impact
Đánh giá sức mạnh, lối chơi Ayaka - Genshin Impact
Đánh giá sức mạnh, lối chơi Ayaka - Genshin Impact
Ayaka theo quan điểm của họ sẽ ở thang điểm 3/5 , tức là ngang với xiao , hutao và đa số các nhân vật khá
Thấy gì qua Upstream (2024) của Từ Tranh
Thấy gì qua Upstream (2024) của Từ Tranh
Theo số liệu của Trung tâm Nghiên cứu Việc làm mới của Trung Quốc, mức thu nhập trung bình của các tài xế loanh quanh 7000 NDT, tương ứng với 30 đơn giao mỗi ngày trong 10 ca làm 10 giờ liên tục
Ma Pháp Hạch Kích - 核撃魔法 Tensei Shitara Slime datta ken
Ma Pháp Hạch Kích - 核撃魔法 Tensei Shitara Slime datta ken
Ma Pháp Hạch Kích được phát động bằng cách sử dụng Hắc Viêm Hạch [Abyss Core], một ngọn nghiệp hỏa địa ngục được cho là không thể kiểm soát