TwitterVapor

1.1.0

Easy Tweeting from a Vapor
handya/TwitterVapor

What's New

2020-08-05T03:53:00Z

TwitterVapor

Swift Tests SwiftLint

Use TwitterVapor to easily send tweets from your vapor server. This is a work in progress and currently only supports sending tweets to one account.

Setup:

    let consumerCredentials = TwitterVaporCredential(key: Environment.get("CONSUMER_KEY")!, secret: Environment.get("CONSUMER_SECRET")!)
    let userCredentials = TwitterVaporCredential(key: Environment.get("USER_KEY")!, secret: Environment.get("USER_SECRET")!)
    app.twitter.credentials = TwitterVaporCredentials(consumer: consumerCredentials, user: userCredentials)

Usage:

    func postTweet(_ req: Request) throws -> EventLoopFuture<HTTPStatus> {
        guard let tweet = req.query[String.self, at: "tweet"] else {
            throw Abort(.badRequest)
        }
        return req.twitter.post(tweet).transform(to: .ok)
    }

Dependencies:

Currently used for @RivrForiOS

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

Last updated: Tue Sep 20 2022 00:59:14 GMT-0500 (GMT-05:00)