Zennoposter API ? Or a way to call a template from outside

simd

Новичок
Регистрация
15.08.2021
Сообщения
4
Благодарностей
1
Баллы
3
Hello,

I am developing a NextJS app in Javascript.
I receive a text from the client which I want to modify on a website who optimize the text. This website doesn't have API, so I've created a template who can take a text, make the action on the browser and I can then extract the new text and call my NextJS app to show the new text to the client.

--> The only challenge I've got is that I would like to call the execution of the template when my client click a button "Optimize my text".

But I don't find a way to execute template on Zennoposter from an outside call.

Do you guys have a solution?

Thank you
 

Phoenix78

Client
Read only
Регистрация
06.11.2018
Сообщения
11 789
Благодарностей
5 721
Баллы
113
There is no API in zennoposter. You will have to make a pad that will check the database in search of tasks, and add tasks to the database when the user clicks on the button.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 480
Благодарностей
5 917
Баллы
113
You can create bat file for your template
and if you call bat file somehow remotely, then it will run the template.
104635
 
  • Спасибо
Реакции: Besedi

myndeswx

Client
Регистрация
15.05.2017
Сообщения
436
Благодарностей
104
Баллы
43
The easiest way would be to have your template running on a loop just doing checks to the database if there are new tasks, if task is found - take it and continue normal templates work.

More complicated option would be to have a separate 'controller' template running that is looking for the tasks only, and it would start other templates/adjust the threads as needed.
 
  • Спасибо
Реакции: VladZen

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
113
Баллы
43
  • Спасибо
Реакции: VladZen

Besedi

Client
Регистрация
04.03.2019
Сообщения
234
Благодарностей
41
Баллы
28
The easiest way would be to have your template running on a loop just doing checks to the database if there are new tasks, if task is found - take it and continue normal templates work.

More complicated option would be to have a separate 'controller' template running that is looking for the tasks only, and it would start other templates/adjust the threads as needed.
I use this but encountered with some problem, so, what's if project will stuck on some action? And if you don't have a timeout limit this thread will be in timeless loop ( so, no goodend or backend won't calling and your data will pickling in the loop) any suggestions?
 

myndeswx

Client
Регистрация
15.05.2017
Сообщения
436
Благодарностей
104
Баллы
43
If it get's stuck in an infinite loop then it's a completely different problem (coded incorrectly)
Of course random things happen from time to time so you must have a timeout for the template, and configure 'bad end' properly, so when it is interrupted by the timeout - task gets reset and re-attempted.
A lot depends on the type of project of course )
 

simd

Новичок
Регистрация
15.08.2021
Сообщения
4
Благодарностей
1
Баллы
3
OK, thank you all.
So the easiest solutions would be :
- Create a bat file and find a way to call it from outside
- "polling" like every minutes the database or whatever I used, if there is a "true" or "new line" , tell to the template to continue

More complicated : create a controller template that call the good template as you did @EtaLasquera ?Right ?
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
113
Баллы
43
OK, thank you all.
So the easiest solutions would be :
- Create a bat file and find a way to call it from outside
- "polling" like every minutes the database or whatever I used, if there is a "true" or "new line" , tell to the template to continue

More complicated : create a controller template that call the good template as you did @EtaLasquera ?Right ?
We can start, pause, stop, view log, schedule, view screenshots or write details about execution outside zenno.
As example. press play start a bot:
104702



Logs example:
104705
 
  • Спасибо
Реакции: myndeswx

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)