Skip to content

Instantly share code, notes, and snippets.

@wolfwoodbrbu
Forked from blha303/gist:2289179
Created April 3, 2012 06:27
Show Gist options
  • Save wolfwoodbrbu/2289764 to your computer and use it in GitHub Desktop.
Save wolfwoodbrbu/2289764 to your computer and use it in GitHub Desktop.
Get's the newest hash of the current CraftBukkit build.
#!/usr/bin/python
import urllib
import re
page = urllib.urlopen('http://dl.bukkit.org/downloads/craftbukkit/list/rb/').read()
re1='.*?' # Non-greedy match on filler
re2='(MD5)' # Variable Name 1
re3='.*?' # Non-greedy match on filler
re4='(Checksum)' # Variable Name 2
re5='.*?' # Non-greedy match on filler
re6='((?:[a-z0-9]{32}))' # Alphanum 1
rg = re.compile(re1+re2+re3+re4+re5+re6,re.IGNORECASE|re.DOTALL)
m = rg.search(page)
if m:
alphanum1=m.group(3)
print alphanum1+"\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment