Skip to content

Instantly share code, notes, and snippets.

@v2e4lisp
Created January 30, 2013 17:02
Show Gist options
  • Save v2e4lisp/4674691 to your computer and use it in GitHub Desktop.
Save v2e4lisp/4674691 to your computer and use it in GitHub Desktop.
hackernews reader in 10 lines of python code
#!/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