Embedding IFrames in Wordpress.com

I recently came across a workaround for embedding iframes in Wordpress.com blogs:

Flash and all other embeds are not allowed in WordPress.com posts, pages, or text widgets. For security reasons, we remove the tags needed for these to work. Your intentions may be innocent, but someone somewhere might try to use such embeds to damage the site, affecting all of our users.

As this guide suggests, the workaround made use of a perfectly legitimate and supported shortcode API. In essence, the workaround involved converting an iframe to Flash, which in turn was sourced by [gigya].

I was able to illustrate the concept below:

For my dearest nephew, and any other chess enthusiasts that are perusing this blog, I have embedded a chess game that I recently played. Click the link below, and try to figure out the positional/tactical errors that my opponent (and close friend) committed, and any variations that may have redeemed his play.

1
2
3
<table style="border:none;height:32px;width:32px;">
[gigya src="http://cdn.tagul.com/cloud.swf" flashvars="autoplay=1" allowfullscreen="true" type="application/x-shockwave-flash" allowscriptaccess="always" width="542" height="300" flashvars="id=180853@2"]
</table>

If, for some reason, the embed doesn’t show, here’s a link to how it should look.

Code and Gists in Wordpress

While WordPress.com doesn’t allow you to use potentially harmful code on your blog, it does allow you to post source code for general viewing. Provided that you enclose the source code within a [sourcecode] [/sourcecode] shortcode wrapper, you will be able to preserve the code’s formatting; enable syntax highlighting for the programming language used; and highlight specific lines in the code. For example, for a CSS snippet, do:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[sourcecode language="css" highlight="3,4,5,6,7"]
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
[/sourcecode]

Alternatively, wordpress.com permits embedding github.com gists by using the [gist] shortcode. With [gist]2927943[/gist], you’ll achieve:

… which certainly isn’t as pretty as wordpress.com‘s solution. You can make a gist more presentable by way of CSS customizations, but this isn’t possible on wordpress.com. It is also impossible to tell gists to highlight specific lines of code.

New Blog Host Adopted

As the future of ootput.bur.st remains bleak, I have been forced to seek alternative hosting locations. wordpress.com provides free hosting for blogs powered by WordPress, and I have chosen to use it as a temporary host while I wait for the outcome of bur.st‘s acquisition.

wordpress.com provides a decent service to the occasional blogger who has no intention of hosting their own site. I personally felt very much at home after successfully importing posts from the Habari-based ootput.bur.st. Of course, as wordpress.com wasn’t a self-hosted solution to the bur.st issue, I was limited to whatever functionality the blog was permitted to exhibit by the WordPress team. (read: no additional plugins allowed)

The transition from Habari to WordPress was not a straightforward process, however. In order to export all of Habari’s posts to a format recognised by wordpress.com, I had to host a WordPress blog on bur.st where I could create the appropriate MySQL tables for WordPress. wordpress.com does not provide direct MySQL access for its members, and this effectively prevents the Habari->Wordpress script from working.

Regardless, once I had exported data to the bur.st-hosted WordPress, I was then able to produce a WordPress->WordPress export file to be imported into wordpress.com

It was a tedious process, but it saved me a lot of time in transferring content onto the new blog.

In order to redirect users to my new wordpress.com blog, and to properly block search bots from accessing the domain (e.g. Google), I created the following two files in ootput.bur.st‘s root directory:
.htaccess:

1
2
3
4
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://ootput.github.io/$1 [R=301,L]

robots.txt:

1
2
3
User-agent: *
Disallow: /

Of course, these two files will be obliterated once the bur.st merger is officially complete.

NB: Interestingly, my final login to shell.bur.st showed new mail in my mailbox - where I had never received e-mail in the past. There was a total of 10 e-mails, and all of them were spam. I suppose it was someone’s last ditched effort to generate some income from bur.st members - which was kind of lame. As the account effectively expires on the 1st July, this desperate attempt seemed rather stupid.