It looks like you're using an Ad Blocker.
Please white-list or disable AboveTopSecret.com in your ad-blocking tool.
Thank you.
Some features of ATS will be disabled while you continue to use an ad-blocker.
function gvidIDextract(url)
[
var gvid_id;
gvid_id = url.replace(/^[^=]+=(-?\d+).*/,"$1");
return gvid_id;
]
That's actually slower because it forces the browser to figure out which URL it's working on.
Originally posted by Burgess
You could stick both of them into one function that would look something like the one below, then just have one button to add either Google video or youTube video.
-snip-
Of course that function assumes that they have added the address with http:// at the beginning
function youtubeRE(url)
[
return url.replace(/^[^v]+v.(.[11]).*/,"$1");
]
function gvidRE(url)
[
return url.replace(/^[^=]+=(-?\d+).*/,"$1");
]
function IDextract(url)
[
if(url.match(/google/))
return gvidRE(url);
else
return youtubeRE(url);
]
Originally posted by Burgess
If it was used on the site it’d make embedding videos easier.
Copying and pasting the URL and letting the browser determine the ID from the URL?
Originally posted by chissler
Originally posted by Burgess
If it was used on the site it’d make embedding videos easier.
Forgive me if I am missing something, but what is any easier than typing...
[yvid]Number Here[yvid]
[gvid]Number Here[/gvid]
Originally posted by supercheetah
Copying and pasting the URL and letting the browser determine the ID from the URL?
Yes it is because it doesn't require people to be human regular expression parsers.
Originally posted by chissler
Originally posted by supercheetah
Copying and pasting the URL and letting the browser determine the ID from the URL?
Does that necessarily equate to easier?