ホーム
おまかせ表示
ログイン
設定
エケペディアについて
免責事項
検索
モジュール:Weiboのソースを表示
←
モジュール:Weibo
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、以下のグループのいずれかに属する利用者のみが実行できます:
登録利用者
、
管理者
。
このページのソースの閲覧やコピーができます。
local p = {}; local function setProperty(t_name) -- メイン空間のみ if not mw.title.getCurrentTitle().namespace == 0 then return true; end if not mw.smw then return true; end local dataStore = {} dataStore['Weiboアカウント'] = t_name local result = mw.smw.set( dataStore ) if result == true then -- everything ok else -- error message to be found in result.error end end function p.main( frame ) local args = require( 'Module:Arguments' ).getArgs( frame, { wrappers = 'Template:Weibo', removeBlanks = false, parentFirst = true }); -- Weibo ID local i_name = args[1] or args.id or ''; -- Weibo URL local formatterURL = "https://www.weibo.com/u/$1"; local url = mw.ustring.gsub(formatterURL, "\$1", i_name); -- Weibo 表示名 local name = args[2] or args.name or ''; -- SemanticMediaWiki if not args.nosmw then setProperty(i_name); end -- Instagram 表示名デフォルト if name == '' then name = "Weiboアカウント"; end local i_name2 = '(@' .. i_name ..')'; if mw.ustring.match(name, '%(' ..i_name .. '%)$') then i_name2 = ''; end return '[' ..url ..' ' ..name ..'] ' ..i_name2 ..' - [[新浪微博]]'; end return p;
このページで使用されているテンプレート:
モジュール:Weibo/doc
(
ソースを閲覧
)
モジュール:Weibo
に戻る。