Pastebot

Pastebot is a combined IRC bot and web-based paste bin. The IRC bot announces URLs on channel for text snippets that are pasted through the web interface. The IRC bot also acts as a communal command line interface to the server. Commands include management of ban lists to prevent abuse through the web interface.

Pastebot was conceived of and created in May of 2002, making it one of the original of its species. Few if any contemporary paste bins and bots combine the IRC and web components within a singlue process.

Official pastebot releases are available as the Bot::Pastebot distribution on the Comprehensive Perl Archive Network.

New Directions

Yaakov has been stirring the pot a bit and got a few IRC denizens talking about pastebot again. Bits and pieces that I was able to glean from the discussion are as follows:

  • Syntax::Highlight::Engine::Kate
  • Web2.0 goodies might be useful
  • denizen gets some control over pasters submitting using their nick using an IRC side doc
    • approve first paste w/timer.
    • block pasters by source IP
  • It might be desirable to use apache to support webside
  • If web interface is broken from the irc interface then there needs to be more formal communication between the irc bot and the webbie bits
14:15:03 < Yaakov> Here is the scenario.  User pastes. Bot checks channel for 
                   match of IP to supplied nick. No nick in channel?  Quit.  
                   Match nick/IP?  OK!  Announce.  Nick but no IP match?  Query 
                   nick holder: Did you paste?  Yes!  Announce!  No!  Ban IP.  
                   (etc.( 
14:15:07 < Yaakov> )

other discussion ensued.

See also: http://p3m.org/

Pastebot will comprise four major functional blocks:

  • Storage
  • Pipeline
  • Transport
  • Agents

Storage

The Storage block will contain all code resonsible for storing and retrieving patsewads and their associated metadata. The Storage block will accept messages from the pipeline which include data and RPC. The Storage block will have methods to manage the paste data, including but not exclusively:

  • store paste
  • retrieve paste
  • delete paste
  • query pastes from user/channel/date/time/etc.

Pipeline

The Pipeline block will contain code to translate between UI Agent specific messages and internal generic API messages and move them between storage and transpport. The Pipeline block wil consist of a series of filters. The filters will be ordered by defaults for each transport and optionally by instructions either receieved in a message (from the UI Agent or from the Storage block), or possibly generated by a filter in the chain. Filters will be able to change the content of the message, pass the message unchanged, short-circuit processing (and return a response) or stop processing completely.

Filters will have functions including but not limited to:

  • conversion to and from markup languages
  • addition of metadata to the pastewad (such as syntax highlighting)
  • "spinal" data validation and error checking (reject malformed requests, enforce security, etc.)
  • iterative processing (change the request based on queries made to the Storage block)

Transport

The Transport block will provide functionality for interpreting and acting on addressing information and transporting the requests and responses to and from the pipeline. The Transport block will include a high-level dispatcher to select the correct type of transport method and each transport method will be responsible for parsing and acting the addressing information included with the message. The Transport block is entirely transparent and will not alter any part of the message it handles with the possible exception of a transport specific field in the message related to routing. Transport methods may include but will not be limited to:

  • HTTP
  • IRC
  • IM

Agents

Agents are independent processes which handle the specifics of user interaction. The will be able to connect (persistently or otherwise) transport methods and exchange messages. These messages will be formatted for each Agent. While Agents might modify these messages internally, they are not expected to understand the internal message format used by the Storage block. The extent to which a particular Agents messages are more domain specific will vary with the agent and its needs, non-eclusive examples of Agents include:

  • Web Browsers
  • IRC bots
  • IRC clients
  • Telnet Clients

Starting Points

For a complete list of local wiki pages, see TitleIndex

Trac is brought to you by Edgewall Software, providing professional Linux and software development services to clients worldwide. Visit http://www.edgewall.com/ for more information.

Attachments