commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
EDIT: command updated to support accented characters!
Works in any of 58 google supported languages (some sound like crap, english is the best IMO).
You get a mp3 file containing your query in spoken language. There is a limit of 100 characters for the "q" parameter, so be careful. The "tl" parameter contains target language.
The FLAC audio must be encoded at 16000Hz sampling rate (SoX is your friend).
Outputs a short JSON string, the actual speech is in the hypotheses->utterance, the accuracy is stored in hypotheses->confidence (ranging from 0 to 1).
Google also accepts audio in some special speex format (audio/x-speex-with-header-byte), which is much smaller in comparison with losless FLAC, but I haven't been able to encode such a sample.
substitute "example" with desired string;
tl = target language (en, fr, de, hu, ...);
you can leave sl parameter as-is (autodetection works fine)
Substitute that 724349691704 with an UPC of a CD you have at hand, and (hopefully) this oneliner should return the $Artist - $Title, querying discogs.com.
Yes, I know, all that head/tail/grep crap can be improved with a single sed command, feel free to send "patches" :D
One cannot call the high quality livestream directly, but command this gives you a session ID and the high quality stream. #egypt #jan25
Nothing special required, just wget, sed & tr!
This will uncompress the file while it's being downloaded which makes it much faster
Little faster alternative.
This is a convinient way to do it in scripts. You also want to rm the ip.php file afterwards
Download Gsplitter extension, and execute it with Chrome !
Or download it here :
Useful for ripping wallpaper from 4chan.org/wg
Seeing that we get back plain text anyway we don't need lynx. Also the sed-part removes the credit line.
Download google video with wget. Or, if you wish, pass video URL to ie mplayer to view as stream.
1. VURL: replace with url. I.e. http://video.google.com/videoplay?docid=12312312312312313#
2. OUPUT_FILE : optionally change to a more suited name. This is the downloaded file. I.e. foo.flv
# Improvements greatly appreciated. (close to my first linux command after ls -A :) )
Breakedown pipe by pipe:
1. wget: html from google, pass to stdout
2. grep: get the video url until thumbnailUrl (not needed)
3. grep: Strip off everything before http://
4. sed: urldecode
5. echo: hex escapes
6. sed: stipr of tailing before thumbnailUrl
7. wget: download. Here one could use i.e. mplayer or other...
I have a server with a php requiring basic authentication, like this:
header('WWW-Authenticate: Basic realm="do auth"');
header('HTTP/1.0 401 Unauthorized');
And the basic authentication in wget do not worked:
wget --auth-no-challenge --http-user="username" --http-password="password" -O- "http://url"
wget --keep-session-cookies --save-cookies=cookies.txt --load-cookies=cokies.txt --http-user="username" --http-password="password" -O- "http://url"
I always received the 401 Authorization failed.
The saved cookie is always empty.
With my way, I received the header from the server and save the cookie, then resend the session cookie with authentication data
Is a simple script for video streaming a movie