Skip to content

Instantly share code, notes, and snippets.

@Cam1337
Created May 5, 2010 17:37
Show Gist options
  • Save Cam1337/391143 to your computer and use it in GitHub Desktop.
Save Cam1337/391143 to your computer and use it in GitHub Desktop.
def CheckGit(self):
#Twisted attack http://gist.github.com/379664
if len(self.args)>=5:
try:
if self.args[4]=="cam":
GitURL="http://github.com/Cam1337/PyIRC/commits/master.atom"
else:
GitURL="http://github.com/%s/%s/commits/master.atom" % (self.args[4], self.args[5])
Page = (BeautifulSoup(urllib2.urlopen(GitURL)))
MostRecentCommit = str(Page("content")[0]).split("gt;m")[1].split("&lt")[0].strip()
File=MostRecentCommit.split("\n")[0]
Comment=MostRecentCommit.split("\n")[2]
Commit_Update="Most recent commit, File: %s; Comment: \"%s\"" % (File, Comment)
self.iSend(Commit_Update)
except:
self.iSend("This user/project don't exist")
else:
self.iSend("command -> .commit <user> <project>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment