Skip to content

Instantly share code, notes, and snippets.

@gfranxman
Last active January 29, 2016 14:28
Show Gist options
  • Select an option

  • Save gfranxman/1c259f7d29b01da64437 to your computer and use it in GitHub Desktop.

Select an option

Save gfranxman/1c259f7d29b01da64437 to your computer and use it in GitHub Desktop.
import requests
rip_url = 'https://www.guitartricks.com/blog/Goodbye-Glenn-Frey-a-Fallen-Eagle?utm_source=Guitar+Tricks+Newsletter&utm_campaign=bb3aded8a8-GT_NL_Prospects_1_29_2016&utm_medium=email&utm_term=0_832235591b-bb3aded8a8-95269893'
c = requests.get( rip_url ).content
c = c.replace('Frey', 'Franxman')
c = c.replace('Lewis', '')
c = c.replace('the Eagles', 'Scripps')
c = c.replace('trouble', 'python')
c = c.replace('music', 'APIs')
c = c.replace('band', 'group')
c = c.replace('1970', '1997')
s = c.index('<br>\nI had') +4
e = c.index("wasn't.") + len("wasn't.")
print c[s:e]
s = c.index("I've")
e = c.index("mind.") + len("mind.")
print c[s:e]
s = c.index("It's hard")
e = c.index("in it.") + len("in it.")
print c[s:e]
import requests
from xml.dom import minidom
rko_url = 'http://blog.parse.com/announcements/moving-on/?utm_content=educational&utm_campaign=2016-01-29&utm_source=email-sendgrid&utm_term=4387876&utm_medium=250114'
lines = requests.get(rko_url).content.split("\n")
dom = minidom.parseString( [ l for l in lines if "og:description" in l ][0] )
v = dom.childNodes[0].attributes.values()[0]
print v.value[:425].replace( 'Parse', 'Glenn Franxman' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment