I have been thinking which one I like and ... I selected to use both for my Betfair API library.
The algorithm is following. If there are client-2048.key and client-2048.crt files in current app directory, then bot login is used. If they are missing - the library fallback to interactive login tranparently.
The example is:
As usual, I prefer think of interactive and bot login as "strong" and "weak" logins. Interactive login is in fact so easily used in non-interactive way
The algorithm is following. If there are client-2048.key and client-2048.crt files in current app directory, then bot login is used. If they are missing - the library fallback to interactive login tranparently.
The example is:
C:\Projects\Github\betfair\test [master]> node login.js
===== Logging in to Betfair (bot) =====
Login OK, 0.429 secs
===== Logging out... =====
Logout OK, 0 secs
Done
C:\Projects\Github\betfair\test [master]> ren .\client-2048.key .\client-2048-bak.key
C:\Projects\Github\betfair\test [master]> node login.js
===== Logging in to Betfair (interactive) =====
Login OK, 0.377 secs
===== Logging out... =====
Logout OK, 0 secs
Done
C:\Projects\Github\betfair\test [master]> ren .\client-2048-bak.key client-2048.key
C:\Projects\Github\betfair\test [master]> node login.js
===== Logging in to Betfair (bot) =====
Login OK, 0.377 secs
===== Logging out... =====
Logout OK, 0 secs
Done
===== Logging in to Betfair (bot) =====
Login OK, 0.429 secs
===== Logging out... =====
Logout OK, 0 secs
Done
C:\Projects\Github\betfair\test [master]> ren .\client-2048.key .\client-2048-bak.key
C:\Projects\Github\betfair\test [master]> node login.js
===== Logging in to Betfair (interactive) =====
Login OK, 0.377 secs
===== Logging out... =====
Logout OK, 0 secs
Done
C:\Projects\Github\betfair\test [master]> ren .\client-2048-bak.key client-2048.key
C:\Projects\Github\betfair\test [master]> node login.js
===== Logging in to Betfair (bot) =====
Login OK, 0.377 secs
===== Logging out... =====
Logout OK, 0 secs
Done



Comment