Skip to content

Instantly share code, notes, and snippets.

@eliocapelati
Created September 17, 2014 16:12
Show Gist options
  • Save eliocapelati/6ba2dfcb9a2a4c7bf62b to your computer and use it in GitHub Desktop.
Save eliocapelati/6ba2dfcb9a2a4c7bf62b to your computer and use it in GitHub Desktop.
Title and url encode to add to Flipboard
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