Skip to content

Instantly share code, notes, and snippets.

@whalesalad
Created September 5, 2014 17:25
Show Gist options
  • Select an option

  • Save whalesalad/27c1ad4f909e50b205a7 to your computer and use it in GitHub Desktop.

Select an option

Save whalesalad/27c1ad4f909e50b205a7 to your computer and use it in GitHub Desktop.
from random import randrange
import re
import urllib
socket = urllib.urlopen("http://www.youporn.com/random/video/")
htmlSource = socket.read()
socket.close()
result = re.findall('<p class="message">((?:.|\\n)*?)</p>', htmlSource)
print
print result[randrange(len(result))]
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment