Skip to content

Commit

Permalink
Add verb-url
Browse files Browse the repository at this point in the history
  • Loading branch information
federicotdn committed Dec 21, 2024
1 parent c05263f commit d10daef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ New features / improvements:
- URLs can now span multiple lines, place '\\' at the end of the URL line to continue it in the next one. Leading whitespace in the additional lines will be skipped.
- Added new function `verb-body-lf-to-crlf` designed for use with requests sending multipart data.
- Added new `Verb-Prelude` heading property, which can be used to specify an Emacs Lisp or JSON file to load variables from, before performing requests.
- Added `verb-shell` and `verb-unix-epoch` utility functions.
- Added `verb-shell`, `verb-url` and `verb-unix-epoch` utility functions.
- Allow using Org [hyperlinks](https://orgmode.org/guide/Hyperlinks.html) in URLs, for example: `get [[http://example.com][my example]]`.

## **2.16.0** - 2024-03-02 (MELPA Stable)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ Note that the point must be surrounded by the code tag delimiters (e.g. `{{` and

Verb offers some utility functions to be used within code tags, such as:
- `verb-shell`: Currently, just an alias to `shell-command-to-string`.
- `verb-url`: Currently, just an alias to `url-encode-url`.
- `verb-unix-epoch`: Returns the current UNIX epoch (seconds) as an integer.
- `verb-json-get`: Retrieves a value from within a JSON value.
- `verb-read-file`: Reads the contents of a file (following some additional Verb-specific behaviour).
Expand Down
3 changes: 3 additions & 0 deletions verb.el
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,9 @@ an error."
(defalias 'verb-shell #'shell-command-to-string
"Alias to `shell-command-to-string'.")

(defalias 'verb-url #'url-encode-url
"Alias to `url-encode-url'.")

(defun verb-unix-epoch ()
"Return the current time as an integer number of seconds since the epoch."
(floor (time-to-seconds)))
Expand Down

0 comments on commit d10daef

Please sign in to comment.