1 Star 0 Fork 0

sjdy521/app-mojopaste

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

NAME

App::mojopaste - Pastebin application

VERSION

0.15

DESCRIPTION

Mojopaste is a pastebin application. There's about one million of these out there, but if you have the need to run something internally at work or you just fancy having your own pastebin, this is your application.

Text and code

The standard version of App::mojopaste can take normal text as input, store it as a text file on the server and render the content as either plain text or prettified using Google prettify. (Note: Maybe another prettifier will be used in future versions)

Charts

In addition to just supporting text, this application can also make charts from the input data. To turn this feature on, you need to specify "enable_charts" in the config or set the PASTE_ENABLE_CHARTS environment variable:

$ PASTE_ENABLE_CHARTS=1 script/mojopaste daemon;

The input chart data can be given as JSON or CSV:

  • Raw morris.js arguments

    Example:

    {
      "data": [
        { "x": "2015-02-04 15:03", "a": 120, "b": 90 },
        { "x": "2015-03-14", "a": 75, "b": 65 },
        { "x": "2015-04", "a": 100, "b": 40 }
      ],
      "xkey": "x",
      "ykeys": ["a", "b"],
      "labels": ["Series A", "Series B"]
    }

    "xkey" default to "x". "ykeys" default to the rest of the keys in the first element in "data", excluding xkey. "labels" default to "ykeys".

    See http://morrisjs.github.io/morris.js/lines.html for more details.

    Note that by installing JSON.pm the input format can be less strict, allowing JavaScript notation instead of strict JSON.

  • Just data

    [
      // comments are allowed
      # both "#" and "//" can be used anywhere, but on a line by itself
      { "x": "2015-02-04 15:03", "a": 120, "b": 90 },
      { "x": "2015-03-14", "a": 75, "b": 65 },
      { "x": "2015-04", "a": 100, "b": 40 }
    ]

    This input format takes just an JSON array and will use that as "data". The rest will use the default value rules from above.

  • CSV data

    CSV data is similar to "Just data" above, except the first line is used as "xkey,ykey1,ykey2,...". Example:

    # Can have comments in CSV input as well
    x,a,b
    2015-02-04 15:03,120,90
    2015-03-14,75,65
    2015-04,100,40

    CSV input data require Text::CSV to be installed.

DEMO

You can try mojopaste here: http://p.thorsen.pm.

INSTALLATION

Install system wide with cpanm:

$ cpanm --sudo App::mojopaste

Don't have cpanm installed?

$ curl -L http://cpanmin.us | perl - --sudo App::mojopaste
$ wget http://cpanmin.us -O - | perl - --sudo App::mojopaste

SYNOPSIS

  • Simple single process daemon

    $ mojopaste daemon --listen http://*:8080
  • Save paste to custom dir

    $ PASTE_DIR=/path/to/paste/dir mojopaste daemon --listen http://*:8080
  • Using the UNIX optimized, preforking hypnotoad web server

    $ MOJO_CONFIG=/path/to/mojopaste.conf hypnotoad $(which mojopaste)

    Example mojopaste.conf:

    {
      paste_dir     => '/path/to/paste/dir',
      allow_robots  => 1, # default is 0
      enable_charts => 1, # default is 0
      hypnotoad => {
        listen => ['http://*:8080'],
      },
    }

    "allow_robots" will disable javascript requirements and allow simple scripts (robots) to use the pastebin without much knowledge.

    "enable_charts" is for adding a button which can make a chart of the input data using morris.js

    Check out Mojo::Server::Hypnotoad for more hypnotoad options.

  • Command line interface

    $ cat /path/to/file |curl -F "txt=<-" http://xxx.xxx.xxx/'
    $ curl -F "txt=</path/to/file" http://xxx.xxx.xxx/'
    $ curl -F "image=@/path/to/imagefile" http://xxx.xxx.xxx/'

OTHER PASTEBINS

AUTHOR

Jan Henning Thorsen - jhthorsen@cpan.org

空文件

简介

Pastebin 展开 收起
Perl
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Perl
1
https://gitee.com/sjdy521/app-mojopaste.git
git@gitee.com:sjdy521/app-mojopaste.git
sjdy521
app-mojopaste
app-mojopaste
master

搜索帮助