How could I get request token from Flickr using Dispatch Scala library? Is it possible using Dispatch to get base string? and sign requests?
Asked
Active
Viewed 210 times
0
-
Uh, why not use a Oauth library for Scala? – Jesvin Jose Feb 04 '12 at 10:34
-
I can't find any library that supports maven. – Feras Odeh Feb 04 '12 at 11:04
1 Answers
0
You can do something like this with dispatch:
private def buildSearchReq(searchTerm: String, lat: Double, long: Double): Req = {
val consumer = new ConsumerKey(consumerKey, consumerSecret)
val requestToken = new RequestToken(token, tokenSecret)
val req = url(searchUrl)
.addQueryParameter("term", searchTerm)
.addQueryParameter("radius_filter", "40000")
.addQueryParameter("ll", s"$lat,$long")
new SigningVerbs(req).sign(consumer, requestToken)
}
There are more functional ways to put this together; however, this one doesn't look like a cat walked across your keyboard.

smashedtoatoms
- 1,648
- 14
- 19