# Pythonista Trick URL to Markdown

Here’s a nice little tool I made in Pythonista for iOS (review). This script is using Brett Terpstra’s awesome heckyesmarkdown web service, which is extremely useful and underrated.

To use this script, I copy a URL to the iOS clipboard and jump into Pythonista. I trigger this script to get the web page in Markdown encoded text.

is turned into plain text and put back on the clipboard. The results are displayed in a popup Pythonista browser window:

Here’s the script:

:::python
import clipboard
import urllib2
import webbrowser

clipString = clipboard.get()

marky = 'http://heckyesmarkdown.com/go/?u='

queryString = marky + clipString

reqMD = urllib2.Request(queryString)
openMD = urllib2.urlopen(reqMD)