Dear anyone,
Your duolingo forum registration isn't automaticaly transferred to duome forum so in order to join duome forums you need to register with your existing or any other username and email; in any case it's advised that you choose a new password for the forum.
~ Duome Team

Duolingo sentence Discuss button deviates to Duome

Ask, and we'll consider your request. Provide an accurate description of what you would like to do/have, and we'll consider implementing it, if this is technically possible.


User avatar
Basler Biker
Switzerland

Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

I had a dream ==> the duolingo Discuss button is deviated directly to duome forum, and creates or finds the relevant entence discussion in duome !!

Maybe an idea for the Chrome-Extension specialist developers reading this ??


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
duome

Re: Duolingo sentence Discuss button deviates to Duome

Post by duome »

That would be cool. I was actually thinking of a Chrome extension for some other reasons, so yes, I'm one of those who tend to believe that dreams do come true ;)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Sketch of implementation would maybe look something like this:

  • Add an extra table in the forum database, duolingo_sentences. Has foreign-key columns duolingo_id, topic_id, plus source_lang and target_lang. topic_id always points to a topic in the "Duolingo sentences" subforum.
  • On that subforum, manual creation of topics is disabled; they can only be created via API. The API has a single POST route, which takes a single query parameter for the Duolingo sentence ID. It looks that up in the table, then returns a link to the relevant topic if available, otherwise fetches the relevant info from Duolingo and creates both the topic (with first post by an anonymous user containing the sentence itself in source and target languages) and the corresponding entry in the new table.
  • Create tampermonkey script or standalone browser extension to hit that route from the relevant Duolingo exercise pages via a button, then open the existing/newly created sentence discussion in a new tab.

However, there doesn't seem to be any way to share the Duolingo sentence ID from the app to desktop, so there wouldn't be any way to do it through the app. I wonder if this can/should be somehow connected with Duome's existing caching of sentences... do those sentences also reference a unique Duolingo sentence ID on the back end? [mention]duome[/mention]

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
duome

Re: Duolingo sentence Discuss button deviates to Duome

Post by duome »

No. There's a lexeme_id as the only input parameter and it's a random sentence with one sample translation returned as a result.

There is such thing as related discussions but they are related to words, e.g. Spanish 'cielo' has 13 sample sentences but only one related discussion / comment id 1297888 ... well, it does relate to a specific sentence, but it's only 1 out of 13 sample sentences having a comment id.

... "esperanza" has 10 sample sentences but no comment ids ... and if the ratio remains more or less the same across the entire database, there would be relatively few discussion ids there.

Good news: I have just learned something new and I can now get a lot more sample sentences and do it a lot faster than before 8-)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

BTW comment IDs (referencing discussions, currently locked, on the original Duolingo forum) are different from the sentence IDs, which I should really be calling "challenge IDs" I guess as that's what Duolingo calls them. Those look something like d46c712276dd46ddb3c30139c3943453 and are used by Duolingo's API.

Actually I'm not certain how easy it is to retrieve those challenge IDs programmatically and deterministically via the Duolingo web app, though you can view them in browser dev tools Network tab — might be that Duolingo always randomizes them on each fetch... 😕

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

duome wrote: Wed Apr 20, 2022 8:29 pm

No. There's a lexeme_id as the only input parameter and it's a random sentence with one sample translation returned as a result.

There is such thing as related discussions but they are related to words, e.g. Spanish 'cielo' has 13 sample sentences but only one related discussion / comment id 1297888 ... well, it does relate to a specific sentence, but it's only 1 out of 13 sample sentences having a comment id

Maybe we can just take the main sentence as title, and the translation as initial content, and auto-create the topic for it.
So we forget all technical ID's (which would be a pity, as it leads to former discussions in the hobune archive)


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

I was worried that we couldn't search on pure numeric TAG as part of a title or message body,
BUT WE CAN !

The following works fine to search by discussion/comment ID (in Swedish = 22 and subforums )
https://forum.duome.eu/search.php?keywords=[8373249]&fid[]=22&sc=1&submit=Search
https://forum.duome.eu/search.php?keywords=8373249&fid[]=22&sc=1&submit=Search

So it also works with just "8373249" without [ ]

in full, with some options to set the initial result list
https://forum.duome.eu/search.php?keywords=8373249&terms=all&author=&fid%5B%5D=22&sc=1&sf=firstpost&sr=topics&sk=t&sd=d&st=0&ch=300&t=0&submit=Search


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

luo-ning wrote: Wed Apr 20, 2022 9:24 pm

