Created
March 9, 2013 18:47
-
-
Save LyndonArmitage/5125224 to your computer and use it in GitHub Desktop.
My first Python program. Gets the top 10 news stories from Reddits worldnews subreddit and speaks them out using a Text to Speech engine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import praw | |
import pyttsx | |
__author__ = "Lyndon Armitage" | |
username = "alarmbot" | |
password = "password" | |
engine = pyttsx.init() | |
r = praw.Reddit(user_agent="Lyndon's News Speaking Bot by /u/LyndonArmitage") | |
r.login(username, password) | |
submissions = r.get_subreddit("worldnews").get_hot(limit=10) | |
titles = [] | |
for sub in submissions: | |
titles.append(sub.title) | |
for s in titles: | |
print s | |
engine.say(s) | |
engine.runAndWait() | |
time.sleep(2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment