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.
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.
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'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.
--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
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
-
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
call rentry.cmd --raw --url myurl --curl "C:\Users\Agam\Desktop\files\curl.exe"
- use specified curl version to perform the raw command
- 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. ]
- 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
- Removed part of label in line which could cause problems in some cases
- Added errorlevels for all exit cases (0 = success | 1 = error)
- Added new flag
--if-exist
- this helps to check if entry exists at all by returning anOk
- Fixed forgotten line where printed debugging issues
- Fixed Code-Page issues
- Fixed custom cURL spaces path
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)