Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-11-2012, 10:21 AM   #1
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
python and ruby folk in here

im putting together a collection of youtube one liners.

anyone wanna submit one that works from console to get a youtube video id out of a youtube url?

;)

__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2012, 11:00 AM   #2
extreme
Confirmed User
 
Industry Role:
Join Date: Oct 2002
Location: lalaland
Posts: 2,120
do you mean "uAFjgpuWREM" from https://youtube.com/watch?v=uAFjg...6cFAAAAAAAAAAA or what?
extreme is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2012, 11:04 AM   #3
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
ya exactly

perl

Code:
perl -e '$_=shift; print(/v=(.+)/);' https://youtube.com/watch?v=8tRUckf0WbY
awk

Code:
echo https://youtube.com/watch?v=4bQOSRm9YiQ | awk -F 'v=' '{print $2}'
sed

Code:
echo https://youtube.com/watch?v=sGgOM1UsqtE | sed 's/.*watch?v=\([^&]*\).*/\1/'
echo https://youtube.com/watch?v=sGgOM1UsqtE | grep -o 'watch\?v=[^&"]+' | sed -e 's#^[^=]*=##'
echo https://youtube.com/watch?v=sGgOM1UsqtE | sed -ne 's#^.*watch?v=\([^&"]*\+\).*$#\1#p'
echo https://youtube.com/watch?v=sGgOM1UsqtE | sed '/watch?v=/! d;s/.*v=//;s/\(.\{11\}\).*/\1/'
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2012, 03:04 PM   #4
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
No php?

Code:
php -r 'echo next(explode( "v=", $argv[1] ) );' https://youtube.com/watch?v=8tRUckf0WbY
or

Code:
php -r 'echo preg_replace ( "/.*v\=([a-z0-9]+).*/i", "$1", $argv[1] );' https://youtube.com/watch?v=8tRUckf0WbY
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2012, 03:21 PM   #5
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
here's a ruby sample:

Code:
echo 'https://youtube.com/watch?v=8tRUckf0WbY' | ruby -ne 'puts $1 if /v=(\w+)/'
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2012, 04:19 PM   #6
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
thanks just need a python one now ;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-11-2012, 11:28 PM   #7
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
I don't normally use python, but since no one else is bothering...

Code:
python -c "import re,sys; m = re.split('v=',sys.argv[1]); print m[1];" https://youtube.com/watch?v=8tRUckf0WbY
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2012, 05:59 AM   #8
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
spanks ;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2012, 06:56 AM   #9
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
here is some bash ;)

Code:
echo https://youtube.com/watch?v=sGgOM1UsqtE | grep -E 'v=[A-Za-z0-9_-]' | cut -d "=" -f 2
Code:
var='https://youtube.com/watch?v=sGgOM1UsqtE'; echo "${var#*v=}"
Code:
var='https://youtube.com/watch?v=sGgOM1UsqtE'; echo "${var##*[?&]v=}"
;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2012, 09:39 AM   #10
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
zsh ;)

Code:
s='https://youtube.com/watch?v=k6R9hMV1jNk'; a=("${(s/v=/)s}"); echo $a[2]
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2012, 10:06 AM   #11
Emil
Confirmed User
 
Emil's Avatar
 
Join Date: Feb 2007
Location: Sweden
Posts: 5,623
Qbasic???
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.)
(Signup with ONLY your Email and Password. You can also refer people and get even more.)
Emil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-12-2012, 04:37 PM   #12
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
here is some human
https://youtube.com/watch?v=k6R9hMV1jNk

Code:
k6R9hMV1jNk
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-13-2012, 08:08 AM   #13
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,236
Quote:
Originally Posted by Brujah View Post
here is some human
https://youtube.com/watch?v=k6R9hMV1jNk

Code:
k6R9hMV1jNk
human heh ;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.