Permalink
Browse files

Attempt at modifying the news skill for my locale

As the title implies.
  • Loading branch information...
1 parent 266e342 commit 164c7207374131ece23a8ddf40c7a7981f3c7084 @marksev1 committed Sep 6, 2016
@@ -74,8 +74,8 @@ api_key = ""
api_key = ""
temperature = fahrenheit # Options are celsius and fahrenheit
-[NPRNewsSkill]
-url_rss = "http://www.npr.org/rss/podcast.php?id=500005"
+[SLONewsSkill]
+url_rss = "http://podcast.rtvslo.si/jutranja_kronika.xml"
[TimeSkill]
time_format = 12h # Options are 12h and 24h
@@ -1,2 +0,0 @@
-Here is the top of the hour news from NPR.
-Here is this hour's news from NPR.
@@ -1,7 +0,0 @@
-{
- "utterance": "what's the news",
- "intent_type": "NPRNewsIntent",
- "intent": {
- "NPRNewsKeyword": "news"
- }
-}
@@ -1,7 +0,0 @@
-{
- "utterance": "is there any news",
- "intent_type": "NPRNewsIntent",
- "intent": {
- "NPRNewsKeyword": "news"
- }
-}
@@ -1,7 +0,0 @@
-{
- "utterance": "tell me the news",
- "intent_type": "NPRNewsIntent",
- "intent": {
- "NPRNewsKeyword": "tell me the news"
- }
-}
@@ -1,7 +0,0 @@
-{
- "utterance": "what are the latest news",
- "intent_type": "NPRNewsIntent",
- "intent": {
- "NPRNewsKeyword": "news"
- }
-}
@@ -1,2 +0,0 @@
-news
-tell me the news
@@ -26,22 +26,22 @@
from mycroft.util import play_mp3
from mycroft.util.log import getLogger
-__author__ = 'jdorleans'
+__author__ = 'jdorleans, msev'
LOGGER = getLogger(__name__)
-class NPRNewsSkill(MycroftSkill):
+class SLONewsSkill(MycroftSkill):
def __init__(self):
- super(NPRNewsSkill, self).__init__(name="NPRNewsSkill")
+ super(SLONewsSkill, self).__init__(name="SLONewsSkill")
self.url_rss = self.config['url_rss']
self.weather = weather.WeatherSkill()
self.process = None
def initialize(self):
self.load_data_files(dirname(__file__))
- intent = IntentBuilder("NPRNewsIntent").require(
- "NPRNewsKeyword").build()
+ intent = IntentBuilder("SLONewsIntent").require(
+ "SLONewsKeyword").build()
self.register_intent(intent, self.handle_intent)
self.weather.bind(self.emitter)
@@ -50,7 +50,7 @@ def initialize(self):
def handle_intent(self, message):
try:
data = feedparser.parse(self.url_rss)
- self.speak_dialog('npr.news')
+ self.speak_dialog('slo.news')
time.sleep(3)
self.process = play_mp3(data['entries'][0]['links'][0]['href'])
@@ -59,10 +59,10 @@ def handle_intent(self, message):
def stop(self):
if self.process and self.process.poll() is None:
- self.speak_dialog('npr.news.stop')
+ self.speak_dialog('slo.news.stop')
self.process.terminate()
self.process.wait()
def create_skill():
- return NPRNewsSkill()
+ return SLONewsSkill()
@@ -0,0 +1,2 @@
+Here is the top of the morning news from Slovenia.
+Here is this morning's news from NPR.
@@ -0,0 +1,7 @@
+{
+ "utterance": "what's the news",
+ "intent_type": "SLONewsIntent",
+ "intent": {
+ "SLONewsKeyword": "news"
+ }
+}
@@ -0,0 +1,7 @@
+{
+ "utterance": "is there any news",
+ "intent_type": "SLONewsIntent",
+ "intent": {
+ "SLONewsKeyword": "news"
+ }
+}
@@ -0,0 +1,7 @@
+{
+ "utterance": "tell me the news",
+ "intent_type": "SLONewsIntent",
+ "intent": {
+ "SLONewsKeyword": "tell me the news"
+ }
+}
@@ -0,0 +1,7 @@
+{
+ "utterance": "what are the latest news",
+ "intent_type": "SLONewsIntent",
+ "intent": {
+ "SLONewsKeyword": "news"
+ }
+}
@@ -0,0 +1,4 @@
+news
+tell me the news
+whats the news
+what's the news

0 comments on commit 164c720

Please sign in to comment.