Sign in to follow this  
Followers 0
rootx

[SOLVED] Right way to download and read Jsons?

3 posts in this topic

#1 ·  Posted (edited)

I need to download and read last version of this program from github

https://api.github.com/repos/rg3/youtube-dl/releases/latest

I would extract from jsons

"tag_name": "2017.03.10",

#include <Array.au3>
#include <Inet.au3>

Example()

Func Example()

    Local $dData = _INetGetSource('https://api.github.com/repos/rg3/youtube-dl/releases/latest')

    FileWriteLine(@ScriptDir&"\latest.json",$dData)

EndFunc   ;==>Example

 

 

Edited by rootx

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try this:

#include-once
#include <Inet.au3>

#include <JSMN.au3> ; https://github.com/chechelaky/AutoIt/blob/master/JSMN.au3
#include <object_dump.au3> ; https://github.com/chechelaky/AutoIt/blob/master/object_dump.au3

Global $url = "https://api.github.com/repos/rg3/youtube-dl/releases/latest"

Global $json = Jsmn_decode(  _INetGetSource($url) )

If Not @error And $json.Exists("tag_name") Then
    MsgBox(0, "json", "tag_name = " & $json.Item("tag_name"))
    dump( $json )
EndIf

 

Edited by Luigi
1 person likes this

m(o.O)m

Share this post


Link to post
Share on other sites

#3 ·  Posted

Great job, Thx 4share it. :drool:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0