forked from GitHub/dbot
random imgur
This commit is contained in:
parent
2c03cbbbf3
commit
b7dad66a26
14
modules/imgur/pages.js
Normal file
14
modules/imgur/pages.js
Normal file
@ -0,0 +1,14 @@
|
||||
var _ = require('underscore')._;
|
||||
|
||||
var pages = function(dbot) {
|
||||
return {
|
||||
'/imgur/random': function(req, res) {
|
||||
res.render('imgurr', {
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports.fetch = function(dbot) {
|
||||
return pages(dbot);
|
||||
};
|
15
views/imgur/imgurr.jade
Normal file
15
views/imgur/imgurr.jade
Normal file
@ -0,0 +1,15 @@
|
||||
!!! 5
|
||||
html(lang='en')
|
||||
head
|
||||
meta(charset='utf-8')
|
||||
script(type="text/javascript", src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js")
|
||||
title random imgur
|
||||
script
|
||||
function wat() {
|
||||
$.get("/api/imgur/getRandomImage", function(d) {$('#image').attr('src', d.data[0])}, "json");
|
||||
};
|
||||
$(wat());
|
||||
$(document).keypress(wat);
|
||||
body
|
||||
div#container
|
||||
img#image(style='width: 100%')
|
Loading…
Reference in New Issue
Block a user