3. Tutorial

3.1. Up’N Running

These steps explain how to start UXTR.

3.1.1. Windows

c:\> cd c:\uxtr-1.0

REM development mode
c:\uxtr-1.0> bin\uxtr.cmd console

REM production mode
c:\uxtr-1.0> bin\uxtr.cmd start

Or by using the UXTR’s Quick Start menu:

Windows - UXTR Quick Start/Stop

3.1.2. Mac OSX

From command line:
$ cd /Applications/uxtr
$ ./bin/uxtr console                 # development mode

$ ./bin/uxtr start                   # production  mode, or:
$ ./Start

Or by using the Quick Launchers:

OSX - UXTR Quick Start/Stop

3.1.3. Linux

From command line:
$ cd $HOME/.uxtr
$ ./bin/uxtr console                 # development mode

$ ./bin/uxtr start                   # production  mode, or:
$ ./Start

3.2. Shutting Down

These steps explain how to stop UXTR.

3.2.1. Windows

REM development mode
REM from the Erlang shell, type:
(uxtr@aleph)1> init:stop().

REM production mode
c:\> cd c:\uxtr-1.0
c:\uxtr-1.0> bin\uxtr.cmd stop

Or by using the UXTR’s Quick Stop menu:

Windows - UXTR Quick Start/Stop

3.2.2. Mac OSX

From command line:
# development mode
# from the Erlang shell, type:
(uxtr@aleph)1> init:stop().

# production mode
$ cd /Applications/uxtr
$ ./bin/uxtr stop
# or:
$ ./Stop

Or by using the Quick Launchers:

OSX - UXTR Quick Start/Stop

3.2.3. Linux

From command line:
# development mode
# from the Erlang shell, type:
(uxtr@aleph)1> init:stop().

# production mode
$ cd $HOME/.uxtr
$ ./bin/uxtr stop
# or:
$ ./Stop

3.3. Testing the Web Service

Once the UXTR Web Service is running, you can start using it.

3.3.1. Command Line

cURL is a Unix operating system based tool to quickly test any RESTful web service functionality.
Here are some examples with UXTR:
# Perma.cc website: "plain" producer + "123456" identifier
$ curl 'http://127.0.0.1:6789/?o=plain&u=123456&t=http://perma.cc/'

# Nasa website: "raw" producer + "abc" identifier
$ curl 'http://127.0.0.1:6789/?o=raw&u=abc&t=http://www.nasa.gov/'

# NewYork Times website: "json" producer + "98zy" identifier
$ curl 'http://127.0.0.1:6789/?o=json&u=98zy&t=http://www.nytimes.com/'
or try httpie (https://github.com/jkbr/httpie) for colourful JSON output.
HTTPie with JSON producer

3.3.2. Browser

It’s also possible to run UXTR links extractor from within your favourite web browser (ex. Firefox, Chrome).
Browser with JSON producer