Vi använder kakor för att göra LingQ bättre. Genom att besöka sajten, godkänner du vår cookie policy.

us   United States

Anybody can provide a simple full code example of creating a lesson?

February 2018

Short Version:

Anybody mind writing a fully functional script example for me that just creates a lesson with static values that creates a title, the main text and audio (i have some audio on my web server so if possible remote audio through url but if not i can download them locally). I'm having problems using the API documentation to figure out how to get started. I can do the my side computing of parsing data to send, but i'm having issues figuring out how to actually then take that and send it to lingq. Thank you so much :).

The Long of it:

I have like 300 audio lessons with transcripts and such like that that I would love to bring into lingq and study that way rather than as a bunch of files on my computer. I dont plan on bringing them all in at once, but I would like to create a little script that can do them in 50 lessons chunks as I need them.

I've done basic programming. I know how to take the data I have and parse it into elements that can hopefully be sent to lingq thorugh the API to make lessons out of all the information I have (currently i've already made a script that parses my system file and created an xml that holds all the audio locations for upload as well as parsing the text files for the transcripts and all that info is in an xml file ready to be parased again and hopefully uploaded. If it works that way.

But because my programming is new and limited, i'm having problems understanding the API documentation. I dont even know where to start. I was hoping somebody could create a little, fully functional script for me, preferably in PHP if possible, but I can figure out how javascript if need be, that would create a lessong. Using static variables is fine, I can create the dynamically updating loops for the information on my own, I think. I'm just really lost on how to connect to the lingq servers and start passing it the elements. Thank you so much! I hope this makes sense. I"m really new to all this.

this is what i've tried so far to no success

This is basically what I tried to do, with no results. I GET all my lessons in JASON (i think) but it wont allow me to create a lesson or course. Even a basic one like this.

<form action="http://www.lingq.com/api/v2/ja/lessons/" method="POST">

<p>title: <input type="text" name="title" id="title" value="title"/></p>

<p>Caption: <input type="text" name="text" id="text" value="text" /></p>

<p>tags: <input type="text" name="tags" id="tags" value="tags" /></p>

<input type="submit" name="submit" value="Upload" />