Azel is a python library equivalent to the Elza Perl macro-language (HTTP scripting)
It basically allows you to automatize sequences of HTTP requests and to script around it (without having to care about sessions / redirections / randomly generated input fields)...
Initialization
importazela=azel.Azel()Query a website
a.get('http://www.lescigales.org') # promo never hurts !Specify a proxy to use
a.proxyHost='10.7.0.1'a.proxyPort=8118Collect links from a web page:
getLink(re.pattern) will return the href of the first link match getLinks(re.pattern) will return a list of links
a.get('http://sk.php.net/')
dl=a.getLink('downloads')
a.get(dl)
links=a.getLinks('PHP 5.')
forlinkinlinks:
printlink.href, link.value, link.title# Download the first link a.get(link.href)
l=a.getLink('sk.php.net')
a.get(l)
tarball=a.read() # thats right babe, we just got php's tarball breakPre-fill a form
a.get('https://gist.github.com/')
a.fillForm()
printa.data# this will return the prefilled form dataPost a form (and publish cool stuff on gist)
a.get('http://gist.github.com/')
a.fillForm()
a.data['file_ext[gistfile1]'] ='.py'a.data['file_name[gistfile1]'] =__file__.strip('./')
a.data['description'] ='This was published by awesome azel!'a.data['file_contents[gistfile1]'] =contenta.post('') # will post the first formwill produce the following output:
-> GET http://gist.github.com/
<- 301 Moved Permanently
-> GET https://gist.github.com/
<- 200 OK
-> POST https://gist.github.com/gists
<- 302 Found
-> GET https://gist.github.com/2491246
<- 200 OKAnnoy the hell of an asshole by trashing his blog:
blog=azel.Azel()
final= []
blog.get('http://strepoetlo.legtux.org/')
links=blog.getLinks('/#respond')
forlinlinks: final.append(l.href)
links=blog.getLinks('/#comments')
forlinlinks: final.append(l.href)
previous=blog.getLink('Previous')
blog.get(previous)
links=blog.getLinks('/#respond')
forlinlinks: final.append(l.href)
links=blog.getLinks('/#comments')
forlinlinks: final.append(l.href)
forlinkinfinal:
printlinkblog.get(link)
blog.fillForm()
post='http://strepoetlo.legtux.org/wp-comments-post.php's='http://forum.lescigales.org/topic1638-site-de-phishing-httpstrepoetlolescigalesorg-par-strepoetlo.html'blog.data['author'] ='Paul Gonsolin'blog.data['url'] ='http://strepoetlo.lescigales.org/'blog.data['email'] ='no-reply@lescigales.org'blog.data['comment'] ='Createur de sites de phishing Facebook, priere de ne plus venir sur lesCigales.ORG. -> <a href="'+s+'">'+s+'</a>'blog.post(post)