Giter Site home page Giter Site logo

rust-wistia's Introduction

rust-wistia

github crates.io docs.rs build status

rust-wistia is a rust crate which provides an async wrapper API that lets you easily interact with the Wistia API.

This is inspired in part by wystia, a Python library I created for the Wistia API.


This crate works with Cargo with a Cargo.toml like:

[dependencies]
rust-wistia = "0.8"
tokio = { version = "1", features = ["full"] }

Table of Contents

Getting Started

Getting started with the rust-wistia library is easy:

  1. Set WISTIA_API_TOKEN in your environment; you can also use the from constructor to explicitly set the token value. Find out more about Authentication and Access Tokens in the Wistia API Documentation.

  2. Add some usage to your application.

    Here's an example of uploading a media, via a public URL link:

    use rust_wistia::UrlUploader;
    
    #[tokio::main]
    async fn main() -> std::result::Result<(), Box<dyn std::error::Error + Send + Sync>> {
        let res = UrlUploader::new("my-url-link")?
            .name("My Video Name")
            .send()
            .await?;
    
        println!("Response: {res:#?}");
    
        // Print out some useful attributes
        println!("Video ID: {}", res.hashed_id);
    
        Ok(())
    }

Examples

You can check out sample usage of API methods in the examples/ folder in the project repo on GitHub.

Dependencies and Features

This library uses only the minimum required dependencies, in order to keep the overall size small. This crate uses hyper and hyper-rustls internally, to make HTTPS requests to the Wistia API.

While hyper-rustls was chosen as the default TLS implementation because it works without issue when cross-compiling for the x86_64-unknown-linux-musl target as is common for AWS Lambda deployments, it is still possible to instead use the native hyper-tls implementation, which relies on OpenSSL.

To do this, disable the default "rust-tls" feature and enable the "native-tls" feature:

[dependencies]
rust-wistia = { version = "*", default-features = false, features = ["native-tls", "logging", "serde-std"] }

Contributing

Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.

Check out the Contributing section in the docs for more info.

License

This project is proudly licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).

rust-wistia can be distributed according to the MIT license. Contributions will be accepted under the same license.

Authors

rust-wistia's People

Contributors

cb-rnag avatar rnag avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rust-wistia's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.