MediaWiki:TwitterTimeline.js

(function($) {

"use strict";

$(document).ready(function {

var enable_whitelist = true;

// when enable_whitelist = true : only allow timelines for those profiles var whitelist = [ "KanColle_STAFF", // official development/management twitter "dmmolg_com", // official publisher twitter // "Kensho_KanColle", // unofficial community announcements ];

var last_wrapper;

$(".twitter-timeline-wrapper").each(function(_, wrapper) {

var profile = $(wrapper).data("profile") || "", text = $(wrapper).data("text") || "", width = $(wrapper).data("width") || 300, height = $(wrapper).data("height") || 400, widget_link = '' + text + '';

if (!enable_whitelist || $.inArray(profile, whitelist) !== -1) { console.log(profile, $.inArray(profile, whitelist)); $(wrapper).append(widget_link); last_wrapper = wrapper; }

});

if (last_wrapper) { var widgets_js = document.createElement("script"); widgets_js.type = "text/javascript"; widgets_js.src = "http://platform.twitter.com/widgets.js"; $(last_wrapper).append(widgets_js); }

});

}(jQuery));