Permalink
Browse files

adding thing about dotjs

  • Loading branch information...
1 parent 29d5e7f commit 9ff6e88a04cc5565f429b28516c540d44464b537 @peterbe committed Aug 26, 2011
Showing with 44 additions and 7 deletions.
  1. +8 −5 dotjs/twitter.com.js
  2. +25 −0 handlers.py
  3. +1 −1 templates/base.html
  4. +8 −0 templates/dotjs.html
  5. +2 −1 templates/home.html
View
@@ -1,11 +1,17 @@
+/* Version 0.1
+ * 26 August 2011
+ *
+ * Copyright http://toocoolfor.me
+ */
+
+
function L() {
if (window.console && window.console.log)
console.log.apply(console, arguments);
}
-
var Lookup = (function() {
- var BASE_URL = 'http://localhost:8000';
+ var BASE_URL = 'http://toocoolfor.me';
var screennames = [];
function findScreenNames() {
@@ -32,7 +38,6 @@ var Lookup = (function() {
alert(response.ERROR);
return;
}
- L($('span.tweet-content').size());
var screen_name, tag;
$('div.tweet-content').each(function() {
@@ -62,8 +67,6 @@ var Lookup = (function() {
.css('padding-right', '30px')
.css('font-size', '11px')
.appendTo($('span.tweet-user-name', this));
- L('screen_name', screen_name);
-
});
});
View
@@ -210,3 +210,28 @@ def get(self):
return
options['user'] = user
self.render('test.html', **options)
+
+@route(r'/dotjs', name='dotjs')
+class DotJSHandler(BaseHandler):
+
+ def get(self):
+ options = {}
+ user = self.get_current_user()
+ self.render('dotjs.html', **options)
+
+
+@route(r'/download/twitter.com.js')
+class DotJSHandler(BaseHandler):
+
+ def get(self):
+ import os
+ parent = os.path.abspath(os.path.dirname(__file__))
+ dir_ = os.path.join(parent, 'dotjs')
+ filepath = os.path.join(parent, 'dotjs', 'twitter.com.js')
+ assert os.path.isfile(filepath)
+ self.set_header('Content-Type', 'application/octet-stream')
+ self.set_header('Content-Disposition',
+ 'attachment;filename="%s"' %
+ os.path.basename(filepath))
+ with file(filepath) as f:
+ self.write(f.read())
View
@@ -35,7 +35,7 @@ <h3>Service to allow you to find out who of the people you follow also follow yo
</section>
<footer>
-<p>Brought to be you by <a href="http://www.peterbe.com/">Peter Bengtsson</a>
+<p>Brought to you by <a href="http://www.peterbe.com/">Peter Bengtsson</a>
&bull;
<a href="https://github.com/peterbe/toocool">code on github</a>
</p>
View
@@ -0,0 +1,8 @@
+{% extends "base.html" %}
+{% block content %}
+
+<h2>1. Download and install the <a href="https://github.com/defunkt/dotjs">dotjs Chrome extension</a></h2>
+
+<h2>2. <a href="/download/twitter.com.js">Download <code>twitter.com.js</code></a> and put in your <code>~/dotjs/</code> directory</h2>
+
+{% end %}
View
@@ -3,10 +3,11 @@
{% if user %}
-<p><strong>{{ user }}</strong>
+<p><strong>{{ user }}</strong>
<span style="font-size:0.7em">(<a href="/auth/logout/">Log out</a>)</span>
</p>
<p><a href="/test">Test the service</a></p>
+<p><a href="/dotjs">Download the Chrome extension</a></p>
{% else %}
<p>stranger<br>

0 comments on commit 9ff6e88

Please sign in to comment.