     __          _           ___  ___  ___  __  
  /\ \ \___  ___| |_ __ _   /   \/___\/___\/__\ 
 /  \/ / _ \/ __| __/ _` | / /\ //  ///  // \// 
/ /\  /  __/ (__| || (_| |/ /_// \_// \_// _  \ 
\_\ \/ \___|\___|\__\__,_/___,'\___/\___/\/ \_/ 
 _.-=:Oct 2022:=-._  DW  _.-=:INSTALLATION:=-._



 ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
: Created in part by DW of Dark Systems BBS - October 2022 :
 ``````````````````````````````````````````````````````````


 _____ _                        _ 
/  __ \ |                      | |
| /  \/ |__   ___  ___ _ __ ___| |
| |   | '_ \ / _ \/ _ \ '__/ __| |
| \__/\ | | |  __/  __/ |  \__ \_|
 \____/_| |_|\___|\___|_|  |___(_)

Thank-you for downloading and checking out NectaDoor for RemoteAccess!
Your friendly BBS link to the Demoscene's most excellent Internet radio station!

Created out of a love for Nectarine, Demoscene culture, nostalgia and the desire to make early
90s BBS software do things it was never intended to do. :)

NectaDOOR could easily be altered to cURL almost any information from any website and
JREPL could extract the sections desired.  Feel free to alter the GO.BAT file for any
purpose you desire, but respect the licences of JREPL & cURL.





                   ***************** IMPORTANT *****************

Just a heads up, NectaDOOR uses the RemoteAccess feature of embedding a text file
inside an ANSI file.  This feature is ONLY available with a registered copy of RemoteAccess.

If you are using the unregistered shareware version of RA, please register it for this
to work as described.

As an alternative to registering, instead of generating a separate text file to embed, GO.BAT could
be configured to generate your ENTIRE ANSI menu file every time it runs, including the song & artist names,
so no need to embed.

That would allow you to use the unregistered shareware version of RA.

                   ***************** IMPORTANT *****************


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 _____              _ _ _    _    _ _                    ______            
/  __ \            | (_) |  | |  | | |                   |  _  \           
| /  \/_ __ ___  __| |_| |_ | |  | | |__   ___ _ __ ___  | | | |_   _  ___ 
| |   | '__/ _ \/ _` | | __|| |/\| | '_ \ / _ \ '__/ _ \ | | | | | | |/ _ \
| \__/\ | |  __/ (_| | | |_ \  /\  / | | |  __/ | |  __/_| |/ /| |_| |  __/
 \____/_|  \___|\__,_|_|\__(_)/  \/|_| |_|\___|_|  \___(_)___/  \__,_|\___|
                                                                           
                                                                           

        JREPL.BAT ..... Dave Benham ..... www.dostips.com/forum/viewtopic.php?t=6044
             cURL ..... Multiple    ..... curl.se
Nectarine Web API ..... Starchaser  ..... www.scenestream.net/forum/thread/13
        NectaDOOR ..... DW (me!) :) ..... www.dsbbs.ca or telnet: bbs.dsbbs.ca:23
All the awesome tunas . Demoscene!  ..... www.scenestream.net

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 _   _             _____ _   _    _            _        
| | | |           |_   _| | | |  | |          | |       
| |_| | _____      _| | | |_| |  | | ___  _ __| | _____ 
|  _  |/ _ \ \ /\ / / | | __| |/\| |/ _ \| '__| |/ / __|
| | | | (_) \ V  V /| |_| |_\  /\  / (_) | |  |   <\__ \
\_| |_/\___/ \_/\_/\___/ \__|\/  \/ \___/|_|  |_|\_\___/
                           

Short explanation
~~~~~~~~~~~~~~~~~
 ```````````````
A user logs in.

Your RA Menu calls the external program \NECTADOR\GO.BAT which uses cURL to grab status data from Nectarine's web API.

JREPL extracts the currently playing song & artist, placing those variables into two text files, respectively.

Those two text files are then combined into a single text file that includes pretty ANSI colour codes.

This final text file (SONG.ASC) is placed into the C:\RA\TXTFILES\ directory, where your actual menu's ANSI file is also located (DEMO.ANS).

This 'DEMO.ANS' menu ANSI file contains a RemoteAccess control code referencing the file name created by GO.BAT and embeds the contents of the newly generated file into the menu ANSI.

Easy peasie. :)

***
PNG files EXAMPLE1 and EXAMPLE2 along with the sample DEMO.ANS file show how the control code looks, 
is positioned and works.

Just a FYI, the control code seems to like to place the embedded content one line below where the code is located.
***


The Looooooooooong explanation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ````````````````````````````

Here's a rough example of how this works on Dark Systems BBS...

A user logs into the BBS.

From the MAINMENU, they hit 'D' to visit the Demoscene menu (DEMO).

When menu 'DEMO' loads, the first line in its RA MENU config is to auto-execute an
external program (See CONFIG1.png).

This external program is GO.BAT in the \NECTADOR\ directory.

GO.BAT uses cURL to query the Nectarine Radio web API and saves the server's reply into
a file called SONG.TXT, located in the \NECTADOR\ directory.

Since this is a large text dump of all Nectarine's status data (currently playing, upcoming,
previously played, song lengths, etc.. etc...) we want to find and extract just the two
variables that will tell us the name of the song playing, and the artist.

GO.BAT looks at line 7 and line 6 of the text file, and extracts just those lines to two
files named LINE6.TXT and LINE7.TXT respectively.

These two files contain the song name (LINE7) and artist (LINE6).

GO.BAT then calls JREPL.BAT, which searches LINE7.TXT and extracts just the song name from
the complete API extraction.

GO.BAT then calls JREPL.BAT again, which searches LINE6.TXT and extracts just the artist name
from the previously extracted complete API extraction.

JREPL.BAT writes two files, SONG.ASC and ARTIST.ASC containing just the respective song and artist.

GO.BAT then sets the newly created SONG.ASC and ARTIST.ASC as variables, then simply echo's
these variables into a final file called SONG.ASC (overwriting the previous song.asc file no longer
needed).

It's at this last point where ANSI colour codes are added (in this case, blue song & artist text
with a white 'by' in between)

The final SONG.ASC file is then copies into the \RA\TXTFILES\ directory.

This is the end of the external program GO.BAT

The RA Menu 'DEMO' then continues onto the remaining entries and, along with the standard menu
choices, displays an ANSI file called 'demo.ans' as the menu's screen.

Within this ANSI file (DEMO.ANS) there is a RemoteAccess control code that will inject another
ANSI file into the currently displayed file.

I've included a copy of my working Demo Menu ANSI, so check it out to see where/how the control code works.
I really like the excellent Moebius ANSI editor. https://blocktronics.github.io/moebius

This is how we get the SONG.ANS file to appear in the DEMO.ANS menu display.
See the examples 'EXAMPLE1.PNG' and 'EXAMPLE2.PNG'.

The code looks something like this: ?!SONG|

Place that control code wherever you want the contents of SONG.ANS to appear.  It will take a little trial
& error to get it positioned perfectly, but it works! :)

Reloading the 'DEMO' menu will cause GO.BAT to be called again and a fresh API extraction
from Nectarine takes place.
 

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

      _   _______ _     
     | | | | ___ \ |    
  ___| | | | |_/ / |    
 / __| | | |    /| |    
| (__| |_| | |\ \| |____
 \___|\___/\_| \_\_____/
                       

cURL is a command line utility for transferring data.
It's included with mosT (all?) modern operating systems.  However, if you're using an older OS, like
Windows XP, cURL will be missing.

No worries!

You can FREELY download cURL from https://curl.se for pretty much any OS you could be using, even Amiga OS and
DOS have active versions!

NECTA-DOOR uses cURL to fetch the currently playing song/artist/etc... information from the Nectarine API.

What's that website again?
https://curl.se

Download, install and make sure cURL is working before proceeding with setting up NECTA-DOOR.
                         
                         
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

______     _   _         
| ___ \   | | | |        
| |_/ /_ _| |_| |__  ___ 
|  __/ _` | __| '_ \/ __|
| | | (_| | |_| | | \__ \
\_|  \__,_|\__|_| |_|___/
                                                        
The paths used in the GO.BAT file are setup for my BBS.

Here's my directory structure:

RemoteAccess: C:\RA\
RA TextFiles: C:\RA\TXTFILES\
NectaDoor: C:\RA\DOORS\NECTADOR\
cURL: C:\CURL\

If your RemoteAccess BBS uses a different directory structure, you will need to adjust the paths
accordingly to match your setup.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

______  ___    _____              __ _             __ ___  ___                     
| ___ \/ _ \  /  __ \            / _(_)           / / |  \/  |                     
| |_/ / /_\ \ | /  \/ ___  _ __ | |_ _  __ _     / /  | .  . | ___ _ __  _   _ ___ 
|    /|  _  | | |    / _ \| '_ \|  _| |/ _` |   / /   | |\/| |/ _ \ '_ \| | | / __|
| |\ \| | | | | \__/\ (_) | | | | | | | (_| |  / /    | |  | |  __/ | | | |_| \__ \
\_| \_\_| |_/  \____/\___/|_| |_|_| |_|\__, | /_/     \_|  |_/\___|_| |_|\__,_|___/
                                        __/ |                                      
                                       |___/                                       

Once you have edited GO.BAT and changed all the paths to reflect your own installation, it's time
to setup your menu.
I'm not going to go over how to create menus and Type 4 links to submenus.  Just the part that's
relevant to getting NectaDOOR up and running.

Go into RACONFIG and create a new MENU (INSERT), we'll call it 'DEMO' (you call it whatever you want).
Press ENTER on the first blank line of the new (currently empty) menu commands list.

This first line is where we want NectaDOOR's GO.BAT file to be automatically run, every time this menu
is loaded.

Going down the options... (See CONFIG1.PNG)


ACTION: Execute sub-program (TYPE 7)
DISPLAY: leave this blank
OPTDATA: *C /C cmd.exe /c c:\ra\doors\necta\go.bat

***
Replace the path in the OPTDATA line with your own path.
***

HOTKEY: leave this blank
AUTOEXEC: YES <---------- ***IMPORTANT***

Everything else you can leave at default, unless you want to change security levels or define what node(s)
run NectaDOOR.

Press ESC once to back out to the menu command list.

Now, under the 'Execute' line we just created, enter in all your menu options (return to mainmenu, page sysop, etc...) See CONFIG2.PNG

At the bottom, create an entry to display your menu ANSI file.

ACTION: Display ANS/ASC (Type 40)
OPTDATA: demo <-------------------- ***My final ANS file/name that GO.BAT created then placed in C:\RA\TXTFILES\***
AUTOEXEC: YES


Save this menu as 'DEMO' (or whatever you want) and create a link to this menu from whatever menu you want users to be able
to get to it from (MAINMENU?).

That's it!
Log into your BBS and try loading the new menu.  On the RA server you should see GO.BAT running through it's various
commands.  cURL being called, pulling the data from the Nectarine web API and dumping it into a file, then JREPL
extracting and refining the song name and artist info, finally creating and copying SONG.ANS into your \TXTFILES\ directory.

After a couple of seconds, your menu should display and include the song & artist in the location you placed the RA/ANSI
control code!

If not, go to the start of this info file and try again. :)

Is your version of RemoteAccess registered?
No?
See the CHEERS section at the top...





Final note...

You may want to customize your language file to change the standard loading door display text to something more funky.
Eg, to keep with a Demoscene theme, I changed mine to 'Loading & Decrunching... one second...'


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 _____               _   ______      _   _ _     _____ _          __  __ 
|  __ \             | | |___  /     | \ | ( )   /  ___| |        / _|/ _|
| |  \/_ __ ___  ___| |_   / /      |  \| |/    \ `--.| |_ _   _| |_| |_ 
| | __| '__/ _ \/ _ \ __| / /       | . ` |      `--. \ __| | | |  _|  _|
| |_\ \ | |  __/  __/ |_./ /___  _  | |\  |  _  /\__/ / |_| |_| | | | |  
 \____/_|  \___|\___|\__\_____/ (_) \_| \_/ (_) \____/ \__|\__,_|_| |_|  
 

Greetz to the old school BBSers, here's to you mates!
Wags, DarkMaster, Narcessa, Kir, LNA

Paulie420 of 2o fOr beeRS BBS -:- 20forbeers.com:1337
Anna of Imzadi BBS -:- box.imzadi.de:23

The awesome community of Necarine, keep it realtime! :)


                     ______           _
                     |  _  \         | |
                     | | | |__ _ _ __| | __
                     | | | / _` | '__| |/ /
   _____           _ | |/ / (_| | |  |   <
  /  ___|         | ||___/ \__,_|_|  |_|\_\
  \ `--. _   _ ___| |_ ___ _ __ ___  ___
   `--. \ | | / __| __/ _ \ '_ ` _ \/ __|
  /\__/ / |_| \__ \ ||  __/ | | | | \__ \
  \____/ \__, |___/\__\___|_| |_| |_|___/
          __/ |  ___ ___ ___
         |___/  | _ ) _ ) __|
                | _ \ _ \__ \
                |___/___/___/
          est. 1992 - reborn 2020

          Telnet: BBS.DSBBS.CA:23
             wWw: www.dsbbs.ca

        an original, early 90s style
                RemoteAccess
                    BBS

                   _____                  
            ___ ___ ___           
         ___  ___        
       __  __      
      _  _     
             
     _ __ _    
    __  __   
  _    _ 
   
   _  ___ ____               _ _ _ _  
  ______                 ______ 
 __ _______       _______ __
      _       _     
                        
                          
                        
   ___             ___  
    _           _   
    _         _   
   __       __  
       _     _      
                      
            _       _           

           old school is the way