-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.py
67 lines (62 loc) · 1.94 KB
/
index.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from create_url import CreateUrl
from view_urls import ViewUrls
from clean_stats import CleanStats
from goto_url import GotoUrl
from view_hits import ViewHits
from view_countries import ViewCountries
from view_country_hits import ViewCountryHits
from view_country_url_hits import ViewCountryUrlHits
from view_city_hits import ViewCityHits
from view_city_url_hits import ViewCityUrlHits
from view_region_hits import ViewRegionHits
from view_region_url_hits import ViewRegionUrlHits
from view_ip_hits import ViewIpHits
from view_ip_url_hits import ViewIpUrlHits
from view_stats import ViewStats
class Index(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/html'
self.response.out.write("""
<html>
<body>
<br /><br /><br /><br />
<br /><br /><br /><br />
<div align="center">
<h1>Create Tracking Url</h1>
<form action="/create" method="post">
<input type="text" style="width: 400px;" id="url" name="url" />
<button>Create Url</button>
</form>
<a href="/urls" >View Urls</a> |
<a href="/hits" >View Hits</a>
</div>
</body>
</html>
""")
application = webapp.WSGIApplication(
[
('/', Index ),
('/create', CreateUrl ),
('/urls', ViewUrls ),
('/clean', CleanStats ),
('/goto*', GotoUrl ),
('/hits', ViewHits ),
('/countries', ViewCountries ),
('/chits', ViewCountryHits ),
('/cuhits', ViewCountryUrlHits ),
('/cthits', ViewCityHits ),
('/ctuhits', ViewCityUrlHits ),
('/rhits', ViewRegionHits ),
('/ruhits', ViewRegionUrlHits ),
('/ihits', ViewIpHits ),
('/iuhits', ViewIpUrlHits ),
('/stats', ViewStats )
],
debug=True
)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()