Add a Tweet BBcode to a phpBB Forum

I was looking for a way to embed a tweet into phpBB using the BBcode funcationality. I found a decent solution but edited it a tiny bit (to account for http vs https URLs).

BBcode usage:


HTML replacement:

<script type="text/javascript">
function loadx(data) {
<script type="text/javascript" src="{IDENTIFIER}&callback=loadx"></script>
<div class='twitter' onLoad='loadx().html'/></div>

Here’s the result:

Thanks to Evan Hoffman.