derp

0.0.2 • Public • Published

Derp

Do you want great profits? Make a blog! But how?? Magic.

var redis = require('redis').createClient();
var blog = require('derp');
blog.redis = redis;

There's your blog. Write a post dufas.

blog.save({
  id: 'best-post-ever',
  title: "my life",
  markdown: "makin' *mad stacks* bitches. markdown up in hurr",
  tags: ["gangsta life", "chillin"],
  published: new Date()
}, function (error) { ... });

Wtf do we do with that id?

blog.get('best-post-ever', function (error, post) {
  // lol, post.content is HTML, not markdown
  // how great is that
  put_post_on_the_browser_window(post);
});

All done! Oh snap, forgot to make a home page.

blog.page({page: 1, perPage: 10}, function (error, posts) {
  put_all_the_posts_on_the_browser_window(posts);
});

Regret that post? No problem.

blog.remove('best-post-ever', function (error) { ... });

BTW, your blog should maximize SEO:

blog.page({page: 1, perPage: 10, tag: "gangsta life"}, function (error, posts) {
  put_the_titles_on_the_sidebar_somewhere(posts);
});
 
blog.tags(function (error, tags) {
  // tags[0].tag
  // tags[0].count
});

Feeling special yet? Go make a blog you idiot!

TODO

  • Markdown in titles ?
  • Archive lists by year, month, day (doc)
  • Option for listing published/non-published (doc)

Readme

Keywords

none

Package Sidebar

Install

npm i derp

Weekly Downloads

3

Version

0.0.2

License

none

Last publish

Collaborators

  • apeace