Created
September 17, 2014 16:12
-
-
Save eliocapelati/6ba2dfcb9a2a4c7bf62b to your computer and use it in GitHub Desktop.
Title and url encode to add to Flipboard
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
import java.net.URLEncoder.{encode => enc} | |
object Flipit extends App { | |
if (args.size >= 2){ | |
val flip = """https://share.flipboard.com/bookmarklet/popout?v=2&title=%s&url=%s""" | |
println(args(0)) | |
println(flip.format(e(args(0)), e(args(1)))) | |
def e(url :String) :String = { | |
enc(url, "UTF-8") | |
} | |
} else | |
println(""" ERRO >>>>>>>>>> Syntax: scala Flipit "Tilte" "http://www.example.com/" """) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment