chickadee » pastiche

Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

pastiche - An awfully simple pastebin.

Introduction

pastiche is a BSD licensed awful application providing a basic pastebin service. It has been named pastiche in honor of lisppaste where loads of ideas and the syntax highlighting (indirectly via the colorize egg has been borrowed).

Usage

After installation create and compile the following file:

(use awful pastiche)

(pastiche "/" "paste.db"
          awful-settings:
          (lambda (handler)
            (parameterize
                ((debug-file "/tmp/paste")
                 (page-css "http://wiki.call-cc.org/chicken.css")
                 (page-charset "UTF-8")
                 (page-doctype "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"))
              (handler))))

load this then with awful

$ awful example-app.scm

Or compile it and load the compiled application:

$ csc -s awful-app.scm
$ awful example-app.so

This will run the pastebin service using call-cc.org's css look and feel on your host. Access http://localhost/ for your paste app.

Requirements

If you use captchas, the external program figlet must be installed. If you use audible-captchas, you winsert into searchable select * from pastes;ill need espeak in pastiche's PATH.

Caveat: If using the search feature with the bundled sql-de-lite db, you need to make sure that the SQLITE_ENABLE_FTS3_PARENTHESIS option is not set. Otherwise people searching for parenthesis make pastiche error out.

Documentation

pastiche

(pastiche base-path db-file #!key (vandusen-port 22722) (vandusen-host "localhost") (base-url "http://paste.call-cc.org") (use-captcha? #t) (audible-captcha? #t) (num-captchas 500) (browsing-steps 15) force-vandusen-notification? (awful-settings (lambda (_) (_))))procedure

Starts pastiche with base-path as the root URL and the sqlite database file db-file. If the database file does not exist, pastiche will create and initialize an empty database.

It supports sending the paste event to the chicken IRC bot vandusen. The message contains of the author, the title of the paste and the url to the paste on one line.

Keywords:
vandusen-port
TCP port number which the vandusen bot listens on
vandusen-host
hostname which vandusen resides on. Set to #f to disable vandusen notifications
base-url
The absolute base URL to the root of pastiche
use-captcha
If #t iinsert into searchable select * from pastes;t will try to use figlet for creating a captcha. Set to #f to disable captchas
audible-captcha?
If #t (the default) it will check for espeak and if that's available on the system will generate wav files on demand for each captcha.
num-captchas
Defines the number of different captchas that will get created
browsing-steps
The number of paste entries per page
force-vandusen-notification?
If bound to a truthy value, unconditionally notify #chicken via vandusen on new pastes. When enabled, the checkbox to select notification via vandusen is not displayed.
awful-settings
A procedure that will get the path before passed to awful's handler. See awful's documentation for details.

Author

Christian Kellermann

Repository

https://github.com/ckeen/pastiche

License

Copyright 2011 Christian Kellermann <ckeen@pestilenz.org>. All
rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
   1. Redistributions of source code must retain the above
   copyright notice, this list of conditions and the following
   disclaimer.
   2. Redistributions in binary form must reproduce the above
   copyright notice, this list of conditions and the following
   disclaimer in the documentation and/or other materials provided
   with the distribution.
THIS SOFTWARE IS PROVIDED BY CHRISTIAN KELLERMANN ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CHRISTIAN KELLERMANN OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
The views and conclusions contained in the software and
documentation are those of the authors and should not be
interpreted as representing official policies, either expressed or
implied, of Christian Kellermann.

Version History

0.1
initial release
0.2
bugfix release, thanks to Andy Bennet, Peter Bex, Mario Goulart, Moritz Heidkamp
0.x
some blunders while learning to use the system
0.8
updated release-info with correct anchors on paste page
0.16
couple of small bug fixes; new keyword parameter for the pastiche procedure: force-vandusen-notification?
0.17
Fix browsing older pastes, this has been there forever
0.18
Ported to SXML. Don't colorize output if paste is longer than 5000 characters. Improvements for development.
0.19
Audible captcha support, also fix some small bugs found by Andy Bennet and Mario Goulart.
0.20
bugfix release supporting older espeak versions
0.21
fixing the version metadata, so it won't get confused with older versions by setup-api code.
0.22
Limit the input length of nick and title fields to 78 (Thanks to Mario Goulart).
0.23
paste-url now has an ID
0.24
The css is also delivered through the same scheme as the rest (Thanks Mario Goulart).
0.25
Search functionality has been added, provided by sqlite's fts3 full text search
0.26
Fix a bug in the detection of audible captcha dependencies on figlet and epspeak (Thanks Kooda)
0.27
Add simple spam detection (Thanks Kooda)
0.33
Fixed meta infos and several bugfixes since 0.27...

Contents »