Package: pastemngr
pastemngrA powerful pastebin manager for the command lineIntroductionPaste manager (pastemngr) is a command line tool for pastebin.com. By consuming
the pastebin service API, this tool has the hability to create and retrieve
pastes from the command line as well as fetching information regarding users
and pastes (locally and online).Developer keySince this application makes use of an API, a developer key is needed. The key
in question is provided bypastebin.com.
If the key is not present in the configurations,pastemngrwon't work
at all.User keyThis is another key used by thepastebinAPI, but this one is fetched by
the API itself and it's used to execute operations that are related to a
specific pastebin user.For example, when posting a paste as a given user X, the API has to know its
user key, which will be provided in thePOSTpayload.DependenciesPython (>=3.6);requestsmodule to perform HTTP requests;A text editor (nanoby default).InstalationYou can install pastemngr through PyPI:pip install pastemngrManual installationThis is the process for installing pastemngr from a clone.git clone https://github.com/pvpscript/pastemngr
cd pastemngrThen run,sudo make installWhich is the same aspython setup.py install --record=install_log.txt --prefix=/usr
--root=/ --optimize=1The installation log will be saved asinstall_log.txtGetting the developer keyThere are two ways of getting this key and applying it to this program.
The first one is described below.First method (automatically fetching the key)This method is the easiest, but it can be unreliable in some situations, since
it depends on html crawling, and sometimes the pastebin login page will ask
for acaptcharesolution, so this might not work everytime.To fetch the key and save it locally, simply run:pastemngr --fetch-dev-keySecond method (doing it manually)This section is a guide through the process of inserting the developer
key manually into pastemngr's configuration. It's important to have this
solution at hand, since the automatic process is highly prone to failure.Login to thepastebin.comwebsite;Access theapi page;Look for a section called "Your Unique Developer API Key" as shown
by the image below;In this section, there will be a text block containing a code
e.g.b026324c6904b2a9cb4b88d6d61c81d1. Copy the code found there;Go to the configuration directory, discussed below, create a blank
file calleddev_keyand paste the code found at the pastebin site;Save the file.ConfigurationThe configuration directory is located under$XDG_CONFIG_HOME/pastemngr/by default, or$HOME/.config/pastemngr/if the first is undefined.dev_key fileThis file refers to the developer key used for executing operations on the
pastebin API.pastemngr.db fileThis is anautomatically generateddatabase file that will keep local
informations, such as pastes info, pastes text and registered accounts with
user info, which includes the user key.Usagepastemngr [OPTIONS] [<command>]Options--fetch-dev-keyRequest a pastebin login, fetch the account's developer key and save  it
locally, at the config directory. This application needs a developer key to
access the pastebin API, otherwise it won't work.CommandsList of accepted commands. For more information about the options, refer topastemngr(1)manual page.list_userslist_users [--raw]List registered users in the local database.registerregister [-u USER] [--username USER]Register the given user in the local database. This will fetch the user key
associated with the given user name, and store it locally.removeremove [-u USER] [--username USER]Remove the given user from the local database.user_infouser_info [-u USER] [--username USER] [--local] [--raw]Show informations about the given user.new_pastenew_paste [--input-file FILE] [-u USER] [--username USER]  [--title TITLE]  [--format FMT] [--visibility N] [--expire TIME]Create a new paste and upload it to pastebin.fetch_pastefetch_paste [--paste-key KEY] [--local]Fetch the paste identified by the given key.list_pasteslist_pastes [-u USER] [--username USER] [--local] [--raw]List pastes belonging to the given user.delete_pastedelete_paste [-u USER] [--username USER] [--paste-key KEY] [--local]Remove the paste identified by the given key.paste_infopaste_info [--paste-key KEY]Show informations about the paste identified by the given key.remove_expiredremove_expired [-u USER] [--username USER]Remove  expired  pastes  from the local database for every registered user or
for the given user.update_dbupdate_db [-u USER] [--username USER]Update the local database for every registered user or for the given user.