Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

API changed? #196

Closed
mexus opened this issue Nov 8, 2023 · 11 comments
Closed

API changed? #196

mexus opened this issue Nov 8, 2023 · 11 comments

Comments

@mexus
Copy link

mexus commented Nov 8, 2023

First of all, thanks for the app!

A couple of days ago I've encountered the following problem:

$ ./node_modules/yaspeller/bin/yaspeller --version
9.1.0
$ echo 'hello' | ./node_modules/yaspeller/bin/yaspeller --debug --stdin
[DEBUG] Get/check config.
Spelling check:
(node:13198) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[DEBUG] Original text: hello

[DEBUG] Prepared text for API: hello
[DEBUG]
    request: 0
    format: "plain"
    apiFormat: "plain"
    lang: "en,ru"
    options: {}
    text: "hello"
[DEBUG] Yandex.Speller API response:
[DEBUG] {
  "err": true,
  "data": "Yandex.Speller API:\n-------------------\nStatus code: 307\nResponse: \nJSON.parse(Response): SyntaxError: Unexpected end of JSON input\n"
}
Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Checking finished: 0.301 sec.

Seems like yandex has changed their API? Or do they now expect only JSONs, but the app sends plain text? Unfortunately I'm not familiar neither with the yandex spell checking API nor with nodejs, so I can't end up with any useful hints :(

@dmitry-mightydevops
Copy link

I'm also getting Status code: 307 with 9.1.0

➜ pre-commit run yaspeller --files
[INFO] Initializing environment for https://github.com/antonbabenko/pre-commit-terraform.
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/compilerla/conventional-pre-commit.
[INFO] Initializing environment for https://github.com/DavidAnson/markdownlint-cli2.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:prettier,prettier-plugin-nginx,prettier-plugin-sh,prettier-plugin-toml.
[INFO] Initializing environment for https://github.com/hcodes/yaspeller.git.
[INFO] Installing environment for https://github.com/hcodes/yaspeller.git.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
yaspeller................................................................Failed
- hook id: yaspeller
- exit code: 2

Spelling check:
(node:2944630) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Checking finished: 1.171 sec.
Spelling check:
(node:2944631) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Checking finished: 1.329 sec.
Spelling check:
(node:2944632) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Checking finished: 0.467 sec.

@dmitry-mightydevops
Copy link

Single file scan:

yaspeller README.md 
Spelling check:
Yandex.Speller API:
-------------------
Status code: 307
Response: 
JSON.parse(Response): SyntaxError: Unexpected end of JSON input

Checking finished: 0.607 sec.

@weblabio
Copy link

weblabio commented Nov 9, 2023

+1

2 similar comments
@perevezencev
Copy link

+1

@aiekseu
Copy link

aiekseu commented Nov 9, 2023

+1

@sglazov
Copy link

sglazov commented Nov 9, 2023

+1

1 similar comment
@solarrust
Copy link

+1

@hcodes
Copy link
Owner

hcodes commented Nov 10, 2023

Написал в поддержку Яндекса, получил ответ:

Здравствуйте!

Спасибо за интерес к нашему проекту.

Сейчас сервис Спеллер не поддерживается. Он работает в таком виде, как есть, и дорабатываться не будет.

Возможно, в будущем мы сможем вернуться к его полноценной поддержке и наладить работу.

@hcodes
Copy link
Owner

hcodes commented Nov 10, 2023

Тут два варианта:

  1. Перейти на новое API, но нужно будет выпилить многие настройки из утилиты и я не проверял как обрабатываются тексты в новом API.
  2. Закрыть проект.

Попробую перевести утилиту на новое API, а дальше будет видно что делать с проектом.

@hcodes
Copy link
Owner

hcodes commented Nov 11, 2023

v10.0.0

Переключил на новое API Яндекс Спеллера, точнее с устаревшего на старое. Из четырёх опций работает только одна. Русскоязычные ссылки не игнорируются.

Это issue закрываю, на найденные баги, пожалуйста, заводите отдельные issue.

@hcodes hcodes closed this as completed Nov 11, 2023
@mexus
Copy link
Author

mexus commented Nov 14, 2023

Спасибо за оперативное решение! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants