Browse Source

add gemini-dl, gemtext-php resources

main
yggverse 4 months ago
parent
commit
ea59f4dc84
  1. BIN
      gemini/gemini-dl/gemini-dl.png
  2. 93
      gemini/gemini-dl/index.gmi
  3. 78
      gemini/gemtext-php/index.gmi
  4. 4
      index.gmi

BIN
gemini/gemini-dl/gemini-dl.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

93
gemini/gemini-dl/index.gmi

@ -0,0 +1,93 @@
# gemini-dl
CLI Batch Downloader for Gemini Protocol, inspired by wget and yt-dlp
At this moment, project under development, some features already testing
## Interface
=> gemini-dl.png
## Components
=> https://github.com/YGGverse/gemini-php Client for Gemini protocol
=> https://github.com/YGGverse/gemtext-php Parser for Gemtext
=> https://github.com/YGGverse/net-php Network toolkit for URL operations
=> https://github.com/mikeerickson/php-cli-colors CLI colors
## Features
* Grab single URL or --crawl entire capsule
* Multiple MIME types download (e.g. inline images and other media)
* Detailed crawler log for every request + totals
* Flexible options
* Custom --delay between requests
* Custom --index filename for directories
* Custom storage location: Filesystem, FTP
* Optional links replacement for local navigation: relative (default), --absolute or --keep
* --match regex URL
* --unique snap version or sync with existing copy
* Configurable redirect levels to --follow
* Crawl depth --level limit
* Document size limit to download
* Follow --external links on crawl
## Environment
``` bash
apt install git composer php-fpm php-mbstring
```
## Install
``` bash
git clone https://github.com/YGGverse/gemini-dl.git
cd gemini-dl
composer update
# for direct execution only:
chmod +x src/gemini-dl.php
```
## Usage
``` bash
src/gemini-dl.php --source gemini://.. --target /path/to/download
```
* alternatively, launch with specified php version: /path/to/php src/gemini-dl.php
### Options
``` bash
# Required
-s, --source - string, gemini protocol address
-t, --target - string, absolute path to destination folder
# Optional
-a, --absolute - no value, links to absolute filepath (ignored on --keep), disabled by default
-c, --crawl - no value, crawl document links (entire capsule download), disabled by default
-d, --delay - integer, pause between requests to prevent abuse (seconds), 1 by default
-i, --index - string, index filename of directory listing, index.gmi by default
-h, --help - no value, show available commands
-k, --keep - no value, keep original links (--crawl mode only), disabled by default
-m, --match - string, collect links match regex rule, /.*/ by default
-r, --raw - no value, include meta headers (--keep option ignored), disabled by default
-u, --unique - no value, append snap version as folder timestamp, disabled by default
# Experimental (in development)
-e, --external - no value, follow external hosts, disabled by default
-f, --follow - integer, follow redirects on --crawl, 0 by default
-l, --level - integer, depth to --crawl, 0 by default
```
* show in CLI: gemini-dl.php --help
## Download
=> https://github.com/YGGverse/gemini-dl Source on GitHub
=> https://github.com/YGGverse/gemini-dl/issues Feedback
=> https://github.com/YGGverse/gemini-dl/pull Contributions

78
gemini/gemtext-php/index.gmi

@ -0,0 +1,78 @@
# gemtext-php
PHP 8 / Composer Library for Gemtext Operations
This library is lightweight, object-oriented Gemtext replacement to gemini-php
## Install
``` bash
composer require yggverse/gemtext:dev-main
```
## Example
### Parse existing document
``` php
// Load document from file
$document = new \Yggverse\Gemtext\Document(
file_get_contents(
'tests/data/document.gmi'
)
);
// Get links
foreach ($document->getLinks() as $link)
{
print(
$link->toString()
);
}
```
### Create new document
``` php
// Init new document
$document = new \Yggverse\Gemtext\Document;
// Append header
$document->append(
new \Yggverse\Gemtext\Entity\Header(
'Hello world'
)
);
// Init new link
$link = new \Yggverse\Gemtext\Entity\Link(
'gemini://geminiprotocol.net',
'The Gemini Program',
'1965-01-19'
);
// Change link date
$link->setDate(
date('Y-m-d')
);
// Append link
$document->append(
$link
);
// Get gemtext
print(
$document->toString()
);
// Save to file
file_put_contents(
'/path/to/file.gmi',
$document->toString()
)
```
## Download
=> https://github.com/YGGverse/gemtext-php GitHub

4
index.gmi

@ -7,12 +7,12 @@ Open Source Solutions for Yggdrasil Ecosystem
### Gemini ### Gemini
=> gemini/bdoku/index.gmi β-Doku is DokuWiki Satellite for Gemini Protocol => gemini/bdoku/index.gmi β-Doku is DokuWiki Satellite for Gemini Protocol
=> gemini/gemini-dl/index.gmi CLI Batch Downloader for Gemini Protocol
=> gemini/gemini-php/index.gmi PHP 8 / Composer Library for Gemini Protocol => gemini/gemini-php/index.gmi PHP 8 / Composer Library for Gemini Protocol
=> gemini/gemtext-php/index.gmi PHP 8 / Composer Library for Gemtext Operations
=> gemini/yo/index.gmi Yo! Micro Web Crawler in PHP & Manticore => gemini/yo/index.gmi Yo! Micro Web Crawler in PHP & Manticore
=> https://github.com/kevachat/geminiapp KevaChat - Chat in KevaCoin BlockChain => https://github.com/kevachat/geminiapp KevaChat - Chat in KevaCoin BlockChain
=> https://github.com/kvazar-network/geminiapp KevaCoin Explorer for Gemini Protocol => https://github.com/kvazar-network/geminiapp KevaCoin Explorer for Gemini Protocol
=> https://github.com/YGGverse/gemini-dl CLI downloader for Gemini Protocol
=> https://github.com/YGGverse/gemtext-php PHP 8 library for Gemini / Gemtext operations
=> https://github.com/YGGverse/Pulsar Pulsar - RSS Aggregator for Gemini Protocol => https://github.com/YGGverse/Pulsar Pulsar - RSS Aggregator for Gemini Protocol
=> https://github.com/YGGverse/titan-II Titan-II fork with native IPv6 support (archive) => https://github.com/YGGverse/titan-II Titan-II fork with native IPv6 support (archive)
=> https://github.com/YGGverse/Yoda Yoda is PHP-GTK 3 Browser for Gemini Protocol => https://github.com/YGGverse/Yoda Yoda is PHP-GTK 3 Browser for Gemini Protocol

Loading…
Cancel
Save