Skip to content

Quick and dirty pastebin script that generates and uploads static HTML using Pygments

License

Notifications You must be signed in to change notification settings

Treeki/SimplePaste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ninji's Quick and Dirty Paste Script

I needed a simple pastebin, and I didn't feel like writing PHP or figuring out how to deploy Python web code, so I figured... well, I don't need a web service, right?

This script takes a file with content to paste and generates pretty HTML using Pygments, and then uploads it somewhere and spits out a URL.

It currently writes to a local file or uses scp to upload - depending on the system it's running on - but you can (and should) change this by modifying the upload() function inside paste.py. Runs on both Python 2.x and 3.x.

Created by Ninjifox, 22nd February 2014

Licensed under the Do What The Fuck You Want To Public License ;)

Usage

Syntax: python paste.py <language> <path-to-file>

Example command line: python paste.py python paste.py

Language is a standard Pygments short lexer name - the only exception is irc, which bypasses Pygments entirely and uses a custom log munger I wrote, located inside irc_highlight.py.

Stylesheets

gencss.py outputs CSS to stdout containing the styles used by Pygments's highlighted output, and a bunch of other things. The generated HTML loads this from res/style.css by default.

Output Data

Paste names generated by this script include a timestamp and 8 random alphanumeric characters, for example: 140221.204843.krigifbd

A copy of the original paste data is also output into a file with the same name in the raw directory.

About

Quick and dirty pastebin script that generates and uploads static HTML using Pygments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages