Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the shorty Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:01:24 2020 GMT+0.
• Introduction | What shorty is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
A toy URL datastore.
This is a toy project which can be used to store any amount of data in the URL of a URL-shortening service. It exploits the fact that most URL shortening services do not check that a URL points to a real website, and as such, any data can be URL-shortened.
How it works:
Takes a file pathname as input.
Compresses the file with the DEFLATE compression scheme.
Encodes the compressed file using the Base64 encoding scheme.
Splits the data into chunks of typically a few kilobytes long, depending on the URL shortening service used.
Creates a short URL for each chunk.
Concatenates the path components of all short URLs into 1 long string,
separated by a forward slash /
.
Again, creates a short URL using the concatenated path components as input.
The result is a single short URL that has an arbitrary amount of data stored in the URL.
(ql:quickload :shorty)
To store a file in a URL:
(shorty:shorten-file "/path/to/in-file")
To write a file to disk given a URL:
(shorty:unshorten-file "http://short-url" :file "/path/to/out-file")
There are 2 main issues that will likely never be fixed, as this is just meant to be a proof of concept toy.
Local limit: Shortening and unshortening are done completely in memory, so you need enough heap space.
Remote limit: During the concatenation of URL path components to create the single short URL at the end of the shortening process, the resulting string must also fit into a chunk size supported by the specified URL-shortening service. The path component length depends on the service. Do not expect to store more than a few megabytes of data at best.
Copyright © 2017-2018 Michael Fiano.
Licensed under the MIT License.
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The shorty system |
Michael Fiano <mail@michaelfiano.com>
Michael Fiano <mail@michaelfiano.com>
(:git "git@github.com:mfiano/shorty.git")
MIT
Shorten URLs using third-party services.
# shorty
A toy URL datastore.

## Overview
This is a toy project which can be used to store any amount of data in the URL of a URL-shortening
service. It exploits the fact that most URL shortening services do not check that a URL points to a
real website, and as such, any data can be URL-shortened.
How it works:
- Takes a file pathname as input.
- Compresses the file with the DEFLATE compression scheme.
- Encodes the compressed file using the Base64 encoding scheme.
- Splits the data into chunks of typically a few kilobytes long, depending on
the URL shortening service used.
- Creates a short URL for each chunk.
- Concatenates the path components of all short URLs into 1 long string,
separated by a forward slash ‘/‘.
- Again, creates a short URL using the concatenated path components as input.
- The result is a single short URL that has an arbitrary amount of data stored
in the URL.
## Install
“‘lisp
(ql:quickload :shorty)
“‘
## Usage
To store a file in a URL:
“‘lisp
(shorty:shorten-file "/path/to/in-file")
“‘
To write a file to disk given a URL:
“‘lisp
(shorty:unshorten-file "http://short-url" :file "/path/to/out-file")
“‘
## Known Limitations
There are 2 main issues that will likely never be fixed, as this is just meant to be a proof of
concept toy.
- Local limit: Shortening and unshortening are done completely in memory, so you need enough heap
space.
- Remote limit: During the concatenation of URL path components to create the single short URL at
the end of the shortening process, the resulting string must also fit into a chunk size supported
by the specified URL-shortening service. The path component length depends on the service. Do not
expect to store more than a few megabytes of data at best.
## License
Copyright © 2017-2018 [Michael Fiano](mailto:mail@michaelfiano.com).
Licensed under the MIT License.
1.0.0
shorty.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The shorty.asd file | ||
• The shorty/package.lisp file | ||
• The shorty/services.lisp file | ||
• The shorty/shorty.lisp file |
Next: The shorty/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/shorty-20180228-git/shorty.asd
shorty (system)
Next: The shorty/services․lisp file, Previous: The shorty․asd file, Up: Lisp files [Contents][Index]
Next: The shorty/shorty․lisp file, Previous: The shorty/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
shorty (system)
services.lisp
Previous: The shorty/services․lisp file, Up: Lisp files [Contents][Index]
services.lisp (file)
shorty (system)
shorty.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The shorty package |
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Shorten the file corresponding to the pathname FILE, producing a single short URL which encodes all of its data.
shorty.lisp (file)
Unshorten the file stored in URL, storing the result to disk in the pathname corresponding to FILE.
shorty.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal special variables | ||
• Internal functions | ||
• Internal generic functions |
Next: Internal functions, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
shorty.lisp (file)
Next: Internal generic functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Build a query URL string for SERVICE and the encoded DATA.
shorty.lisp (file)
Compress DATA using the DEFLATE compression scheme.
shorty.lisp (file)
Decode DATA encoded in the Base64 encoding scheme.
shorty.lisp (file)
Encode DATA using the Base64 encoding scheme.
shorty.lisp (file)
Shortens all shortened URL CHUNKS into a single short URL for the specified SERVICE.
shorty.lisp (file)
Generate a random chunk size within 25% of the maximum chunk size allowed for SERVICE.
shorty.lisp (file)
Get the path component of URL.
shorty.lisp (file)
Get the 301 redirection target from the header of URL.
shorty.lisp (file)
Get the path component of the 301 redirection target of URL.
shorty.lisp (file)
Read a chunk of DATA as a string, with a size up to the maximum size supported by SERVICE.
shorty.lisp (file)
Rejoin all chunks encoded in the short URL URL, returning a DEFLATE-compressed, Base64-encoded string.
shorty.lisp (file)
Resolve all the chunks contained in the short URL URL, returning a list of more short URL’s.
shorty.lisp (file)
Split DATA into chunks, collecting a list of shortened URL’s of each chunk, for the specified SERVICE.
shorty.lisp (file)
Query the specified SERVICE for a short URL that redirects to a long URL storing the encoded DATA.
shorty.lisp (file)
Uncompress DATA encoded in the DEFLATE compression scheme.
shorty.lisp (file)
Unshorten the data stored in URL, returning an octet vector.
shorty.lisp (file)
Previous: Internal functions, Up: Internal definitions [Contents][Index]
shorty.lisp (file)
Generate a URL prefix using Google’s domain name. This is a workaround for bugs present in both drakma and dexador HTTP client libraries.
Generate a URL prefix with a random 4-character domain name under the .com TLD, and a random 4-character sub-domain, which will prefix the encoded data in a URL shortening service query, in order to mimic an real website link.
services.lisp (file)
services.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L S |
---|
Jump to: | F L S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | B C D E F G M R S U |
---|
Jump to: | B C D E F G M R S U |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
* | |||
*input-buffer* : | Internal special variables | ||
| |||
S | |||
Special Variable, *input-buffer* : | Internal special variables | ||
|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
P | |||
Package, shorty : | The shorty package | ||
| |||
S | |||
shorty : | The shorty system | ||
shorty : | The shorty package | ||
System, shorty : | The shorty system | ||
|
Jump to: | P S |
---|