MCPcopy Create free account
hub / github.com/Semporia/Scripts / nobyda

Function nobyda

JD_DailyBonus.js:1728–1964  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1726
1727// Modified from yichahucha
1728function nobyda() {
1729 const start = Date.now()
1730 const isRequest = typeof $request != "undefined"
1731 const isSurge = typeof $httpClient != "undefined"
1732 const isQuanX = typeof $task != "undefined"
1733 const isLoon = typeof $loon != "undefined"
1734 const isJSBox = typeof $app != "undefined" && typeof $http != "undefined"
1735 const isNode = typeof require == "function" && !isJSBox;
1736 const NodeSet = 'CookieSet.json'
1737 const node = (() => {
1738 if (isNode) {
1739 const request = require('request');
1740 const fs = require("fs");
1741 const path = require("path");
1742 return ({
1743 request,
1744 fs,
1745 path
1746 })
1747 } else {
1748 return (null)
1749 }
1750 })()
1751 const notify = (title, subtitle, message, rawopts) => {
1752 const Opts = (rawopts) => { //Modified from https://github.com/chavyleung/scripts/blob/master/Env.js
1753 if (!rawopts) return rawopts
1754 if (typeof rawopts === 'string') {
1755 if (isLoon) return rawopts
1756 else if (isQuanX) return {
1757 'open-url': rawopts
1758 }
1759 else if (isSurge) return {
1760 url: rawopts
1761 }
1762 else return undefined
1763 } else if (typeof rawopts === 'object') {
1764 if (isLoon) {
1765 let openUrl = rawopts.openUrl || rawopts.url || rawopts['open-url']
1766 let mediaUrl = rawopts.mediaUrl || rawopts['media-url']
1767 return {
1768 openUrl,
1769 mediaUrl
1770 }
1771 } else if (isQuanX) {
1772 let openUrl = rawopts['open-url'] || rawopts.url || rawopts.openUrl
1773 let mediaUrl = rawopts['media-url'] || rawopts.mediaUrl
1774 return {
1775 'open-url': openUrl,
1776 'media-url': mediaUrl
1777 }
1778 } else if (isSurge) {
1779 let openUrl = rawopts.url || rawopts.openUrl || rawopts['open-url']
1780 return {
1781 url: openUrl
1782 }
1783 }
1784 } else {
1785 return undefined

Callers 1

JD_DailyBonus.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected