Created
January 11, 2018 14:02
-
-
Save JamieMagee/c4fd24790538714c1afdd7fcc161b2d0 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
val doc = Jsoup.connect("https://twitter.com").get() | |
val initData = doc.select("#init-data").attr("value") | |
val json = Parser().parse(StringReader(initData)) as JsonObject | |
val hashFlagsJson = json { | |
obj( | |
"hashflagBaseUrl" to json.string("hashflagBaseUrl"), | |
"activeHashflags" to json["activeHashflags"] as JsonObject | |
) | |
} | |
return hashFlagsJson |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment