https://github.com/akiomik/dispatch-dropbox
A scala dispatch wrapper for Dropbox API.
https://github.com/akiomik/dispatch-dropbox
Last synced: 2 months ago
JSON representation
A scala dispatch wrapper for Dropbox API.
- Host: GitHub
- URL: https://github.com/akiomik/dispatch-dropbox
- Owner: akiomik
- License: mit
- Created: 2014-02-11T16:51:41.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-23T00:23:55.000Z (over 11 years ago)
- Last Synced: 2025-02-07T16:48:34.726Z (4 months ago)
- Language: Scala
- Homepage:
- Size: 160 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
dispatch-dropbox
================A dispatch wrapper for Dropbox API.
This library is inspired by [repatch-twitter](https://github.com/eed3si9n/repatch-twitter).
[](https://travis-ci.org/akiomik/dispatch-dropbox)
## Sample
```scala
import com.ning.http.client.oauth._
import dispatch._
import dispatch.Defaults._
import scala.concurrent._
import com.github.akiomik.dispatch.dropbox.core.clients._
import com.github.akiomik.dispatch.dropbox.core.requests._val consumer = new ConsumerKey("foo", "bar") // FIXME
val exchange = DropboxExchange(http, consumer, "")val res1 = exchange.fetchRequestToken
val requestToken = res1 map {
case Right(t) => t
case Left(m) => sys.error(m)
}val verifier = requestToken map { t =>
blocking {
val url = DropboxExchange.signedAuthorize(t)
println(url)
println("Please press enter after authorize.")
readLine()
}
}val res2 = requestToken flatMap { t =>
verifier flatMap { v =>
DropboxExchange.fetchAccessToken(t, v)
}
}val accessToken = res2 map {
case Right(token) => token
case Left(message) => sys.error(message)
}val client = Client(consumer, accessToken)
val info = Http(client(Account.info) OK as.String)
```## License
MIT License. See `License` file.