forked from blallo/rss-bridge
[GitlabCommitsBridge] code simplification
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
0fea61a470
commit
9f6aff9699
1 changed files with 3 additions and 8 deletions
|
@ -26,16 +26,11 @@ class GitlabCommitsBridge extends BridgeAbstract{
|
||||||
));
|
));
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$uri = $this->getInput('uri').'/'.$this->getInput('u').'/'.$this->getInput('p').'/commits/';
|
$uri = $this->getInput('uri').'/'.$this->getInput('u').'/'
|
||||||
if($this->getInput('b')){
|
.$this->getInput('p').'/commits/'.$this->getInput('b');
|
||||||
$uri.=$this->getInput('b');
|
|
||||||
}else{
|
|
||||||
$uri.='master';
|
|
||||||
}
|
|
||||||
|
|
||||||
$html = $this->getSimpleHTMLDOM($uri)
|
$html = $this->getSimpleHTMLDOM($uri)
|
||||||
or $this->returnServerError('No results for Gitlab Commits of project '.$this->getInput('uri').'/'.$this->getInput('u').'/'.$this->getInput('p'));
|
or $this->returnServerError('No results for Gitlab Commits of project '.$uri);
|
||||||
|
|
||||||
|
|
||||||
foreach($html->find('li.commit') as $commit){
|
foreach($html->find('li.commit') as $commit){
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue