Giter Site home page Giter Site logo

agamsol / rentry Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 0.0 300 KB

Create, View, Edit and delete pastes hosted at rentry.org using batch file. rentry.org is markdown-powered pastebin/publishing service

Home Page: https://rentry.org

Batchfile 100.00%
rentry paste-service command-line batch rentryco rentryorg

rentry's Introduction

๐Ÿงพ RENTRY API - Batch Version

rentry.org is markdown-powered pastebin/publishing service with preview, custom urls and editing.

This repository contains a simple script that allows pasting and editing from command line interface.

โš ๏ธ PLEASE NOTE:

The script in this repository was not made by the official authors of rentry.org and it is a replica for the repository of radude/rentry. what makes it different is the language used in the 2 repositories.

Same purpose - based on different language.

DEPENDENCIES

These depencies apply to rentry.cmd version 1.0.0.5

  • Powershell 3.0 (according to microsoft docs)

  • cURL Must be added to path.

    assuming that curl is pre-installed in windows since Windows 10, version 1803 or later you should be ok (else you'd want to specify a curl installation using the --curl flag)

  • rentry.org must be online to use this script.

๐Ÿ“ซ Download the API

  • Download the API's Source code and save it in a folder
  • Copy the path to the folder
  • open a cmd window
  • type cd /d "<paste_path_here>"
  • after this you can use the API by calling its file name.

โ“ USING THE API

Primary commands

  • --help View the help page - Default page in a case non of the primary commands were specified
  • --new Create new entry
  • --edit Edit existing entry
  • --delete Delete existing entry
  • --raw Display a paste as RAW
  • --if-exist Check if entry exists at all

Options (Sub Commands)

NOTE: The order of specified options does not matter and all options are recorded.

  • --url <entry> Specify a URL
  • --edit-code <code> Specify code to edit or delete the entry
  • --file "<file.txt>" Specify path to file to upload or to output the RAW function
  • --curl "full\path\to\curl.exe" Specify custom curl installation file

Below I made a small chart for the required options for each primary command.

In each case of use at least 1 primary command should be specified. the primary commands are the ones in the first row of the chart the first column shows the sub commands that each primary command needs.

USAGE --help --new --edit --delete --raw --if-exist
--url not needed optional required required required required
--edit-code not needed optional required required not needed not needed
--file not needed required required not needed optional not needed
--curl not needed optional optional optional optional optional

Example for reading the chart:

  • To use the --edit function you must specify a --url, --edit-code and --file

EXAMPLES OF USE

  • call rentry.cmd --new --file "file.txt"

    • Create new entry and POST the content inside file.txt in it.
  • call rentry.cmd --new --url myurl --edit-code mycode --file file.txt

    • Create new entry with custom URL and code and POST
  • call rentry.cmd --edit --url myurl --edit-code mycode --file "file.txt"

    • Edit entry using its url and code and replace the content with the new one in the file
  • call rentry.cmd --delete --url myurl --edit-code mycode

    • Delete the entry using its url and code.
  • call rentry.cmd --raw --url myurl

    • Display the paste's text in the terminal
  • call rentry.cmd --raw --url myurl --file "file.txt"

    • Save the entry's content to a file.
  • call rentry.cmd --if-exist --url myurl

    • Check if entry exists using its URL
Example to specify curl installation file
  • call rentry.cmd --raw --url myurl --curl "C:\Users\Agam\Desktop\files\curl.exe"
    • use specified curl version to perform the raw command

๐Ÿ“ Change Log

What has changed at version 1.0.0.5 (This Version)

  • Fixed a bug where the length of the URL is not measured at all
[ Thanks to https://www.dostips.com, sowgtsoi, jeb and amel27 for the amazing work on the length counter function. ]

What has changed at version 1.0.0.4

  • Support new domain of rentry (rentry.org)
  • Reduced code using a BaseURL variable
  • New Entry Creation Format: [ URL={URL} ] [ EDIT_CODE={EDIT_CODE} ]
๐Ÿ”Ž View older versions

What has changed at version 1.0.0.3

  • Removed part of label in line which could cause problems in some cases

What has changed at version 1.0.0.2

  • Added errorlevels for all exit cases (0 = success | 1 = error)

What has changed at version 1.0.0.1

  • Added new flag --if-exist - this helps to check if entry exists at all by returning an Ok
  • Fixed forgotten line where printed debugging issues
  • Fixed Code-Page issues
  • Fixed custom cURL spaces path

Contact information and support ๐Ÿ“š

Feel free to contact me in discord, Agam#0001

Im also available in the r/batch discord server. (you can and should ping me there)

rentry's People

Contributors

agamsol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.