Created
January 30, 2013 17:02
-
-
Save v2e4lisp/4674691 to your computer and use it in GitHub Desktop.
hackernews reader in 10 lines of python code
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 | |
# -*- coding: utf-8 -*- | |
import requests as rq | |
from pyquery import PyQuery as pq | |
hackernews = "http://news.ycombinator.com/rss" | |
rss = pq(rq.get(hackernews).text) | |
items = rss.find("item") | |
for item in items: | |
item = pq(item) | |
print '★ '+"\033[95m"+ unicode(item.find("title").text()).encode("utf8") + "\033[0m" | |
print " "+ item.find("link").text() | |
# check this :https://github.com/jeyb/hackernews.git | |
# a hackernews read written in shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment