This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # http://axe.g0v.tw/level/1 | |
| import urllib, urllib2, re | |
| html = urllib2.urlopen("http://axe-level-1.herokuapp.com").read() | |
| pattern = r"<tr>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*</tr>" | |
| result = re.findall(pattern, html, re.MULTILINE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # http://axe.g0v.tw/level/2 | |
| import urllib2, re | |
| lines = [] | |
| for index in range(1, 13): | |
| url = "http://axe-level-1.herokuapp.com/lv2/?page=" + str(index) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # http://axe.g0v.tw/level/3 | |
| import urllib, urllib2, re | |
| import cookielib | |
| lines = [] | |
| jar = cookielib.FileCookieJar("cookies") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # http://axe.g0v.tw/level/4 | |
| import urllib, urllib2, re | |
| lines = [] | |
| last_url = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using HTTPClient.HTTPC | |
| r = HTTPC.get("http://axe-level-1.herokuapp.com") | |
| @assert r.http_code == 200 | |
| html = bytestring(r.body) | |
| pattern = r"<tr>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*</tr>" | |
| substrings = matchall(pattern, html) | |
| lines = String[] | |
| for s in substrings[2:] | |
| c = match(pattern, s).captures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using HTTPClient.HTTPC | |
| lines = String[] | |
| for index =[1:13] | |
| url = "http://axe-level-1.herokuapp.com/lv2" | |
| r = HTTPC.get(url, RequestOptions(query_params=collect({:page => index}))) | |
| @assert r.http_code == 200 | |
| html = bytestring(r.body) | |
| pattern = r"<tr>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*<td>(.*)</td>\s*</tr>" | |
| substrings = matchall(pattern, html) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using HTTPClient.HTTPC | |
| lines=String[] | |
| cookie="" | |
| url="http://axe-level-1.herokuapp.com/lv3/" | |
| for index = [1:76] | |
| if index == 1 | |
| r=HTTPC.get(url) | |
| received_cookie=r.headers["Set-Cookie"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| @interface NSNull (NullValues) | |
| - (BOOL)boolValue; | |
| - (char)charValue; | |
| - (double)doubleValue; | |
| - (float)floatValue; | |
| - (int)intValue; | |
| - (NSInteger)integerValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html ng-app> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>政治獻金 API Reader</title> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
| <script src="CampaignFinance.js"></script> | |
| <style> @import url("css.css"); </style> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| font-family: sans-serif; | |
| } | |
| table { | |
| margin: 10px; | |
| padding: 10px; | |
| border: 1px solid #CCC; | |
| } |
OlderNewer