I have written this little Python script to listen to the BBC RSS Top Stories feed on my Raspberry Pi
So first of all because I have problems with the 3.5 mm Jack (no sound), I went into
sudo raspi-config
then in Advanced Options > Audio I chose "Force 3.5 mm ('headphone') jack"
(This always works for me)
So the jack configuration out of the way, let's check out the script:
# morning.py
import feedparser # To scrape the BBC Feed
import talkey # The TTS service I'll be using
d = feedparser.parse("http://feeds.bbci.co.uk/news/rss.xml")
tts = talkey.Talkey(
engine_preference=['espeak'],
espeak={
'deafults': {
'words_per_minute': 100,
'variant': 'f4',
}
}
)
for entry in d.entries:
tts.say(entry.title + ":" + entry.summary)
I wanted the script to run at a specific time (morning) so I used Cron. This is what I typed in
crontab -e
0 8 * * * sudo python morning.py >/dev/null 2>&1 # inside crontab
(The morning.py script is located in the 'pi' directory.)
However the script will not run at the specified time for some reason.
(It runs perfectly without Cron though.)