You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
809 B

const express = require('express');
const rest = require('superagent');
const giteaHost = 'git.adb.sh';
const app = express();
app.get('/', function (req, res) {
res.send('Hello World');
});
app.listen(3000);
let updateRepos = setInterval(()=>{
rest.get('https://git.adb.sh/api/v1/repos/search?q=git.adb.sh').then(res=>{
console.log(res.text);
let content = JSON.parse(res.text);
content.data.forEach(repo=>{
if (!repo.name.match(/^(.*).git.adb.sh/)) return; //matches domain?
let namePattern = new RegExp(`^(.*.)|()${repo.owner.username}.${giteaHost}`);
if (!repo.name.match(namePattern)) return; //matches owner?
console.log(`found => ${repo.owner.username}.${giteaHost}`)
});
}).catch(console.error);
},1000);