Skip to content

Latest commit

 

History

History
79 lines (55 loc) · 1.87 KB

README.md

File metadata and controls

79 lines (55 loc) · 1.87 KB

Examples

This folder contains example scripts that can be used to make calls to the Wistia API.

To start out with, you'll need to create an access token as mentioned in the Getting Started guide.

After that, you will need to ensure that the WISTIA_API_TOKEN env variable is properly set.

On Mac/Linux, this would be like:

❯❯ export WISTIA_API_TOKEN='MY-TOKEN'

On Windows, that would instead take the following form:

❯❯ $env:WISTIA_API_TOKEN = 'MY-TOKEN'

Once that is done, you should be able to use any of the examples to make sample calls to the Wistia API.

Quickstart

Install my crate cargo-rx, which abstracts away cargo run --example. This provides a single rx command.

❯❯ cargo install cargo-rx

Now start out by cloning the GitHub project:

❯❯ git clone https://github.com/rnag/rust-wistia.git

Then, simply cd into the project folder:

❯❯ cd rust-wistia

From here, you can use rx to build and run any of the examples individually.

In particular, here's a simple example of uploading a sample file to a default project on Wistia:

❯❯ rx upload_file

If you run the command without any arguments, you can select from the list of available examples:

❯❯ rx

To pass arguments to a script, you can include them after the --.

For example, here's an example of passing arguments to the upload_url script, which uploads a media file using a publicly-accessible URL link:

❯❯ rx upload_url -- \
     -n "My Video Name" \
     -d "Test <i>description</i>"