Permalink
Browse files

better json output and analytics tracking

  • Loading branch information...
progrium committed Apr 24, 2010
1 parent a1f3854 commit 9da6dce1cc328a4846f01c35ab88fd7e38a1fed9
Showing with 13 additions and 1 deletion.
  1. +4 −1 models.py
  2. +9 −0 templates/base.html
View
@@ -62,7 +62,10 @@ def __iter__(self):
outval = v
out.append((k, outval))
else:
- out = (('body', self.body),)
+ try:
+ out = (('body', simplejson.dumps(simplejson.loads(self.body), sort_keys=True, indent=2)),)
+ except (ValueError, TypeError):
+ out = (('body', self.body),)
# Sort by field/file then by field name
files = list()
View
@@ -13,6 +13,15 @@ <h1>PostBin</h1>
</div>
</div>
<script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-6824126-14");
+ pageTracker._trackPageview();
+ } catch(err) {}</script>
+ <script type="text/javascript">
var uservoiceJsHost = ("https:" == document.location.protocol) ? "https://uservoice.com" : "http://cdn.uservoice.com"
document.write(unescape("%3Cscript src='" + uservoiceJsHost + "/javascripts/widgets/tab.js' type='text/javascript'%3E%3C/script%3E"))
</script>

0 comments on commit 9da6dce

Please sign in to comment.