Created
November 29, 2013 15:48
-
-
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
This file contains 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
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