Mon 2008-01-14 ( bl pr )

History

I began writing the application that runs this blog on 2008-01-13, shortly after exploring Camping, _why’s extremely small web framework (which has only 4KB of code). I was amazed how easy it is to create a web application with it.

blokk is derived from the original blog.rb example.

Try it yourself! It’s really fun to work with Camping – but only if you know Ruby.

The name derives simply from my initials, KK.

The Golden Rule of blokk

Somehow, I decided to keep blokk at 318 lines of code (that’s without empty lines and comments).
318 is one of my favourite numbers (the other being 308).

Download

  • blokk – the application that you see running.
  • blokk in color – highlighted with CodeRay.
  • feed – a 17-LOC library to simplify RSS feed generation (build on top of Ruby’s rss lib.)
  • validate_size – counts the lines of code for blokk.rb. Returns 318.

Development & Support

We have a Redmine project for blokk running on code.licenser.net.

Features

blokk 0.998 includes the following features:

  • Read and write simple articles with title and body.
  • To edit and delete posts, you have to login. Username and password are set while migrating.
  • Everybody can add comments (currently plain text only).
  • Cookies are only used when you try to login (I hate it when pages send me cookies for no reason.)
  • Posts and comments remember their creating time and are ordered chronologically.
  • Posts have tags and can be viewed by selecting a tag from the menu bar.
  • Posts have a nickname for clean and prett URLs.
  • Textile is used for the posts.
  • Comments are protected from spambots with a bit of JavaScript.
  • Comments can also be deleted by the admin.
  • Of course, it has a CSS template.
  • It looks nice in elinks, too!
  • The site is valid XHTML. I also indented the output (Markaby’s default output looks horrible!)
  • Errors that prevent a comment or post from being saved are pointed out with red labels.
  • Post previews (excerpts)
  • RSS feeds for
    • posts: only for a specific tag or for all tags
    • comments
  • Pretty URLs (e.g. the path to this post is just /blokk) using nicknames
  • Access keys for keyboard lovers
  • Source code highlighting using CodeRay

