Parsing and running
This commit is contained in:
53
main.ts
53
main.ts
@@ -23,26 +23,39 @@ async function getWorkshopVideos(bot: Mwn): Promise<string[]> {
|
||||
console.dir(await bot.parseTitle(files[0]))
|
||||
}
|
||||
|
||||
|
||||
async function main() {
|
||||
const bot = new Mwn({
|
||||
apiUrl: 'https://dancing.thasky.one/api.php',
|
||||
username: process.env.BOTNAME,
|
||||
|
||||
password: process.env.BOTPW,
|
||||
|
||||
userAgent: 'mwn bot',
|
||||
|
||||
});
|
||||
|
||||
try {
|
||||
await bot.login();
|
||||
const relevantFiles = await getWorkshopVideos(bot)
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
} finally {
|
||||
await bot.logout();
|
||||
}
|
||||
interface VideoDescription {
|
||||
teachers: string[]
|
||||
location: string
|
||||
level: string
|
||||
date: string
|
||||
patterns: string
|
||||
notes: string
|
||||
}
|
||||
|
||||
function parseSummary(description: string): VideoDescription {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function main() {
|
||||
const bot = new Mwn({
|
||||
apiUrl: 'https://dancing.thasky.one/api.php',
|
||||
username: process.env.BOTNAME,
|
||||
|
||||
password: process.env.BOTPW,
|
||||
|
||||
userAgent: 'mwn bot',
|
||||
|
||||
});
|
||||
|
||||
try {
|
||||
await bot.login();
|
||||
const relevantFiles = await getWorkshopVideos(bot)
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
} finally {
|
||||
await bot.logout();
|
||||
}
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
Reference in New Issue
Block a user