コンテンツにスキップ

モジュール:利用者:bcxfu75k2/Bananas

モジュールの解説[作成]
return {
	getid = function(frame)
		local listpage = 'Template:81プロフィール/一覧'
		local url = 'https://www.81produce.co.jp/actor_search/index.php/item?id='
		local text = frame:expandTemplate{title = listpage}
		local title = frame.args[1]
		local count = 0
		local result = ""
		
		for linktitle in mw.ustring.gmatch(text, '%[%[(.-)[%]|]') do
			-- {{注意}}テンプレート内のアイコンファイル[[File:]]を除外する。
			s, e = string.find( linktitle, "File");
			
			if s == nil then
				result = result .. "," .. linktitle
				count = count + 1
				if title == linktitle then
					return url .. count
				end
			end
				

		end
		
		return frame:expandTemplate{ title = 'Error', args = { 'エラー:IDの取得に失敗しました。記事名および[[' .. listpage ..']]を確認してください。'} } .. '[[Category:テンプレート呼び出しエラーのあるページ/Template:81プロフィール]]'
	end
}