[GiteaBridge] Add new bridge
Gitea is a fork of Gogs and therefore shares most of its features except for releases.
This commit is contained in:
parent
e4444e6432
commit
fa8253c8bf
1 changed files with 27 additions and 0 deletions
27
bridges/GiteaBridge.php
Normal file
27
bridges/GiteaBridge.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* Gitea is a fork of Gogs which may diverge in the future.
|
||||
* https://docs.gitea.io/en-us/
|
||||
*/
|
||||
require_once 'GogsBridge.php';
|
||||
|
||||
class GiteaBridge extends GogsBridge {
|
||||
|
||||
const NAME = 'Gitea';
|
||||
const URI = 'https://gitea.io';
|
||||
const DESCRIPTION = 'Returns the latest issues, commits or releases';
|
||||
const MAINTAINER = 'logmanoriginal';
|
||||
const CACHE_TIMEOUT = 300; // 5 minutes
|
||||
|
||||
protected function collectReleasesData($html) {
|
||||
$releases = $html->find('#release-list > li')
|
||||
or returnServerError('Unable to find releases');
|
||||
|
||||
foreach($releases as $release) {
|
||||
$this->items[] = array(
|
||||
'uri' => $release->find('a', 0)->href,
|
||||
'title' => 'Release ' . $release->find('h3', 0)->plaintext,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue