Read the statement by Michael Teeuw here.
3rd Party Modules with APIs not loading.
-
Going out for a smoke. I’ll be back in 10.
-
That URL worked great on the browser.
I really appreciate the help troubleshooting.
-
No problem. Ok, so you can get data. Now let’s see what the module tells us about getting the data. Can you go in the MMM-Launch.js file and uncomment line 124. Save. Run MM again using
npm start dev
and see if it reports receiving the data from the api. It should look something like this>Array (60)
-
No errors a few minutes in.
-
@bflbarlow said in 3rd Party Modules with APIs not loading.:
No errors a few minutes in.
Sucks! You should see it right away. I’m stumped. I can’t reproduce this behavior with my module. You CAN get data, based on the url test. But, for you, the module is not getting the data. Thus, it’s not loading.
I don’t think this is a module issue. I’ll ask my friend on the forum to look into this for you. He is amazing at troubleshooting MM and modules. I’m sure he will take a look at this. I’m sorry I couldn’t figure this out for you.
-
Sounds good and no worries.
Thanks for giving it a shot!
-
You’re welcome. I’m sure it will get worked out when the right people take a look at it.
Peace.
-
I’ve sent you a private message
-
edit the ~/MagicMirror/modules/MMM-MyStandings/node_helper.js
replace the getData function with this
getData: function (notification, url) { var self = this; console.log('requesting:' + url); request({ url: url, method: 'GET' }, function (error, response, body) { if (!error && response.statusCode == 200) { var result = JSON.parse(body); console.log("have data from api size="+body.length); self.sendSocketNotification(notification, result); } else { console.log("MMM-MyStandings : Could not load data."+" error="+error+" status="+response.statusCode); } }); },
open a terminal window
stop mirror , pm2 stop 0then start manually
npm start devyou should see
... MMM-MyStandings helper started ... Sockets connected & modules started ... Launching application. Create new calendar fetcher for url: http://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics - Interval: 300000 [14416:1017/204410.405574:ERROR:CONSOLE(2564)] "The given range isn't in document.", source: chrome-devtools://devtools/bundled/shell.js (2564) Create new news fetcher for url: http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml - Interval: 300000 requesting:http://site.web.api.espn.com/apis/v2/sports/basketball/nba/standings?level=3&sort=gamesbehind:asc,winpercent:desc have data from api size=126499
or something
please advise
-
@bflbarlow did u see my message above?