Created
June 25, 2016 13:32
-
-
Save drunkensouljah/9901da429d74ea78226809a8f002c142 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/python | |
# | |
# from http://www.pythonforbeginners.com/feedparser/using-feedparser-in-python | |
# installed feedparser with `pip`, after installing pip with apt-get | |
# | |
import feedparser | |
import time | |
from subprocess import check_output | |
# ------ | |
# uptime | |
# ------ | |
uptime = check_output(['uptime']) | |
print "\n" | |
print '-------------------------------------------------------------' | |
print uptime.strip() | |
print '-------------------------------------------------------------' | |
print "\n" | |
# -------------------- | |
# tribune (feedparser) | |
# -------------------- | |
d = feedparser.parse('http://chicagotribune.feedsportal.com/c/34253/f/622872/index.rss') | |
# print all posts | |
count = 1 | |
blockcount = 1 | |
for post in d.entries: | |
if count % 5 == 1: | |
print "\n" + time.strftime("%a, %b %d %I:%M %p") + ' ((( TRIBUNE - ' + str(blockcount) + ' )))' | |
print "-----------------------------------------\n" | |
blockcount += 1 | |
print post.title + "\n" | |
count += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment