Displaying translators as twitter photos

This commit is contained in:
softsimon 2022-01-15 04:19:50 +04:00
parent 85f471ad08
commit debcd1808e
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7
2 changed files with 14 additions and 3 deletions

View File

@ -229,6 +229,16 @@ class Server {
res.status(500).end();
}
})
.get(config.MEMPOOL.API_URL_PREFIX + 'translators/images/:id', async (req, res) => {
try {
const response = await axios.get('https://mempool.space/api/v1/translators/images/' + req.params.id, {
responseType: 'stream', timeout: 10000
});
response.data.pipe(res);
} catch (e) {
res.status(500).end();
}
})
;
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {

View File

@ -165,16 +165,17 @@
</div>
<ng-container *ngIf="translators$ | async | keyvalue as translators else loadingSponsors">
<div class="maintainers">
<div class="community-sponsor">
<h3 i18n="about.translators">Translators</h3>
<div class="wrapper">
<ng-template ngFor let-translator [ngForOf]="translators">
<a [href]="'https://twitter.com/' + translator.value" target="_blank" [title]="translator.key">
<span>{{ translator.value }}</span>
</a>,
<img class="image" [src]="'/api/v1/translators/images/' + translator.value" />
</a>
</ng-template>
</div>
</div>
<br>
</ng-container>
<ng-container *ngIf="allContributors$ | async as contributors else loadingSponsors">