BTW comment IDs (referencing discussions, currently locked, on the original Duolingo forum) are different from the sentence IDs, which I should really be calling "challenge IDs" I guess as that's what Duolingo calls them. Those look something like d46c712276dd46ddb3c30139c3943453 and are used by Duolingo's API.

Actually I'm not certain how easy it is to retrieve those challenge IDs programmatically and deterministically via the Duolingo web app, though you can view them in browser dev tools Network tab — might be that Duolingo always randomizes them on each fetch... 😕

I think indeed that inside the app, once the lesson is loaded into memory, you have all "resources" already there. During a lesson there is never access to the server. Lessons are composed randomly with a subset of lexemes taken from the full set of lexemes assigned to a skill/level. So there are for sure no ID's of sentence discussion/comments there. I would think that the lexeme-ID/challenge-IDs are always the same (unique internal key of DL's database)

But the extension could (can it?) simulate/exec a key-press on "discuss" and catch the response of the server, and clearly there the server will return an existing comment-ID, or if it's a first discussion it will have created the new ID for it, either of which we can capture ???


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
Corinnebelle

Re: Duolingo sentence Discuss button deviates to Duome

Post by Corinnebelle »

This is kind of the hard work way, but I wonder if we could have specific search bar, for those of us who use a different browser to chrome, where we can copy any sentence id from DL [if it works that way], and a topic will come up in Duome if it is there and give you the option if it isn't there to create one.

I know you can access sentences from the dictionary from the examples. That's the only way besides doing lessons right now.

🇺🇸 L1 🇮🇱 Advanced beginner Duolingo levels

Languages without borders, languages bridging gaps, the Red Cross are my heroes.

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

Corinnebelle wrote: Thu Apr 21, 2022 8:06 am

This is kind of the hard work way, but I wonder if we could have specific search bar, for those of us who use a different browser to chrome, where we can copy any sentence id from DL [if it works that way], and a topic will come up in Duome if it is there and give you the option if it isn't there to create one.

I know you can access sentences from the dictionary from the examples. That's the only way besides doing lessons right now.

well, suppose we have all sentence discussions in a single "duolingo Sentence Discussion" forum, no matter what the "from" /"to" language is, then you would just go to that forum, and use the "search this forum" field to enter the comment-ID where the sentence is being discussed on DL. Missing topics can be created by hand then, and hopefully authors will create it with the correct TAG and TEXT in the title.

If say the sentences are grouped by language, then the same would apply, or else the advanced search will always work, whatever we do, however we do it.


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Basler Biker wrote: Thu Apr 21, 2022 7:30 am

But the extension could (can it?) simulate/exec a key-press on "discuss" and catch the response of the server, and clearly there the server will return an existing comment-ID, or if it's a first discussion it will have created the new ID for it, either of which we can capture ???

Hmm good point, might be possible to create a kind of proxy for XMLHttpRequest, which I think Duolingo uses under the hood to make the requests, which does exactly as normal (won't affect other functionality) but also caches the results in a way that'll be accessible to the extension.

IIRC there were some other extensions that provided enhancements to core Duolingo functionality, e.g. one that showed all the alternative answer versions within the UI (which would only be possible with access to that same data) —wonder if this is the same approach they took?

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

luo-ning wrote: Thu Apr 21, 2022 10:49 am
Basler Biker wrote: Thu Apr 21, 2022 7:30 am

But the extension could (can it?) simulate/exec a key-press on "discuss" and catch the response of the server, and clearly there the server will return an existing comment-ID, or if it's a first discussion it will have created the new ID for it, either of which we can capture ???

Hmm good point, might be possible to create a kind of proxy for XMLHttpRequest, which I think Duolingo uses under the hood to make the requests, which does exactly as normal (won't affect other functionality) but also caches the results in a way that'll be accessible to the extension.

IIRC there were some other extensions that provided enhancements to core Duolingo functionality, e.g. one that showed all the alternative answer versions within the UI (which would only be possible with access to that same data) —wonder if this is the same approach they took?

hmmM... to be honest, I think the "Solutions Viewer" just gets the complete list from the app already in memory. I think the whole "lesson", once loaded and started, has all info in it already, and also for every "challange" the full list of valid answers already loaded in memory. During the whole lesson there is, my guess, no access to the server whatsoever. And if I remember well, lessons can be done "offline", so that proves it already ;-)


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Basler Biker wrote: Thu Apr 21, 2022 2:09 pm

gets the complete list from the app already in memory.

I don't think that's possible, as the in-memory response seems to be scoped within the Duolingo app itself and so isn't available to any scope that an extension would have access to.

Took me a while to find it, but I looked through the code for duolingo-solution-viewer and found it's also overriding XMLHttpRequest here (duo-toolbox is a dependency of duolingo-solution-viewer).

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Corinnebelle

Re: Duolingo sentence Discuss button deviates to Duome

Post by Corinnebelle »

I would prefer grouped by language.

🇺🇸 L1 🇮🇱 Advanced beginner Duolingo levels

Languages without borders, languages bridging gaps, the Red Cross are my heroes.

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

Corinnebelle wrote: Fri Apr 22, 2022 12:17 am

I would prefer grouped by language.

indeed. You can then browser other sentences too "while you are on the forum".

Would "from" language also matter? So that means we have to take into account From+To language... meaning we have a new Duolingo Sentence Discussion subforum in all the ones that exist now...


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
EranBarLev
Israel

Re: Duolingo sentence Discuss button deviates to Duome

Post by EranBarLev »

Basler Biker wrote: Fri Apr 22, 2022 5:23 pm

Would "from" language also matter?

Yes, the SDs have to include a translation to the "from" language.

🇮🇱N 🇬🇧C1 🇪🇸B2 🇵🇹B1 🇫🇷B1 🇸🇦A1 🇷🇺A1

User avatar
Corinnebelle

Re: Duolingo sentence Discuss button deviates to Duome

Post by Corinnebelle »

Having SDs under language forums, will allow the individual language to moderated and also allow native speakers and others to help out more easily.

🇺🇸 L1 🇮🇱 Advanced beginner Duolingo levels

Languages without borders, languages bridging gaps, the Red Cross are my heroes.

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

This is true... but there won't always be a 1-to-1 correspondence, e.g. say Duolingo adds a new course for Kay(f)bop(t) but we haven't added the corresponding Kay(f)bop(t) forum yet.

Maybe a single flat forum but filterable by source and target language would work?

BTW this is shaping up to look like quite a bit of work and there are quite a few unresolved design decisions right now... so might take a while 😅

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

maybe we stick to the initial "idea"...the Discuss button deviates to duome. So that's a quite simple extension as a first step.
We should then provide the "landing" page. Maybe just a first "How to" guide explaining how to create a sentence discussion topic manually.

  • which forum to use
  • what shall be in title
  • what TAGS
  • what minimal content for the body...(the link to archives, etc)

that would already start it off. And that shouldn't be too much work inbetween the soup and the potatoes ;-) (that's a Dutch expression)

In next phase we can think about the automation of the manual things...So it's not bad that we practice first with a set of sentences created manually...only then can we fine-tune the manual actions, and later we can automate them where possible or where needed. in the mean time things may change on duolingo and we may have to adjust our "approach".


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

The key thing is it needs to link to an existing sentence discussion if one has already been created, rather than creating duplicate topics each time. Also that any intermediate solution should be forward compatible, i.e. easy to automatically convert to a more complete solution (so the sentence data needs to be machine readable).

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

luo-ning wrote: Sat Apr 23, 2022 2:30 pm

... needs to link to an existing sentence discussion...

imho that would be the automated version, which is maybe for later, and maybe we can initially live with people doing a search for the comment-ID, and if not then create a new topic. Maybe we can initially live with accidental "doubles"... It's just how we write the initial "welcome to Duome Sentence Discussion" and how we organize ourselves to allow for growth and expansion.

Of course, it would be super fun to have a complete solution from the start. But if parts are difficult, and need more analysis and design, we can implement those in a later phase.


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Basler Biker wrote: Sat Apr 23, 2022 2:47 pm

initially live with people doing a search for the comment-ID, and if not then create a new topic.

The issue with that is forward-compatibility. If leaving it to individuals to manually create the topics, we'll inevitably have people changing the format etc. and then they won't be machine convertible so again will lead to duplicates.

I think a slightly more involved intermediate solution will be possible that won't have this problem though. Gonna do some testing today.

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Got an MVP version up and running locally, seems to be working pretty well (core logic at least — still needs a bit more work until it's actually usable) 😁

sentence_bot.jpg
sentence_bot.jpg (69.31 KiB) Viewed 44171 times

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

luo-ning wrote: Sun Apr 24, 2022 4:14 am

Got an MVP version up and running locally, seems to be working pretty well (core logic at least — still needs a bit more work until it's actually usable) 😁

sentence_bot.jpg

That looks VERY promissing already indeed. :D

Very first reaction, if you allow me, nowhere the comments-ID visible somewhere,
maybe as a [12345678] tag for our "search" feature?


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Basler Biker wrote: Sun Apr 24, 2022 11:40 am

Very first reaction, if you allow me, nowhere the comments-ID visible somewhere,
maybe as a [12345678] tag for our "search" feature?

Changed the links to have the full URL text:

search_by_comment_id.PNG
search_by_comment_id.PNG (57.47 KiB) Viewed 44143 times

Ignore the "replies: -1" thing — one of several bugs that need ironing out.

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

OK, this is now in open beta. Expect bugs!

How to install:

  1. Install Tampermonkey
  2. Restart your browser
  3. Go to ext/luoning/sentencediscussions/styles/ ... pt.user.js and install the userscript
  4. You should now see a "DUOME" button next to most Duolingo challenges after you solve them, like this:
    duome_btn.PNG
    duome_btn.PNG (13.86 KiB) Viewed 44127 times
  5. When you click it, a topic will be created in the Sentence Discussions subforum that you can reply to, or if one already exists for that sentence, you'll be taken there.

Note that not every sentence has a translation or a corresponding discussion on the Duolingo forum, which is why you won't always see those elements.

Last edited by luo-ning on Mon Apr 25, 2022 6:52 pm, edited 4 times in total.

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Explorer
Portugal

Re: Duolingo sentence Discuss button deviates to Duome

Post by Explorer »

This browser add-on is really helpful! It should be pinned, so that everyone can check it out.

🇬🇧 🇪🇸 🇵🇹 🇫🇷 🇩🇪 | Learning: 🇯🇵 |

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

I don't have the button redirected yet. Doing EN=>SV lesson Basic 1/2
Browser was restarted, Extension installed and active.

but it seems to work for other people. Now a next observation for the polishing after it's bugfree ;-)

  • how to avoid flooding the "new posts" filter with all those new posts ??? can we tamper with the creation date, setting it backwards to 1/1/2022 or so?

BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

User avatar
luo-ning

Re: Duolingo sentence Discuss button deviates to Duome

Post by luo-ning »

Basler Biker wrote: Mon Apr 25, 2022 12:16 am

I don't have the button redirected yet. Doing EN=>SV lesson Basic 1/2
Browser was restarted, Extension installed and active.

Hmm... Same problem after refreshing the Duolingo page with F5? And is it missing for all challenges or just some?

Basler Biker wrote: Mon Apr 25, 2022 12:16 am

how to avoid flooding the "new posts" filter with all those new posts ??? can we tamper with the creation date, setting it backwards to 1/1/2022 or so?

Could do, but probably more trouble than it's worth — it's mainly just an anomaly due to me spamming it with my testing (I already did quite a bit of testing locally, but a few bugs showed up on the live version that didn't in my local testing). Generally I'd expect the rate of new Sentence Discussion posts to be a steady trickle more than a flood.

🦀 Pensando en la inmortalidad del cangrejo 🏴‍☠️ Flags Are Not Languages

User avatar
Basler Biker
Switzerland

Re: Duolingo sentence Discuss button deviates to Duome

Post by Basler Biker »

luo-ning wrote: Mon Apr 25, 2022 12:45 am
Basler Biker wrote: Mon Apr 25, 2022 12:16 am

I don't have the button redirected yet. Doing EN=>SV lesson Basic 1/2
Browser was restarted, Extension installed and active.

Hmm... Same problem after refreshing the Duolingo page with F5? And is it missing for all challenges or just some?

Basler Biker wrote: Mon Apr 25, 2022 12:16 am

how to avoid flooding the "new posts" filter with all those new posts ??? can we tamper with the creation date, setting it backwards to 1/1/2022 or so?

Could do, but probably more trouble than it's worth — it's mainly just an anomaly due to me spamming it with my testing (I already did quite a bit of testing locally, but a few bugs showed up on the live version that didn't in my local testing). Generally I'd expect the rate of new Sentence Discussion posts to be a steady trickle more than a flood.

OK. Did some more testing and found the following correlation:

  • It seems to be missing on the first sentence of some lessons only.
  • From the 2nd sentence onwards it's always all there.
  • Some skills - I tested a lesson in 4 skills. 2 have it missing on the first sentence, 2 others not,
  • but OK for all 4 on next sentences
  • F5 did not cure the cases where it's missing

"Missing" means the Discuss button is there, but not the Duome button next to it.


BB - Basler Biker - Positivity and constructiveness will prevail
Native :belgium: :netherlands: / fluent :fr: :de: :uk: / learning :sweden: / fan of :switzerland: (bs/bl)

Post Reply

Return to “Requests new Duome features”