Chuck Norris Facts!
#1
Have you ever wished you had a desktop background that would tell you random Chuck Norris facts?  Haven't we all?

Well now your wish has become a reality:
Code: (Select All)
Dim img
img = _LoadImage("https://images01.military.com/sites/default/files/styles/full/public/2021-04/chucknorris.jpeg.jpg?itok=2b4A6n29")
_PutImage , img
_Fullscreen

Do
    _Delay 2

    Dim result As Object
    result = Fetch("https://api.chucknorris.io/jokes/random")

    If result.ok Then
        Dim obj As Object
        obj = JSON.parse(result.text)
        Say obj.value   
    End If
Loop


Sub Say (text As String)
    $If Javascript Then
        var synth = window.speechSynthesis;
        if (synth) {
            var utterance = new SpeechSynthesisUtterance(text);
            synth.speak(utterance);   
            while (synth.speaking) {
                await QB.sub__Delay(.5);
            }
            success = -1;
        }
    $End If
End Sub

View in QBJS
Reply


Messages In This Thread
Chuck Norris Facts! - by dbox - 04-21-2023, 08:11 PM
RE: Chuck Norris Facts! - by mnrvovrfc - 04-21-2023, 11:24 PM
RE: Chuck Norris Facts! - by SMcNeill - 04-22-2023, 10:55 AM
RE: Chuck Norris Facts! - by dbox - 04-22-2023, 11:04 AM
RE: Chuck Norris Facts! - by SMcNeill - 04-23-2023, 01:29 AM
RE: Chuck Norris Facts! - by CharlieJV - 04-23-2023, 05:59 PM
RE: Chuck Norris Facts! - by bplus - 04-22-2023, 12:41 PM
RE: Chuck Norris Facts! - by dbox - 04-22-2023, 01:04 PM
RE: Chuck Norris Facts! - by aurel - 04-23-2023, 10:34 AM
RE: Chuck Norris Facts! - by dbox - 04-23-2023, 11:25 PM
RE: Chuck Norris Facts! - by grymmjack - 04-27-2023, 03:13 AM
RE: Chuck Norris Facts! - by grymmjack - 04-27-2023, 03:17 AM
RE: Chuck Norris Facts! - by mnrvovrfc - 04-27-2023, 03:24 AM
RE: Chuck Norris Facts! - by dbox - 04-27-2023, 11:45 AM
RE: Chuck Norris Facts! - by grymmjack - 04-28-2023, 12:53 AM
RE: Chuck Norris Facts! - by mnrvovrfc - 04-27-2023, 04:35 PM



Users browsing this thread: 5 Guest(s)