riquezjp / kitchenTV

Kitchen TV; weather, clock, live news feeds & video for Raspberry pi using PHP/javascript
GNU General Public License v3.0
26 stars 12 forks source link

RSS News Feed not functioning #13

Open werdnllac opened 6 years ago

werdnllac commented 6 years ago

Thanks for the great contribution. I love this project.

However, I had no issue customizing most of the Video, interface and everything else except the Newsfeed. There is none of the newsfeed working properly.

In addition, I have suggestion on top of this post which I will suggest in a new post.

Appreciate if anyone can assist how to resolve the Newsfeed. Thank you.

werdnllac commented 6 years ago

capture

werdnllac commented 6 years ago

The screenshot is taken via Snipping Tool (On Windows 10) and it is from VNC viewer

riquezjp commented 6 years ago

Hi there, Glad you got it working (mostly) & nice background! Can you try the BBC newsfeed example in the config file? - that is what I use & is working. The other examples should also work, but I havent tested them for a while. What news feed are you using? - it will only work for rss feeds with an xml doc in the required format. So not every website rss feed will work right away without modification.

werdnllac commented 6 years ago

Yes, I tried BBC Feed using the code in config.php

It doesn't work. :p

riquezjp commented 6 years ago

Can you view source on the page after you see the "" appear. at the top you should see somehting like this

// bbc headlines
 var headlines =['<a href="http://www.bbc.co.uk/news/world-e....

what does yours show?

werdnllac commented 6 years ago

The following is the script in config.php:

// ##### News Feed #####
// url of RSS news feed
// this works off <title> <description> & <link> so those elements must be present in the XML doc

$news_url="http://feeds.bbci.co.uk/news/rss.xml?edition=uk";
//$news_url="http://feeds.bbci.co.uk/news/rss.xml?edition=uk";
//$news_url="http://www.channelnewsasia.com/rssfeeds/8395986";
//$news_url="http://feeds.bbci.co.uk/news/world/us_and_canada/rss.xml";
//$news_url="https://news.google.com/news?cf=all&hl=en&pz=1&ned=us&output=rss";
//$news_url="http://www.aljazeera.com/xml/rss/all.xml";
//$news_url="http://www.techradar.com/rss";
werdnllac commented 6 years ago

Which file did you refer to the script

// bbc headlines
 var headlines =['<a href="http://www.bbc.co.uk/news/world-e....
riquezjp commented 6 years ago

Load the kitchenTV in your browser. The newsfeed is missing & just shows "". Please right-click & "show source" or use your browsers menu to view the HTML source of the page. Towards the top of the source you will find the //bbc headlines part.

werdnllac commented 6 years ago

I can only see // ///// but when I click, the Youtube video changes its source and nothing happend.

I don't see the "var headlines...." script

riquezjp commented 6 years ago

I think you might not be looking at the right thing. Sorry if i didnt explain it well. Instead of right-clicking perhaps you can use the browser menu. You should see something like this ... screen shot 2018-03-27 at 7 36 19 pm

riquezjp commented 6 years ago

If you use chrome its in the Browser menu VIEW > Developer > View source Other browsers have similar options but slightly different menus

If you right-click view source then you should right-click on a blank area of the page, such as the empty space next to the temperature. Dont right-click on text or video or it will give a different menu.

werdnllac commented 6 years ago

Ok I got it.

No, in the source the script enclosed, does not show the url

// bbc headlines 
        var headlines =['<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>','<a href="">""</a><br><span>""</span>',];
riquezjp commented 6 years ago

ok, thanks. Thats it.

It seems that the PHP function: file_get_contents() is not working on your side. There are a few reasons why this could be: a) your PHP installation doesnt have it enabled. https://www.experts-exchange.com/questions/27250421/how-do-i-enable-file-get-contents-file-put-contents.html b) Your firewall, router or ISP is blocking this feature.

Check the first one, hopefully that will be an easy fix, the person on that page has 2 easy solutions.

werdnllac commented 6 years ago

As I loaded the entire package into my server of a hosting service provider, I don'y have access to change it.

Any alternative?

werdnllac commented 6 years ago

@riquezjp Had managed to get the NewsFeed working.

Like to share my final completed screenshot here.

capture

riquezjp commented 6 years ago

Great. What was the problem in the end? Good to know for future reference.

werdnllac commented 6 years ago

It is due to Unix/Linux Hosting Plan PHP.ini(). I login into the cpanel and check go into the PHPMyAdmin and could see the "file_get_contents()" is turned OFF.

By turning it ON and the Newsfeed function orderly.

The guide is show as per https://www.experts-exchange.com/questions/27250421/how-do-i-enable-file-get-contents-file-put-contents.html