mirror of
https://github.com/YGGverse/yggverse.github.io.git
synced 2025-01-01 16:24:49 +00:00
56 lines
974 B
Plaintext
56 lines
974 B
Plaintext
# gemini-php 0.3.0
|
|
|
|
Version 0.3.0 is here!
|
|
|
|
Includes new classes for object-oriented work with gemtext (text/gemini)
|
|
|
|
## Example
|
|
|
|
``` php
|
|
$request = new \Yggverse\Gemini\Client\Request(
|
|
'gemini://yggverse.cities.yesterweb.org'
|
|
);
|
|
|
|
$response = new \Yggverse\Gemini\Client\Response(
|
|
$request->getResponse()
|
|
);
|
|
|
|
$body = new \Yggverse\Gemini\Gemtext\Body(
|
|
$response->getBody()
|
|
);
|
|
|
|
var_dump(
|
|
$body->getH2()
|
|
);
|
|
|
|
foreach ($body->getLinks() as $line)
|
|
{
|
|
$link = new \Yggverse\Gemini\Gemtext\Link(
|
|
$line
|
|
);
|
|
|
|
var_dump(
|
|
$link->getAddress()
|
|
);
|
|
|
|
var_dump(
|
|
$link->getAlt()
|
|
);
|
|
|
|
var_dump(
|
|
$link->getDate(
|
|
$timestamp // get unix time from this variable
|
|
)
|
|
);
|
|
|
|
var_dump(
|
|
$timestamp
|
|
);
|
|
}
|
|
```
|
|
|
|
## Links
|
|
|
|
=> https://github.com/YGGverse/gemini-php/releases/tag/0.3.0 Download gemini-php 0.3.0
|
|
=> https://github.com/YGGverse/gemini-php?tab=readme-ov-file#gemtext Gemtext API methods
|