wikipedia api #3

This commit is contained in:
mProjectsCode 2022-05-18 20:05:45 +02:00
parent 912418d3cf
commit 7ba91c2a2f
4 changed files with 259 additions and 0 deletions

33
src/models/WikiModel.ts Normal file
View file

@ -0,0 +1,33 @@
import {MediaTypeModel} from './MediaTypeModel';
import {stringifyYaml} from 'obsidian';
export class WikiModel extends MediaTypeModel {
type: string;
title: string;
englishTitle: string;
year: string;
dataSource: string;
url: string;
id: string;
wikiUrl: string;
lastUpdated: string;
length: number;
constructor(obj: any = {}) {
super();
Object.assign(this, obj);
}
toMetaData(): string {
return stringifyYaml(this);
}
getFileName(): string {
return this.title;
}
}