Skip to content

Commit

Permalink
remove git.io
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Apr 27, 2022
1 parent 0fe5244 commit ec3706c
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions ci/upload.sc
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
#!/usr/bin/env amm
import ammonite.ops._

@main
def shorten(longUrl: String) = {
println("shorten longUrl " + longUrl)
val shortUrl = requests.post(
"https://git.io",
data = Seq("url" -> longUrl),
).headers("location").head

println("shorten shortUrl " + shortUrl)
shortUrl
}
@main
def apply(uploadedFile: Path,
tagName: String,
Expand Down Expand Up @@ -47,10 +36,5 @@ def apply(uploadedFile: Path,
println(res.text)
val longUrl = ujson.read(res.text)("browser_download_url").str.toString

println("Long Url " + longUrl)

val shortUrl = shorten(longUrl)

println("Short Url " + shortUrl)
shortUrl
longUrl
}

0 comments on commit ec3706c

Please sign in to comment.