Created
March 30, 2015 07:43
-
-
Save kdxu/cdaa2950a2fd54f946db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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