From 008503d447c9519f04f45837f17bfd8a699e7d61 Mon Sep 17 00:00:00 2001 From: Sanj Date: Thu, 11 Aug 2011 01:12:39 +0530 Subject: [PATCH] silly proxy --- campchat/chat/views.py | 13 +++++++++++++ campchat/urls.py | 1 + 2 files changed, 14 insertions(+) diff --git a/campchat/chat/views.py b/campchat/chat/views.py index 6a5d798..1a3d5cf 100644 --- a/campchat/chat/views.py +++ b/campchat/chat/views.py @@ -1,6 +1,19 @@ # Create your views here. from settings import IRC_SERVER, DEFAULT_CHANNEL from django.shortcuts import render_to_response +import urllib2 +from django.http import HttpResponse + +''' +PLEASE DELETE THIS VIEW. IT IS FOR SOME TOTALLY UNRELATED NONSENSE +''' +def proxyTmp(request): + url = request.GET.get("url", "") + if url != '': + txt = urllib2.urlopen(url).read() + return HttpResponse(txt) + else: + return HttpResponse('wha?') def main(request, channel): if channel == '': diff --git a/campchat/urls.py b/campchat/urls.py index 277af98..f9de7db 100644 --- a/campchat/urls.py +++ b/campchat/urls.py @@ -7,6 +7,7 @@ from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: # (r'^campchat/', include('campchat.foo.urls')), + (r'proxy$', 'chat.views.proxyTmp'), (r'(?P.*)', 'chat.views.main'), # Uncomment the admin/doc line below to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')),