utils#exitIfMaintenance TypeScript Examples
The following examples show how to use
utils#exitIfMaintenance.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.ts From exevo-pan with The Unlicense | 6 votes |
auctionBlocks(content: string): AuctionBlock[] {
const $ = cheerio.load(content)
exitIfMaintenance(() => this.maintenanceCheck(content))
const auctionBlocks = $('.Auction')
const auctions: AuctionBlock[] = []
auctionBlocks.each((_, element) => {
auctions.push({
id: this.id(element),
hasBeenBidded: this.hasBeenBidded(element),
currentBid: this.currentBid(element),
})
})
return auctions
}
Example #2
Source File: index.ts From exevo-pan with The Unlicense | 6 votes |
async partialCharacterObject(
content: CheerioAPI | string,
): Promise<PartialCharacterObject> {
const $ = loadCheerio(content)
exitIfMaintenance(() => this.maintenanceCheck($))
return {
id: this.id($),
nickname: this.nickname($),
auctionEnd: this.auctionEnd($),
currentBid: this.currentBid($),
hasBeenBidded: this.hasBeenBidded($),
outfitId: this.outfitId($),
serverId: this.serverId($),
vocationId: this.vocationId($),
sex: this.sex($),
level: this.level($),
achievementPoints: this.achievementPoints($),
skills: this.skills($),
items: this.items($),
charms: this.charms($),
transfer: this.transfer($),
imbuements: this.imbuements($),
quests: this.quests($),
...(await getPagedData($)),
rareAchievements: this.rareAchievements($),
hirelings: this.hirelings($),
huntingSlot: this.huntingSlot($),
preySlot: this.preySlot($),
charmInfo: {
...this.allCharmPoints($),
expansion: this.charmExpansion($),
},
}
}
Example #3
Source File: index.ts From exevo-pan with The Unlicense | 6 votes |
async checkHistoryAuction(content: string): Promise<HistoryCheck> {
const $ = cheerio.load(content)
exitIfMaintenance(() => this.maintenanceCheck($))
if (this.errorCheck($)) {
return {
result: 'NOT_FOUND',
data: null,
}
}
if (!this.isFinished($)) {
return {
result: 'NOT_FINISHED',
data: {
id: this.id($),
auctionEnd: this.auctionEnd($),
},
}
}
return {
result: 'IS_FINISHED',
data: await this.partialCharacterObject($),
}
}
Example #4
Source File: index.ts From exevo-pan with The Unlicense | 6 votes |
async checkRawAuction(content: string): Promise<RawCheck> {
const $ = cheerio.load(content)
exitIfMaintenance(() => this.maintenanceCheck($))
if (this.errorCheck($)) {
return {
result: 'NOT_FOUND',
data: null,
}
}
if (!this.isFinished($)) {
return {
result: 'NOT_FINISHED',
data: {
id: this.id($),
auctionEnd: this.auctionEnd($),
},
}
}
return {
result: 'IS_FINISHED',
data: await this.getPageableData(content),
}
}
Example #5
Source File: index.ts From exevo-pan with The Unlicense | 6 votes |
servers(content: string): PartialServerObject[] {
exitIfMaintenance(() => this.maintenanceCheck(content))
const $ = cheerio.load(content)
const serverElements = $('.Odd, .Even')
const serverArray: PartialServerObject[] = []
serverElements.each((_, element) => {
serverArray.push({
serverName: this.name(element),
serverLocation: this.location(element),
pvpType: this.pvpType(element),
battleye: this.battleye(element),
experimental: this.experimental(element),
})
})
return serverArray
}