ChuckNorris (Pulling Data using HTTPRequests)

Christie Widget Designer Version 6 - Q&A

Moderator: Moderator Group

Forum rules
When asking make sure to include the operating system and the revision of Widget Designer you are using.

ChuckNorris (Pulling Data using HTTPRequests)

Postby Daniel Kaminski » Fri Dec 23, 2022 6:02 pm

tolly random and useless but fun

make a function that is called ChuckNorris

Code: Select all
var str = ""
var msg = "https://api.chucknorris.io/jokes/random"
HTTPRequestToVar(msg,"str","GET","application/json")
var response = str.ToJson

return response.Get("value").ToString


you can now always get a ChuckNorris Joke by assigning it.

label1.text = ChuckNorris
You do not have the required permissions to view the files attached to this post.
--
Daniel Kaminski
Pandoras Box Expert
User avatar
Daniel Kaminski
 
Posts: 1071
Joined: Tue Jul 22, 2008 10:55 am
Location: Herten, Germany

Re: ChuckNorris (Pulling Data using HTTPRequests)

Postby odcheban » Tue Jan 10, 2023 10:57 pm

Pretty simple example, thank you!
But why it doesn't work for me... help me please

screen: https://drive.google.com/file/d/10x6I45 ... sp=sharing

code:
Label1.Text = "get response..."
var str = ""
var msg = "https://api.chucknorris.io/jokes/random"
HTTPRequestToVar(msg,"str","GET","application/json")
var response = str.ToJson
var str2 = response.Get("value").ToString
Label1.Text = str2

version: Wd 6.1.3. (free)
os: windows 10
odcheban
 
Posts: 11
Joined: Wed Jan 26, 2022 2:51 pm

Re: ChuckNorris (Pulling Data using HTTPRequests)

Postby Daniel Kaminski » Wed Jan 11, 2023 12:49 pm

because your WD Version is to old.
Upgrade to the latest Version and it will work.
You need Version 6.5.6

If you open the DebugLogger Windows it will tell you where the scripting has problems.

https://christiepandorasbox.com/root/do ... enu_wd.htm

Daniel
--
Daniel Kaminski
Pandoras Box Expert
User avatar
Daniel Kaminski
 
Posts: 1071
Joined: Tue Jul 22, 2008 10:55 am
Location: Herten, Germany

Re: ChuckNorris (Pulling Data using HTTPRequests)

Postby odcheban » Wed Jan 11, 2023 11:27 pm

Changing the version does not solve the problem.
I have the free version now, the paid version will be on Friday - then I will understand why it does not work.
odcheban
 
Posts: 11
Joined: Wed Jan 26, 2022 2:51 pm

Re: ChuckNorris (Pulling Data using HTTPRequests)

Postby Daniel Kaminski » Fri Jan 13, 2023 4:00 am

Please try this

Code: Select all
Label1.Text = "get response..."
var str = ""
var msg = "https://api.chucknorris.io/jokes/random"
HTTPRequestToVar(msg,"str","GET","application/json")
DebugMessage(str)


Post picture of DebugMessage.
--
Daniel Kaminski
Pandoras Box Expert
User avatar
Daniel Kaminski
 
Posts: 1071
Joined: Tue Jul 22, 2008 10:55 am
Location: Herten, Germany

Re: ChuckNorris (Pulling Data using HTTPRequests)

Postby odcheban » Fri Jan 13, 2023 11:00 am

Problem solved. I hope I didn't get the wrong version. Sorry
odcheban
 
Posts: 11
Joined: Wed Jan 26, 2022 2:51 pm


Return to Widget Designer V6

Who is online

Users browsing this forum: No registered users and 64 guests