Navigation

    MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    MMM-Random Fact

    Education
    12
    59
    9587
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • lavolp3
      lavolp3 Module Developer last edited by

      @cowboysdude Dude you’re ignoring all the debugging!
      (After including debug logs) I got the response code 503 from the API

      [2020-04-23 10:35:54.046] [LOG]    10:35:54 <log> Wrong response code: 503 (/home/pi/MagicMirror/modules/MMM-rfacts/node_helper.js:47 Request._callback)
      [2020-04-23 10:35:54.054] [LOG]    10:35:54 <log> {"statusCode":503,"body":"<!DOCTYPE html>\n<html>\n<head>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta charset=\"utf-8\">\n<title>Application Error</title>\n<script src=\"/cdn-cgi/apps/head/mRZC9wXQsm0r4xm9M3hblvWOKNw.js\"></script><style media=\"screen\">\n\t\t  html,body,iframe {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t  }\n\t\t  html,body {\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t  }\n\t\t  iframe {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tborder: 0;\n\t\t  }\n\t\t</style>\n</head>\n<body>\n<iframe src=\"//www.herokucdn.com/error-pages/application-error.html\"></iframe>\n</body>\n</html>","headers":{"date":"Thu, 23 Apr 2020 08:35:53 GMT","content-type":"text/html; charset=utf-8","transfer-encoding":"chunked","connection":"close","set-cookie":["__cfduid=dba2fb4d60e085d460cd31721c37883191587630953; expires=Sat, 23-May-20 08:35:53 GMT; path=/; domain=.sameerkumar.website; HttpOnly; SameSite=Lax; Secure"],"cache-control":"no-cache, no-store","cf-cache-status":"DYNAMIC","expect-ct":"max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"","server":"cloudflare","cf-ray":"588640f1695a0026-LHR","cf-request-id":"0247c6eadf000000267690a200000001"},"request":{"uri":{"protocol":"https:","slashes":true,"auth":null,"host":"useless-facts.sameerkumar.website","port":443,"hostname":"useless-facts.sameerkumar.website","hash":null,"search":null,"query":null,"pathname":"/api","path":"/api","href":"https://useless-facts.sameerkumar.website/api"},"method":"GET","headers":{}}} (/home/pi/MagicMirror/modules/MMM-rfacts/node_helper.js:48 Request._callback)
      [2020-04-23 10:35:54.064] [LOG]    10:35:54 <log> null (/home/pi/MagicMirror/modules/MMM-rfacts/node_helper.js:49 Request._callback)
      

      I guess my pre-posters have a similar experience.

      lavolp3 1 Reply Last reply Reply Quote 0
      • lavolp3
        lavolp3 Module Developer @lavolp3 last edited by lavolp3

        @cowboysdude @chassain-0 @Stoffbeuteluwe
        Its obviously an API problem. The API page returns an Application Error.
        I guess we need another API.

        How about this one?
        https://uselessfacts.jsph.pl/random.json
        It seems to use (at least) the german source “neon”.
        I was actually looking for that for some time because neon has published a range of books called “useless facts”. FOund it accidentally just now.

        It could be implemented and then translated from the source language to the user language.
        If it uses all of neon’s facts there quite a lot.

        If you don’t want to use this source, no problem, then I’d build an own module.

        C 1 Reply Last reply Reply Quote 0
        • C
          chassain 0 @lavolp3 last edited by

          @lavolp3 we can use this for the moment…and see after…the modul is so fine that i can 't work without :)//how integrate this new api ?

          lavolp3 1 Reply Last reply Reply Quote 0
          • lavolp3
            lavolp3 Module Developer @chassain 0 last edited by

            @chassain-0 I have it working but changed lots of things on the frontend and in node_helper.js. So need to check the changes again.

            lavolp3 1 Reply Last reply Reply Quote 1
            • lavolp3
              lavolp3 Module Developer @lavolp3 last edited by

              @lavolp3
              PR sent
              https://github.com/cowboysdude/MMM-rfacts/pull/12

              It seems I have done a bit too much JS programming in recent months… Lol.

              @cowboysdude have a look at it and let me know what you think.

              C 1 Reply Last reply Reply Quote 3
              • C
                chassain 0 @lavolp3 last edited by

                @lavolp3 It works fine for me (in french) with the changes manualy

                1 Reply Last reply Reply Quote 1
                • cowboysdude
                  cowboysdude Project Sponsor Module Developer last edited by cowboysdude

                  Thanks Guys…even with the world in chaos I am busy…VERY.

                  Thank you @lavolp3 working perfectly 😉

                  The new api I had gotten apparently ONLY works in the US for some reason…

                  1 Reply Last reply Reply Quote 0
                  • Stoffbeuteluwe
                    Stoffbeuteluwe Project Sponsor last edited by

                    Hi to all …thanks for your work, everything works nice

                    1 Reply Last reply Reply Quote 0
                    • K
                      kisagluk last edited by

                      Hey, first of all, awesome module and I really like it!
                      Thank you 🙂

                      One thing I see is that on my English system, from time to time I get facts in German.
                      For example in one run, I get 3 in English, number 4 is in German and then English again.
                      The behaviour is quite random, sometimes it’s a first one etc.
                      Any idea why this happens?

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 6 / 6
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy