Permalink
Browse files

Added Sandbox controller

  • Loading branch information...
1 parent 7f47983 commit 8e1c7a2034aae031590f5544ad20cbcf3d24a3f0 @glebpopoff committed Oct 22, 2011
Showing with 31 additions and 0 deletions.
  1. +31 −0 SandboxController.py
View
31 SandboxController.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+#
+# Hacker News Droid API: returns best articles in JSON or XML using HTML Parser
+# Gleb Popov. September 2011
+#
+
+import os
+import re
+import logging
+from UserString import MutableString
+from django.utils import simplejson
+from google.appengine.ext import webapp
+from google.appengine.ext import db
+from google.appengine.ext.webapp import util
+import Formatter
+import AppConfig
+import GAHelper
+from xml.sax.saxutils import escape
+import APIUtils
+import GAHelper
+from BeautifulSoup import BeautifulSoup
+from google.appengine.api import urlfetch
+
+class HackerNewsSandboxHandler(webapp.RequestHandler):
+ def get(self):
+ try:
+ result = urlfetch.fetch(url=AppConfig.hackerNewsURL, deadline=30)
+ self.response.out.write(result.status_code)
+ self.response.out.write(result.content)
+ except:
+ self.response.out.write('unable to get data')

0 comments on commit 8e1c7a2

Please sign in to comment.