Skip to content

Instantly share code, notes, and snippets.

View interstar's full-sized avatar

Phil Jones interstar

View GitHub Profile
@interstar
interstar / quorascraper.py
Created July 22, 2013 04:15
Quora RSS scraper.
import feedparser
import hashlib
import json
from bs4 import BeautifulSoup
d = feedparser.parse("http://www.quora.com/YOUR-QUORA-NAME/answers/rss")
for e in d["entries"] :
title = e["title"]
summary = e["summary"]
@interstar
interstar / cmdncurse.py
Created June 27, 2012 16:14
Using Python Cmd and Curses Together
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import curses
import curses.textpad
import cmd
def maketextbox(h,w,y,x,value="",deco=None,textColorpair=0,decoColorpair=0):
# thanks to http://stackoverflow.com/a/5326195/8482 for this
nw = curses.newwin(h,w,y,x)
@interstar
interstar / permgen.py
Created February 25, 2012 00:19
Python Permutation Generator : A generator that outputs all permutations of a sequence
def perm(xs) :
if xs == [] :
yield []
for x in xs :
ys = [y for y in xs if not y==x]
for p in perm(ys) :
yield ([x] + p)
@interstar
interstar / stuff.txt
Created March 16, 2011 12:38
narcstuff
hi aha