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

Function getAuthorShareCode

jd_zoo.js:873–909  ·  view source on GitHub ↗
(url = "http://cdn.annnibb.me/eb6fdc36b281b7d5eabf33396c2683a2.json")

Source from the content-addressed store, hash-verified

871 return shuffled.slice(min);
872}
873function getAuthorShareCode(url = "http://cdn.annnibb.me/eb6fdc36b281b7d5eabf33396c2683a2.json") {
874 return new Promise(async resolve => {
875 const options = {
876 "url": `${url}?${new Date()}`,
877 "timeout": 10000,
878 "headers": {
879 "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88"
880 }
881 };
882 if ($.isNode() && process.env.TG_PROXY_HOST && process.env.TG_PROXY_PORT) {
883 const tunnel = require("tunnel");
884 const agent = {
885 https: tunnel.httpsOverHttp({
886 proxy: {
887 host: process.env.TG_PROXY_HOST,
888 port: process.env.TG_PROXY_PORT * 1
889 }
890 })
891 }
892 Object.assign(options, { agent })
893 }
894 $.get(options, async (err, resp, data) => {
895 try {
896 if (err) {
897 } else {
898 if (data) data = JSON.parse(data)
899 }
900 } catch (e) {
901 // $.logErr(e, resp)
902 } finally {
903 resolve(data || []);
904 }
905 })
906 await $.wait(10000)
907 resolve();
908 })
909}
910
911function TotalBean() {
912 return new Promise(async resolve => {

Callers 1

jd_zoo.jsFile · 0.70

Calls 3

isNodeMethod · 0.45
getMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected