Commits

Artyom Semyonov committed f5c5c66

Initial commit

Comments (0)

Files changed (3)

Empty file added.
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <title>MooFFDebate</title>
+
+    <link rel="stylesheet" type="text/css" href="css/croplr.css" />
+
+    <script type="text/javascript" src="http://static.tumblr.com/j8ivo9f/L27l0td25/moocore.js"></script>
+    <script type="text/javascript" src="http://static.tumblr.com/j8ivo9f/ljBl0td33/moomore.js"></script>
+    <script type="text/javascript" src="http://static.tumblr.com/j8ivo9f/Fo3l0td8z/mooffdebate.js"></script>
+    <script type="text/javascript">
+        window.addEvent('DOMContentLoaded', function(){
+            // Comments for http://weirdfledgling.tumblr.com/post/514280739
+            var comments = new Comments({
+                username: 'arsemyonov',
+                post_id: 514280739
+            });
+            comments.addEvent('complete', function(comments){
+                console.log(comments);
+            });
+            comments.fetch();
+        });
+    </script>
+</head>
+<body>
+</body>
+</html>

src/mooffdebate.js

+
+var Comments = new Class({
+    Implements: [Options, Events],
+    options: {},
+    initialize: function(options){
+        this.setOptions(options);
+    },
+
+    fetch: function(callback){
+        new Request.JSONP({
+            url: 'http://friendfeed-api.com/v2/search',
+            data: {
+                q: 'from:' + this.options.username + '+'
+                           + this.options.post_id
+            },
+            onComplete: function(data){
+                this.fireEvent('complete', [
+                    data.entries[0].comments
+                ]);
+            }.bind(this)
+        }).send()
+    }
+});