Skip to content

Instantly share code, notes, and snippets.

@kdxu
Created March 30, 2015 07:43
Show Gist options
  • Save kdxu/cdaa2950a2fd54f946db to your computer and use it in GitHub Desktop.
Save kdxu/cdaa2950a2fd54f946db to your computer and use it in GitHub Desktop.
package models
import dispatch._, Defaults._
object YoClient{
val APIKey = "YOUR_YO_API_KEY"
private def makeRequest(endpoint: String, args: Traversable[(String,String)]): Future[String] =
Http(url(endpoint) << args OK as.String)
def yo(id:String) = {
val param = "username" -> id :: "api_token" -> APIKey :: "link" -> """http://www.xvideos.com""" :: "Content-Type" -> "application/x-www-form-urlencoded" :: Nil
makeRequest("http://api.justyo.co/yo/", param)
}
def yoAll = {
val param = "api_token" -> APIKey :: "Content-Type" -> "application/x-www-form-urlencoded" :: Nil
makeRequest("http://api.justyo.co/yoall/", param)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment