Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import httpclient
- import strutils
- import json
- var http = newHttpClient()
- proc getJson(url: string): JsonNode =
- var content = http.getContent(url)
- echo content
- return parseJson(content)
- proc getAPI(url: string): JSonNode =
- var resp = getJson(url)["response"]
- for k, v in resp.pairs():
- echo $k
- echo $v
- return resp
- proc getFirstAPI(url: string): JSonNode =
- return getAPI(url)[0]
- echo getFirstAPI("https://api.vk.com/method/users.get?user_id=170831732&v=5.52")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement