Import automation

I read some older threads about automating import of content, but those threads seem to have trailed off without a conclusion. Is there any method for automation of lesson import?

Thanks,
Brian

2 Likes

I was just checking out the same thing. I was fiddling around with using Selenium webdriver to automate the process. Not sure if you have programming experience, but if so, that might be a good option.

1 Like

What is it that you guys are looking to import? The extensions donā€™t work for you?

Yeah the extensions are great. I was talking about importing hundreds of lessons at a time (e.g., importing the text of a novel or something). I assumed thatā€™s what the original post was about, but I could be wrong.

In that case, it might just be easiest to copy and paste the full text of the book into the import page and let our importer split it automatically into parts. That is how I import books.

It is indeed importing of many things at once that Iā€™m looking for. I read about the extension, looks like it only deals with the text. I have a fairly large set of content (couple hundred audio files with text, going through these one at a time is rather tedious.
Selenium is worth considering, and Iā€™ve started playing with it, but I always hate solutions that depend heavily on the details of the upload web page - would be better if native import APIs were available.

1 Like

Sometimes I do that, but for me, the parts are too long.

We have updated our API docs to include that import API now. Enjoy!

1 Like

Iā€™ve tried to use the new API, but get an error 500 back from the site. Iā€™m using python, and havenā€™t had a chance to debug further to see if Iā€™m doing something wrong. I am able to request data using the APIs, but POSTing a new lesson doesnā€™t work for me. Do you have any example scripts that work successfully that I could compare against?

That said, I did successfully get something working using Selenium. A little kludgy, but it works.

@xubio1 - We have fixed several issues but donā€™t see anything in the logs from your account. In the simple example already in the doc only the ā€œtitleā€ and ā€œtextā€ fields are mandatory.

Hereā€™s another one:

curl -X POST
-H ā€œContent-Type: application/jsonā€
-H ā€œAuthorization: Token TOKENā€
-d ā€˜{ā€œtitleā€: ā€œTestā€, ā€œtextā€: ā€œJust a testā€}ā€™
https://www.lingq.com/api/v2/en/lessons/

I suppose what you have done is a 2 steps process:

  1. collect content (text and audio)
  2. update the content as lessons in a course at lingq

Here are my questions:
a) If the content (step 1) is on the web, what automation tool do you use to download the hundreds of files?
b) Is it possible to have access to your method to do step 2?

Thanks

Iā€™ve got a few ideas for importing material that could be nice:

Auto import by sending either an URL or the text that you want imported to a specific email address (amazon has this feature with their kinde, where you can just send a text to a personalized email address) - this is great if you have something that you want to save for later study.

Auto import from RSS feed - eg. all posted articles of a specific site are automatically imported in a new course for each day (perhaps with auto-deletion too, if there is a space-issue) (can google news be turned into an rss feed?)

Quick import for android (I know itā€™s on the way, but I canā€™t wait :wink: )

1 Like