lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (fwd)


From: Martin Tarenskeen
Subject: Re: (fwd)
Date: Tue, 21 Mar 2017 08:40:13 +0100 (CET)
User-agent: Alpine 2.20 (LFD 67 2015-01-07)


On Mon, 20 Mar 2017, Trevor wrote:

  It's not hard to hit LilyBin from the command line, but the interface isn't
  great. Try curl -X POST -H "Content-Type:application/json"
  
https://7icpm9qr6a.execute-api.us-west-2.amazonaws.com/prod/prepare_preview/stable
  -d '{"code": "% LilyBin\n\\score{\n\t{\n\t\t\\repeat unfold 120
  { c4. d e f }\n\t}\n\n\t\\layout{}\n\t\\midi{}\n}\n"}'.
  The response will include an "id" field. You can download the result from
  https://s3-us-west-2.amazonaws.com/lilybin-scores/${id}.pdf.

Thanks. That's a good start. I have tried it, and it works. But yes, it looks ugly :-)

I am trying to put this idea in a working bash or python script now.
I am not really a virtuoso with grep and regular expressions, but I guess I could use that to extract the stringvalue after the "id": field from the response I am getting from the first line

{"stdout":"","stderr":"Processing `input.ly'\nParsing...\ninput.ly:1: warning: no \\version statement found, please add\n\n\\version \"2.18.2\"\n\nfor future compatibility\nInterpreting music...[8][16][24][32][40][48][56]\nPreprocessing graphical objects...\nInterpreting music...\nMIDI output to `rendered.midi'...\nFinding the ideal number of pages...\nFitting music on 1 or 2 pages...\nDrawing systems...\nLayout output to `rendered.ps'...\nConverting to `./rendered.pdf'...\nSuccess: compilation successfully completed\n","id":"1490078842785-3632-246681695-lnytb2x5437hkt9","files":{"pdf":true,"midi":true}}

I am sure one of you reading this wants to take the challenge to construct a regex to use with grep that will return the id, in this example that should be "1490078842785-3632-246681695-lnytb2x5437hkt9" without the quotes?

--

MT

reply via email to

[Prev in Thread] Current Thread [Next in Thread]