Answer the question
In order to leave comments, you need to log in
How to understand this strange script?
The "readme" for the application gives a "description" of how you can use the utility in this form:
Here's a typical use case to check 20 seconds from an mp3 file, starting at the 10th second:
echoprint-codegen ./recorded.mp3 10 20 | \
curl -F "[email protected]" developer.echonest.com/api/v4/song/identify?api_ke...
{"response": {"status": {"version": "4.2", "code" : 0, "message": "Success"},
"songs": [{"tag": 0, "score": 66, "title": "Creep", "message": "OK (match type 6)" ,
"artist_id": "ARH6W4X1187B99274F", "artist_name": "Radiohead", "id": "SOPQLBY12A6310E992"}]}}
Answer the question
In order to leave comments, you need to log in
echoprint.me/codegen generates something that is passed to curl
-F, --form
(HTTP) This lets curl emulate a filled-in form in which a user
has pressed the submit button. This causes curl to POST data
using the Content-Type multipart/form-data according to RFC
2388. This enables uploading of binary files etc. To force the
'content' part to be a file, prefix the file name with an @
sign. To just get the content part from a file, prefix the file
name with the symbol <. The difference between @ and < is then
that @ makes a file get attached in the post as a file upload,
while the < makes a text field and just get the contents for
that text field from a file.
Example, to send your password file to the server, where 'password
' is the name of the form-field to which /etc/passwd will be
the input:
curl -F [email protected]/etc/passwd www.mypasswords. com
To read content from stdin instead of a file, use - as the filename
. This goes for both @ and < constructs.
That's actually all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question