Skip to content

Instantly share code, notes, and snippets.

@insom
Created November 29, 2013 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save insom/7707610 to your computer and use it in GitHub Desktop.
Save insom/7707610 to your computer and use it in GitHub Desktop.
Get a post from a WP blog and render as an ASCII Markdown file
import sys, urllib
from pyquery import PyQuery as pq
from html2text import html2text
from unidecode import unidecode
d = pq(urllib.urlopen(sys.argv[1]).read())
print unidecode(html2text(d(".entry-content").html()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment