gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Yahoo and Raspberry Pi

Mon Aug 24, 2015 11:54 am

I have seen a video where the raspberry pi reads yahoo news, I know how the reading is working, buthow does it get the news?

BASICLLY, how does the raspberry pi get yahoo news

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 11:55 am

rss feeds ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 12:15 pm

yes but how do i do it?

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 12:28 pm

we without knowing the video I cannot even begin to comment on how... well I could but it would be all speculation

post some links

do google searches

help us help you
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 12:34 pm

gproduct wrote:I have seen a video where the raspberry pi reads yahoo news, I know how the reading is working, buthow does it get the news?

BASICLLY, how does the raspberry pi get yahoo news
http://www.paulstamatiou.com/how-to-get ... d-with-rss
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...


User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 1:15 pm

gproduct wrote:https://www.youtube.com/watch?v=-Or5jmBqsNE this is the link
Well here's the code, you can figure it out yourself:
https://github.com/skiwithpete/alarmpi/ ... et_news.py
There are 10 types of people: those who understand binary and those who don't.

gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 1:19 pm

Yea I saw the code part but I couldn't find that part
Thx man :D

gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Re: Yahoo and Raspberry Pi

Mon Aug 24, 2015 1:28 pm

The solution is 8-)
First we need to install feedparser
and then the code is

Code: Select all

#!/usr/bin/env python

import feedparser
import ConfigParser
Config=ConfigParser.ConfigParser()

try: 
    rss = feedparser.parse('http://feeds.bbci.co.uk/news/world/rss.xml')


#for entry in rss.entries[:4]:
#    print entry['title']
#    print entry['description']
#    
#print rss.entries[0]['title']
#print rss.entries[0]['description']
#print rss.entries[1]['title']
#print rss.entries[1]['description']
#print rss.entries[2]['title']
#print rss.entries[2]['description']
#print rss.entries[3]['title']
#print rss.entries[3]['description']

    newsfeed = rss.entries[0]['title'] + '.  ' + rss.entries[0]['description'] + '.  ' + rss.entries[1]['title'] + '.  ' + rss.entries[1]['description'] + '.  ' + rss.entries[2]['title'] + '.  ' + rss.entries[2]['description'] + '.  ' + rss.entries[3]['title'] + '.  ' + rss.entries[3]['description'] + '.  ' 

# print newsfeed
    newsfeed = newsfeed.encode('utf-8')

# Today's news from BBC
    news = 'And now, The latest stories from the World section of the BBC News.  ' + newsfeed
    

except rss.bozo:
    news = 'Failed to reach BBC News'

if True:
  print news

Return to “General discussion”