Hi , i think its great that we can embed Youtube videos here at ATS but its clear that many people seem to have problems getting the correct video
number which just makes the threads messy not to mention frustrating for the users.
I'm a programmer and i don't understand why the good people in charge of this site don't just implement a simple algorithm that strips out everything
but the Youtube video number automatically thus allowing a person posting the video to just enter the entire YouTube URL.
Here are 3 examples of the different complexities of youtube URL's with the "www." prefix removed so i can display them here.
youtube.com/watch?v=iDb1oyVKnP4
youtube.com/watch?v=BZ5sWfhkpE0&feature=relmfu
youtube.com/watch?v=vioZf4TjoUI&feature=BFa&list=AVLtX9JtELkW26DMGzQ-CQylpSHBGCxzrQ4giVTBh-jfiMQm1oWUWpSKdSxvZIjm54&lf=list_related
The layman's terms the code to get the number would be :
1 - Search the String from left to right to look for the first instance of the character "="
2 - If "=" is found Remove everything in the string to the left of (and including) the "="
3 - In the remaining string search from the left to the right for the first instance of the character "&"
4 - If "&" is found then remove everything from the string to the right of (and including) the "&"
Of course some people might prefer the old method for some reason but with this code people could still use the old system of using the exact youtube
number or they could input the entire URL. It will work with both methods without throwing up errors
Im not sure who is responsible for the coding at ATS but im sure this would make the whole process of posting a youtube video much more user friendly
for your site
edit on 5-11-2011 by PhoenixOD because: (no reason given)