Changelog

  • [0.94] It is possible to split a post into excerpt and full content. In the index, only the excerpt is shown.
  • [0.95] You can link to an article with a really short URL now: /<nickname>.
  • [0.96] Access keys added, and nicknames can include dashes now.
  • [0.97] Comment size is checked to be < 3000 chars.
  • [0.97] RSS feeds! Really :)
  • [0.97] Page titles when reading a post (makes bookmarking nicer.)
  • [0.98] Fixed: Comments are wrapped to fit into the box
  • [0.98] Fixed: Nicknames can include Unicode characters.
  • [0.98] New: Show all articles with /all.
  • [0.99] New: Automatic tag setting when creating a new article.
  • [0.99] New: A logo in the header.
  • [0.99] Fixed: E access key only available in single-post view.
  • [0.991] Layout: The whole title is one single link.
  • [0.991] RSS feed link links to current tag.
  • [0.991] RSS feed is served with correct Content-Type.
  • [0.991] RSS feed converts Textile to HTML.
  • [0.991] RSS feed has an image now.
  • [0.992] Fixed login.
  • [0.993] Fixed login, again.
  • [0.994] Highlighting using coderay/for_redcloth.
  • [0.995] Xmas-style, added a link to old style as an alternate stylesheet.
  • [0.996] Using XHTML 1.0 Transitional now.
  • [0.996] Fixed tag bug (tag “me” also matched “anime”, see ticket #93)
  • [0.996] Code cleanup; using new ActiveRecord::Base methods #all and #first.
  • [0.997] Comment feed (under /rss/comments)
  • [0.997] Fixed: The current tag is used for new and the post feed URL.
  • [0.997] Fixed: “Read / Lesen” now works as supposed to.
  • [0.998] Slogan (below the header), configurable via slogan.txt.

Planned features

  • Textile for comments (I couldn’t make it safe yet. The internet is a creepy place. Maybe with RedCloth 4?)
    • Preview for comments: Textile will make it necessary.

Features not planned

  • Language detection: Would be really nice. Most people seem to be annoyed by automatic language selection.
  • Search: Just use Google.
  • AJAX: Although I like it very much, I want to keep this simple, also for visitors that have a slow connection or no eyes or whatever.
  • Preview for posts: From my experience, I find most errors after publishing an article anyway. If you ever see such an under-construction post, remember: This is Web 2.0 beta.
  • Some kind of pagination and/or archive – I found out I don’t need it! Everything I tag “Index” will be on the front page. Just tag older messages like “2008-01” or “old” to make an archive.

Say something! / Sag was!

This is cool! Keep up the good work!
Tuna @ 04:37 on Friday, 2008-07-11
yeah. keep learning that campy stuff.
Bumho' @ 16:47 on Tuesday, 2008-07-22
Username/Password? How do I retrieve this so I can log into the blog I just loaded up?
slack @ 07:50 on Sunday, 2008-08-17
Try the camping console or sqlite3. The password is stored in plain text.
murphy @ 14:00 on Friday, 2008-08-22
Hi!

I thought you'd like to know I'm using a modified version of blokk to run my blog at http://blog.bloople.net
Brenton Fletcher @ 04:46 on Sunday, 2009-02-08
Yay \o/ I'm happy that you find it useful...it's there to be modified :D
murphy @ 21:50 on Sunday, 2009-02-15
Its really a great and useful piece of information. Im glad that you shared this useful info with us. Please keep us informed like this. Thanks for sharing. eddbekbcadgbeked
Smitha174 @ 07:10 on Thursday, 2014-08-21
Very nice site! <a href="http://oixypea2.com/oxovryr/1.html">cheap goods</a>
Pharmk84 @ 22:35 on Thursday, 2014-08-21
Very nice site!  [url=http://oixypea2.com/oxovryr/2.html]cheap goods[/url]
Pharmd966 @ 22:37 on Thursday, 2014-08-21
Very nice site! <a href="http://opeaixy2.com/qsqsxoa/1.html">cheap goods</a>
Pharmf797 @ 04:28 on Friday, 2014-08-22
Very nice site! cheap goods http://opeaixy2.com/qsqsxoa/4.html
Pharmc343 @ 04:29 on Friday, 2014-08-22
Very nice site!
Pharmb743 @ 04:30 on Friday, 2014-08-22
Very nice site! <a href="http://yieopxa2.com/yxyaqkx/1.html">cheap goods</a>
Pharmd913 @ 11:16 on Saturday, 2014-08-23
Very nice site!  [url=http://yieopxa2.com/yxyaqkx/2.html]cheap goods[/url]
Pharma157 @ 11:16 on Saturday, 2014-08-23
Very nice site! cheap goods http://yieopxa2.com/yxyaqkx/4.html
Pharme506 @ 11:17 on Saturday, 2014-08-23
Very nice site!
Pharmk877 @ 11:17 on Saturday, 2014-08-23
Very nice site! <a href="http://aixopey2.com/qqsxot/1.html">cheap goods</a>
Pharme38 @ 19:30 on Monday, 2014-08-25
Very nice site!  [url=http://aixopey2.com/qqsxot/2.html]cheap goods[/url]
Pharma478 @ 19:30 on Monday, 2014-08-25
Very nice site! cheap goods http://aixopey2.com/qqsxot/4.html
Pharmd287 @ 19:31 on Monday, 2014-08-25
Very nice site!
Pharmb85 @ 19:31 on Monday, 2014-08-25
Very nice site! <a href="http://aixopey2.com/qqsxot/1.html">cheap goods</a>
Pharme407 @ 21:14 on Monday, 2014-08-25
Very nice site!  [url=http://aixopey2.com/qqsxot/2.html]cheap goods[/url]
Pharmd29 @ 21:18 on Monday, 2014-08-25
Very nice site! cheap goods http://aixopey2.com/qqsxot/4.html
Pharma315 @ 21:20 on Monday, 2014-08-25
Very nice site!
Pharmc26 @ 21:21 on Monday, 2014-08-25
Very nice site! <a href="http://apxyieo2.com/qyovry/1.html">cheap goods</a>
Pharmc568 @ 06:43 on Wednesday, 2014-08-27
Very nice site!  [url=http://apxyieo2.com/qyovry/2.html]cheap goods[/url]
Pharme621 @ 06:44 on Wednesday, 2014-08-27
Very nice site! cheap goods http://apxyieo2.com/qyovry/4.html
Pharmc184 @ 06:44 on Wednesday, 2014-08-27
Very nice site!
Pharma258 @ 06:46 on Wednesday, 2014-08-27
Very nice site! <a href="http://apxyieo2.com/qyovry/1.html">cheap goods</a>
Pharma513 @ 09:57 on Wednesday, 2014-08-27
Very nice site! cheap goods http://apxyieo2.com/qyovry/4.html
Pharmb438 @ 09:58 on Wednesday, 2014-08-27
Very nice site!
Pharme245 @ 09:58 on Wednesday, 2014-08-27
Very nice site!  [url=http://ypxaieo2.com/rrqsxqo/2.html]cheap goods[/url]
Pharmb559 @ 17:38 on Thursday, 2014-08-28
Very nice site! cheap goods http://ypxaieo2.com/rrqsxqo/4.html
Pharmd634 @ 17:38 on Thursday, 2014-08-28
Very nice site! <a href="http://ypxaieo2.com/rrqsxqo/1.html">cheap goods</a>
Pharme485 @ 21:05 on Thursday, 2014-08-28
Very nice site!  [url=http://ypxaieo2.com/rrqsxqo/2.html]cheap goods[/url]
Pharmg381 @ 21:05 on Thursday, 2014-08-28
Very nice site! cheap goods http://ypxaieo2.com/rrqsxqo/4.html
Pharma300 @ 21:05 on Thursday, 2014-08-28
Very nice site!
Pharmc654 @ 21:06 on Thursday, 2014-08-28
1
aYlNlfdX @ 19:26 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:26 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
-1 OR 2+507-507-1=0+0+0+1 -- @ 19:27 on Tuesday, 2024-08-06
1
-1 OR 2+309-309-1=0+0+0+1 @ 19:27 on Tuesday, 2024-08-06
1
-1' OR 3+405-405-1=0+0+0+1 -- @ 19:27 on Tuesday, 2024-08-06
1
-1' OR 3*2<(0+5+405-405) -- @ 19:27 on Tuesday, 2024-08-06
1
-1' OR 3*2>(0+5+405-405) -- @ 19:27 on Tuesday, 2024-08-06
1
-1' OR 2+444-444-1=0+0+0+1 or 'P5XXfPbG'=' @ 19:27 on Tuesday, 2024-08-06
1
-1" OR 2+471-471-1=0+0+0+1 -- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
if(now()=sysdate(),sleep(15),0) @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z @ 19:27 on Tuesday, 2024-08-06
1
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/ @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX-1 waitfor delay '0:0:15' -- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdXmTCCYXmw'; waitfor delay '0:0:15' -- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdXPawiwjDu' OR 134=(SELECT 134 FROM PG_SLEEP(15))-- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdXqY40ZCbJ') OR 185=(SELECT 185 FROM PG_SLEEP(15))-- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdXdP7yCLaX')) OR 511=(SELECT 511 FROM PG_SLEEP(15))-- @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||' @ 19:27 on Tuesday, 2024-08-06
1
'||(select 1 from (select pg_sleep(15))x)||' @ 19:27 on Tuesday, 2024-08-06
1
''||(select 1 from (select pg_sleep(15))x)||'' @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX'" @ 19:27 on Tuesday, 2024-08-06
1
@@EUlr1 @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1 OR 3+146-146-1=0+0+0+1 -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1 OR 3*2<(0+5+146-146) -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1 OR 3*2>(0+5+146-146) -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1 OR 2+555-555-1=0+0+0+1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1' OR 2+108-108-1=0+0+0+1 -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1' OR 2+249-249-1=0+0+0+1 or 'rMaXjezm'='
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
-1" OR 2+848-848-1=0+0+0+1 -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1*if(now()=sysdate(),sleep(15),0)
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
10'XOR(1*if(now()=sysdate(),sleep(15),0))XOR'Z
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
10"XOR(1*if(now()=sysdate(),sleep(15),0))XOR"Z
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1; waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1); waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1 waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
12cl1MoWR'; waitfor delay '0:0:15' -- 
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1 OR 890=(SELECT 890 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1) OR 592=(SELECT 592 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1-1)) OR 167=(SELECT 167 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1saQRHewF' OR 388=(SELECT 388 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1T9OFKbAb') OR 52=(SELECT 52 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1BEqZHe1w')) OR 520=(SELECT 520 FROM PG_SLEEP(15))--
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
'||(select 1 from (select pg_sleep(15))x)||'
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
''||(select 1 from (select pg_sleep(15))x)||''
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1'"
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
@@OiGoT
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:27 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:30 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:30 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:38 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:38 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:54 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:54 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:55 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:55 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:55 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:55 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:58 on Tuesday, 2024-08-06
1
aYlNlfdX @ 19:58 on Tuesday, 2024-08-06

No markup, just plain monospace text. / Kein Markup, nur Normschrift-Klartext.