Skip to content

Instantly share code, notes, and snippets.

@JamieMagee
Created January 11, 2018 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieMagee/c4fd24790538714c1afdd7fcc161b2d0 to your computer and use it in GitHub Desktop.
Save JamieMagee/c4fd24790538714c1afdd7fcc161b2d0 to your computer and use it in GitHub Desktop.
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