-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Idea: Translate webpage from url #21
Labels
enhancement
New feature or request
Comments
Thank you for the feature suggestion, @SleeplessOne1917 ! We think it makes sense and if you open a pull request, we will certainly review it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The contributors file said that would-be contributors should open an issue for suggested features instead of just jumping straight into making a pull request. I'm using the bug template because there is no feature template.
Describe the Feature
Generate a translated HTML document based off of the URL for a webpage. The following code snippet would translate the page for DeepL's English Wikipedia article into German and save it in the file DeepLWiki.html:
In line with the other document related functions, there can be an
uploadWebpageToDocument
function that takes a URL as the first argument with the rest of its arguments being the same asuploadDocument
.getDocumentStatus
anddownloadDocument
would not need their own versions asuploadWebpageToDocument
would return aDocumentHandle
likeuploadDocument
does.Implementation
Without writing the exact code, I think
uploadWebpageToDocument
would first make a request to the URL that's passed in as an argument. If the request is successful and the response has it'sContent-Type
header settext/html
, the response HTML gets put into a buffer and passed touploadDocument
along with the rest of the parameters. If the request to the website fails or the response is not the expected mime type, the function throws an error.The text was updated successfully, but these errors were encountered: