-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stuck in "Loading.." when opening rss feed #8
Comments
I'd really like to fix this, but it's not my code that's causing the problem. The app currently uses the rss2json api to retrieve data from a feed in a Javascript-friendly format. Go to rss2json.com, paste your feed into the big text box, and watch what happens. It's not good. The only way to resolve this is to stop using rss2json altogether and process the xml ourselves. Which is in fact something I would like to do (see #6), but my previous attempts have all hit a brick wall. If you feel so inclined, you could try using rss2json's contact link to let them know the feed doesn't work on their site (no need to mention my app), but since we're not paying customers I'm not sure they'll care. As an entirely unhelpful aside, my app has error handling, but for obvious reasons it can't do anything unless rss2json actually tells us there's an error. Why the heck is rss2json not returning http status 4xx like it's supposed to? |
Hang on a moment... when I go to that link in my browser I get a 404 error! 😄 Are you sure the url is right? |
Thank you for responding immediately :) sorry, I didn't check the rss url again in the browser, it was probably outdated due to the last hash part. I tried this url in rss2json.com and it converts to the correct json. If you paste the latter url in the browser you can download the application+xml file for the feed. Unfortunately the latter url still doesn`t work in the app. I will try to raise this issue with rss2json.com as you suggested. Otherwise I keep an eye on the open issue #6 that you're on. |
this is the json that rss2json produces for the feed; could it be that loading the feed takes minutes? i should maybe give it more time to load? thanks, |
Don’t bring it up with rss2json if it works on their end! Okay, this is good, it means I can fix it. I don’t know when I’ll next have a chance, but it’s on my list! It would help a great deal if there’s a stable url. |
Thank you for looking into it. The url should be stable (delivers an application+xml document for the current week's menu). |
Hi, I looked into your app.js and it seems that the feed.url is passed "as is" to api.rss2json.com, without html encoding. I re-tested the rss url directly in rss2json.com and there the feed url gets html-encoded and delivers correct json. This is the original rss feed for example: If I test this rss feed on the website rss2json.com the API call is displayed as: In the app.js the url seems to not get encoded (at least I don't see that it gets encoded). Could that be a reason that this rss feed shows no results on the Pebble? Thank you for looking into it. |
Thank you for the research. Yes, that sounds likely. I unfortunately still don't know when I'll next have a chance to look at this. :( It will happen eventually. If you wanted to submit a pull request, that would be great. You're probably on the right track, I don't think I'm doing any encoding/decoding, except for when I load the data from Settings. |
Thank you for your instant response and your confirmation that the missing url encoding might be the missing point here. As I can modify and replace the app.js in the pbw file as I learned some time ago, I can try to fix it myself and add the missing encoding and test it by sideloading the modified pbw to my pebble 2. If it works for me, I would like to make a small contribution and submit it as a pull request, |
You're very welcome, I'm sorry I haven't gotten around to fixing this myself after three months! Just a heads up, while you can absolutely edit the code that way, the copy of app.js in the compiled pbw has a lot of extra PebbleJS boilerplate that isn't present in the original source code. I do recommend trying to get the Pebble SDK set up if you can. Testing changes becomes much quicker that way, and you can log statements to the console, which for me was invaluable. Regardless, the function you want to look at is getArticles(feed). If you can't get it, I do intend to look at this at some point, but it could be in another six months. |
Unfortunately I haven't set up the Pebble SDK so far although I have been planning to do it and still am. Nevertheless I managed to fix it yesterday in the pbw downloaded from the rebble store with only a small modification in the pebble-app.js in line 93: jsonUrl = "https://api.rss2json.com/v1/api.json?rss_url=" + feed.url; I changed it to: jsonUrl = "https://api.rss2json.com/v1/api.json?rss_url=" + encodeURIComponent(feed.url); since encodeURIComponent( ) was used in other locations in that file, too, and it worked for my RSS feed which originally is (before encoding): If you find the time maybe you could add this encodeURIComponent( ) call on the master branch (if you agree that it's the correct fix for this issue), given that it is such a small modification? Would be great, thanks in advance! |
Hi,
congratulations to your app, it`s great, especially to read full texts which was not possible with other apps. I found an issue with one feed, the app remains in "Loading.." state for minutes (probably forever) when trying to open it. Could it be that the feed url breaks the parser due to the %5B and %5D chars ("[" and "]") in the url? Or could it be related to the response? the response is the menu plan of a college dining hall possibly containing umlauts like ä,ü,ö,ß.
https://www.akafoe.de/gastronomie/speiseplaene-der-mensen/bistro-der-ruhr-universitaet-bochum/?mid=37&tx_akafoespeiseplan_mensadetails%5Baction%5D=feed&tx_akafoespeiseplan_mensadetails%5Bcontroller%5D=RSSFeed&cHash=00668abfcb211d080183ffcf28623873
Thank you and best regards,
Stefan
The text was updated successfully, but these errors were encountered: