Functions.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:Personal_AI_Assistant 作者: PratylenClub 项目源码 文件源码
def read_RSS_feed(assistant, player_vlc, instance_vlc, rss_dic, number_records_to_read):
    assistant.speak("Tell me the name of the rss feed")
    msg = assistant.active_listen()
    if msg in rss_dic.keys():
        rss = rss_dic[msg]
    else:
        rss = DEFAULT_RSS
    assistant.speak("ok! I am calling my assistant, she will read the RSS feed.")
    res = feedparser.parse(rss)
    number_records_in_feed = len(res.entries)
    if number_records_in_feed < number_records_to_read:
        number_records_to_read = number_records_in_feed
    entries_to_read = [entry.title_detail.value for entry in res.entries[0:number_records_to_read]]
    txt=". ".join(entries_to_read)
    read_nicely_text(txt, instance_vlc, player_vlc)
    '''
    for entry in entries_to_read:    
        assistant.speak(entry.title_detail.value)
        time.sleep(1)
    '''
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号