Embedding

Wednesday, April 11th, 2012

A friend asked me yesterday if he would be able to embed videos in his Posts. I’d already decided that I’d make it possible, so today I set about implementing it.

Turns out that embedding a youtube video is pretty easy, and just a little Regex, or URL parsing (thanks to Stack Overflow) was necessary.

Some people, when confronted with a problem, think
“I know, I’ll use regular expressions.”   Now they have two problems.

Jamie Zawinski

I tried to make Sound Cloud songs embed automatically as well, but the way they process URLs is currently preventing that. Maybe I’ll send ’em an email – their service is pretty good so I assume that they are on the ball.

So now you can just Post a Youtube.com URL (like “http://www.youtube.com/watch?v=QH2-TGUlwu4”) and the video will be posted for you. ᵔᵜᵔ

Pretty neat, eh?

We think it’s Nyantastic!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: