Page 1 of 2

YouTube embedding

Posted: Mon May 14, 2012 12:09 pm
by Eraser
Since there's still people who do not know how to embed YouTube videos here on Q3W, I thought I'd make a little helper script for that.

So what you can do is add this piece of script below to your bookmarks:

Code: Select all

javascript:function fixYouTubeEmbedding(){for(var d=document.getElementsByTagName("textarea"),f=null,e=0;e<d.length;e++)"message"==d[e].name&&(f=d[e]);if(null==f)alert("Textarea not found. Are you on the right page?");else{for(var d=f.value,i=d.split("\n"),g=0;g<i.length;g++)for(var j=i[g].split(" "),e=0;e<j.length;e++){var a=j[e];if(0<=a.indexOf("youtube.com/watch?")){var c=a.indexOf("v="),b=a.indexOf("&",c);-1==b&&(b=a.indexOf(" ",c));-1==b&&(b=a.length);var c=a.substring(c+2,b),b=a.indexOf("youtube.com/watch"),
h=a.indexOf(" ",b);-1==h&&(h=a.length);b=a.substring(b,h);c=a.replace(b,"youtube.com/v/"+c);c="[flash=480,360]"+c+"[/flash]";d=d.replace(a,c)}}f.value=d}}fixYouTubeEmbedding();
This is done as follows:

Internet Explorer
Click the little star at the top right of the screen. In the popup, click the downward arrow next to "add to favorites" and select "add to favorites bar". A bookmark to the current page will be added to the favorites bar. Right click that bookmark and select "properties". Now replace the text in the "shortcut" input field with the code posted above. You can also right-click it and select "rename" to give it a proper name.

Firefox
Right click the bookmark toolbar and click "new bookmark". Give it a name and in the "location" input field, paste the code posted above.

Chrome
Hit the little star in the location bar and then click the "edit" button in the popup that appears. Give the bookmark a different name and paste the code posted above in the URL input field.

Now whenever you want to post an embedded YouTube video, simply type your post and paste the full YouTube URL in your post in the location where you want it to be embedded. Then hit the bookmark you just added and the script will format the URL so that it's embedded. Then hit the submit button to post your message.

Re: YouTube embedding

Posted: Mon May 14, 2012 12:27 pm
by DTS
All they need to do is quote someone to see how it's done; fuck'n nerd.

Re: YouTube embedding

Posted: Mon May 14, 2012 12:33 pm
by Eraser
Yes indeed.

Re: YouTube embedding

Posted: Mon May 14, 2012 1:44 pm
by HM-PuFFNSTuFF
fuck off [flash=480,360]nerds

http://www.youtube.com/v/ZHh0V7UjVXI[/flash]

Re: YouTube embedding

Posted: Mon May 14, 2012 1:45 pm
by HM-PuFFNSTuFF
great script

Re: YouTube embedding

Posted: Mon May 14, 2012 1:54 pm
by HM-PuFFNSTuFF
hello jerry (cough [flash=480,360]cough)

http://www.youtube.com/v/obxfuFrUTzg[/flash]

Re: YouTube embedding

Posted: Mon May 14, 2012 1:54 pm
by HM-PuFFNSTuFF
it's still borked jerry!

Re: YouTube embedding

Posted: Mon May 14, 2012 1:55 pm
by HM-PuFFNSTuFF
one more time

Re: YouTube embedding

Posted: Mon May 14, 2012 1:59 pm
by Eraser
Don't get your panties in a knot. It's fixed now.

Re: YouTube embedding

Posted: Mon May 14, 2012 2:03 pm
by HM-PuFFNSTuFF
JERRY!!
Eraser wrote:Don't get your panties in a knot. It's fixed now.

Re: YouTube embedding

Posted: Mon May 14, 2012 3:20 pm
by obsidian
Maybe it would be easier just to fix the Flash embed forum plugin?

Re: YouTube embedding

Posted: Mon May 14, 2012 3:42 pm
by Eraser
Sure, give me admin priviliges and I'll do it. Actually, FTP access to the PHP scripts is what you'd need.

Re: YouTube embedding

Posted: Mon May 14, 2012 3:59 pm
by xer0s
Sure, why don't we give you our bank account numbers while we're at it...

Re: YouTube embedding

Posted: Mon May 14, 2012 4:05 pm
by DTS
:olo: "Hey I wrote a script can I have the website and forums now?"

Re: YouTube embedding

Posted: Mon May 14, 2012 4:28 pm
by Eraser
xer0s wrote:Sure, why don't we give you our bank account numbers while we're at it...
Yeah, why don't you.
I was saying things in jest because we certainly shouldn't expect our exalted admins to do anything about it.

Re: YouTube embedding

Posted: Mon May 14, 2012 4:33 pm
by seremtan
pretty sure the only one on here who needs this is Whiskey and his "360x240 for everything" mentality

Re: YouTube embedding

Posted: Mon May 14, 2012 5:37 pm
by Plan B
^lol

Meh, I just post youtubes in the "what are you listening to" thread.
And then just quote the previous post, and edit until not borked.

Appreciate the effort, though.
Don't let Debbie Downy types like dts get you down.

Re: YouTube embedding

Posted: Mon May 14, 2012 6:53 pm
by Transient
The fullscreen button doesn't even work, so why bother embedding? I always click the YouTube link anyway, so might as well just post a link to the video instead of embedding. :shrug:

Re: YouTube embedding

Posted: Tue May 15, 2012 12:04 am
by obsidian

Re: YouTube embedding

Posted: Tue May 15, 2012 12:58 am
by Dark Metal
Lots of upset nerds in this thread.

Re: YouTube embedding

Posted: Tue May 15, 2012 2:21 am
by Tsakali
i always have to quote and edit to add vids... yes the code is simple...yes I never seem to remember it.

Re: YouTube embedding

Posted: Tue May 15, 2012 3:46 am
by plained
Eraser wrote: our exalted admins
well done thats how i feel i do ey

i exalt them plenty!

Re: YouTube embedding

Posted: Tue May 15, 2012 6:33 am
by Whiskey 7
seremtan wrote:pretty sure the only one on here who needs this is Whiskey and his "360x240 for everything" mentality

Hey, steady on!
I do that to fit the videos. I used to make 'em bigger :grr:
Thought I was doing the right thing making them smaller :smirk: :smirk:
Dark Metal wrote:Lots of upset nerds in this thread.
FYI I have a word doc on my desktop (for years) and just cut and past or substitute the right stuff :!:

Cop this :)



NOTE: 640 390

Code: Select all

[flash=640,390]http://www.youtube.com/v/e2Innx3puNI&[/flash]    



Code: Select all

[flash=320,190]http://www.youtube.com/v/e2Innx3puNI&[/flash]       


Note: 320 190

Never tried smaller >:)


Code: Select all

[flash=160,9]http://www.youtube.com/v/e2Innx3puNI&[/flash]       

Re: YouTube embedding

Posted: Tue May 15, 2012 8:05 am
by Transient
BLAST YOU

Re: YouTube embedding

Posted: Tue May 15, 2012 2:44 pm
by HM-PuFFNSTuFF