Get OAuth Request token from Flickr using Dispatch?

211 views Asked by At

How could I get request token from Flickr using Dispatch Scala library? Is it possible using Dispatch to get base string? and sign requests?

1

There are 1 answers

0
smashedtoatoms On

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.