Compare commits

...

41 Commits

Author SHA1 Message Date
martbost b97a4db7ec Stack POL Pro: the member's LinkSpin Video Spin on their page ('Watch @user's videos', up to three Social Tube posters, every tap opens the spin link); Video Spins no longer listed among the plain spin links; My Stack POL says which Video Spin shows or how to make a first video (Marty 2026-11-23)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 07:38:30 -06:00
martbost 57d04c97dc Blog: Video App Income launch article (a complete business on your phone, first video free; Marty approved the copy 2026-11-21)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-21 06:21:58 -06:00
martbost f028a61d78 Chatbot: Stack POL Pro (what it gives, the one $10+ package from 2026-11-09 that unlocks it) and My Stack POL sign-in; it told a member Pro does not exist (Clinton 2026-11-20); KNOWLEDGE_DATE 2026-11-20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 17:07:49 -06:00
martbost a8df9686ae Stack POL: Video App Income program (live 2026-11-20, standing rule): programs.js 'vai' (/earn/video-app-income, direct join link with the network username), card image vai.jpg, netsites list, layout ref swap for videoappincome.com, indexer vai_rows (VideoAppIncome Paid events: sponsor 30% + five matrix levels 8%, position wallets looked up on chain; company shares not read, cache vai-chain.json)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-20 15:48:03 -06:00
martbost 856dbcb8d3 Sign-in: InstantAdPay as the fallback when the hub has no sign-in for the browser (from: { iap }, NETWORK_SSO_SECRET set), so "Sign in with your network account" no longer bounces straight back to /my (Marty 2026-11-20)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:31:18 -06:00
martbost 1987823e4b Dockerfile: copy networksso.js, my.js, iapswitch.js (the My Stack POL deploy crashed on MODULE_NOT_FOUND and Coolify rolled back)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:27:58 -06:00
martbost ffa0d74c70 My Stack POL: network sign-in through the hub + signed-in member area at /my (Marty approved 2026-11-19)
- networksso.js (shared file, same copy as IAP/LinkSpin/YPB): hub-only sign-in (HUB_SSO=on), silent check on /my, sign-out
- my.js: signed session cookie (keyed off HUB_SECRET), sign-outs in the my-signouts.json MySQL document; /my shows the page
  link + on/off, Pro, join links per program, share kit, own payout rows with Polygonscan links and totals from the ledger
- iapswitch.js: the page switch stays in IAP's stack-optin.json; Stack POL calls IAP POST /api/partner/stackpol/switch
  (signed, STACKPOL_SWITCH_KEY; spec in the file). Until IAP has it, /my links to IAP Promo tools
- tools/indexer.py: snapshot gains `my` (every paid member's rows, wallets, page flag, IAP switches, Pro list); public data unchanged
- header Sign in / My Stack POL entry; robots keeps /my and /sso/ out
- qa/my.test.mjs: 66 checks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 06:57:11 -06:00
martbost 9bc6e84f2d Public /network page (alias /how-it-works): the one-page 'How the Crypto Team Build Network Works' explainer, shareable (Marty 2026-11-17); in the sitemap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:58:33 -06:00
martbost cb2e090782 Stack POL: YourProgramBuilder program (live 2026-11-17, standing rule): programs.js 'ypb' (/earn/yourprogrambuilder, join via LinkSpin nwypb src=stackpol), card image ypb.jpg (YPB og image), netsites list, layout ref swap for yourprogrambuilder.com, indexer YPBShop rows (Paid kind 1-5 + Claimed; company/keeper excluded, cache ypb-chain.json)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:37:28 -06:00
martbost edaf7bb979 Network link nwypb: YourProgramBuilder as its own tracked network link (netsites CODES), the nwvas pattern (YourProgramBuilder go-live, Marty GO 2026-11-17)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:31:36 -06:00
martbost 42b4e2edc0 Guides across the network (Marty 2026-11-17): each rebuilt program's evergreen Guides section linked from its /earn page and in a short block on the blog index (page 1); programs.js gets a guides URL for DLB, VBB, VAB, VAS, 5x, DH and PolHunter
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:42:37 -06:00
martbost cbefb29863 Terms, Privacy and Earnings disclaimer pages + footer links + sitemap (network tidy-up 2026-11-17, TrustClickz, no street address)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 08:12:01 -06:00
martbost b49206f642 Dockerfile: ship netdeals.js (the Network Weekend ribbon feed answered 500 without it)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:33:46 -06:00
martbost fadcfaa7bf netdeals.js: the first ask after a boot waits for the hub once (shared copy, Network Weekend 2026-11-17)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:31:34 -06:00
martbost 18e9c5d56a Network Weekend (Marty 2026-11-17): ribbon + date-gated chatbot fact (any IAP $10+ pack unlocks Stack POL Pro)
netdeals.js + /assets/netweekend.js (/api/network-deals from the hub), loaded on every page by layout.js. FACTS line live
Fri 11-27 00:00 CT to Tue 12-01 00:00 CT (WEEKEND_NOW test clock).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 07:26:58 -06:00
martbost 00cb51f2b4 Stack POL: ViralAdSource program (live 2026-11-17, standing rule): programs.js 'vas' (/earn/viraladsource, join via LinkSpin nwvas src=stackpol), card image vas.jpg (VAS og image), netsites list + CODES nwvas, layout ref swap for viraladsource.com, indexer VASShop rows (Paid kind 1-6 incl. 20% resharer cut, RewardPaid pot rewards unless the push failed, Claimed; company/keeper/relay excluded, cache vas-chain.json)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 06:11:33 -06:00
martbost b64c4cf72f netsites: ViralAdSource tracked link code nwvas (LinkSpin /r/nwvas, Marty 2026-11-17 go-live)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 05:59:17 -06:00
martbost 213ee3a32b Remove street mailing address from public pages (Marty 2026-11-16)
Pages, footers and the site assistant now name only TrustClickz; the footer
reads "(c) 2026 TrustClickz". Contact stays the network support link.
QA checks updated to assert no street address is shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 10:46:30 -06:00
martbost 04ded6822c Smarter chatbot matching by meaning (Marty 2026-11-16): the hub's semantic match (free core2 embeddings)
chatcore.js + netkb.js (route): a hand-off pattern still answers first; then the hub's POST /v1/kb/match answers with this
site's entry when it is sure, keeps or overrules the CANNED regex hit, and picks the AI prompt context, this site's own entries
first. 1.5 s timeout, then the hub is skipped for 30 s and the old pattern + BM25 path answers (NETKB_MATCH=0 = off).
netkb.js also has suggest() for the support desk (used by InstantAdPay and LinkSpin). Same chatcore.js in the six rebuilt
sites, same netkb.js in all eight. Test: node qa/netkb-semantic.test.mjs (decisions, fail soft, shared-file parity).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 05:37:03 -06:00
martbost 96d6281e3e Stack POL data in MySQL (Marty 2026-11-16: payout totals wiped on every deploy)
The indexer snapshot (was /tmp/stack-index.json) and the chatbot KB (was memory)
are now MySQL documents via docstore.js (DOCSTORE_URL, Coolify stackpol-mysql),
loaded before the server listens so a deploy shows the last totals at once.
Snapshot split into stack-index.json + stack-index-at.json so a push with no new
payouts rewrites only the tiny doc (docstore skips unchanged bodies). Ingest API
unchanged. Tested on core: restart keeps totals, /programs, /earn, member pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 04:46:28 -06:00
martbost b6e020e025 Chat widget would not close (Marty 2026-11-15): #scPanel's display:flex beat the hidden attribute and Stack POL has no global [hidden] rule; add #scPanel[hidden]{display:none}. chat.css?v=20261115e, chat.js?v=hide1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:57:26 -06:00
martbost 7446df2f4f Site assistant (Marty 2026-11-15): chat widget in the Stack POL look on every page, CANNED + FACTS from this repo (the on-page FAQ, programs.js, the 5-minute indexer, opt-in member pages, holds nothing, no income promise), retrieval over the shared network knowledge base on the hub (netkb.js as hub site stackpol; another site named = its answer, with its tracked LinkSpin link), reasoning off, account problems hand off to network support. Static server now serves .js/.css; Dockerfile copies the chat modules. chatbot.test 125 pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:11:04 -06:00
martbost 3a6ac0a81e Stack POL: DownlineHydra program (standing rule: every rebuilt network site joins Stack POL when it goes live): programs.js dh /earn/downlinehydra (join via LinkSpin nwdh), netsites downlinehydra nwdh, layout ref swap for downlinehydra.com, indexer HydraPro Paid level 1-5 + Claimed (dh-chain.json; house = contract, Tangem, keeper), img dh.jpg. Dry scan OK (0 logs). LOCAL, push at the downlinehydra.com go-live after LinkSpin has nwdh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:58:55 -06:00
martbost ab07ffebe2 Stack POL: 5xYourTeam program (standing rule: every rebuilt network site joins Stack POL when it goes live). LOCAL, push at the 5xyourteam.com go-live
- programs.js: 'fx' entry (slug 5xyourteam, gold #ffc93c, Team draft), join via the LinkSpin network link nw5x?src=stackpol&s1=<member>; facts from the 5x app and DraftPosition only
- netsites.js: fivex in the fallback list, CODES fivex: nw5x
- layout.js: Pro personalization swaps ?ref=martbost on 5xyourteam.com links
- tools/indexer.py: vab_rows generalized (k, shop, start, house, cache); 5x member payouts read-only from DraftPosition 0x83Bb...bc74 (Paid level 1-5 + Claimed, from block 97363529, cache fx-chain.json); company, keeper, contract and the Best Coach pot wallet excluded
- public/img/fx.jpg: the 5x og image, 800x420

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:50:44 -06:00
martbost 793354ea80 Footer network links carry the referral (Marty 2026-11-15): on a page opened with ?ref=<Pro member> (and the member's own /<who> page), personalize() gives every LinkSpin network link that has no member yet s1=<who> (LinkSpin sends it on as ?ref=); Earners Corner (nwec) takes none. Stack POL has no sign-in or ref cookie, so the ?ref= that personalize already carries page to page is the referral. Same rule as VBB 6798503.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:05:53 -06:00
martbost 0805c1bcb4 Stack POL: ViralAdBlitz program (Marty 2026-11-15 standing rule: every rebuilt network site joins Stack POL when it goes live)
- programs.js: 'vab' entry (slug viraladblitz, royal blue #0a2fa8, Viral text ads), join via the LinkSpin network link nwvab?src=stackpol&s1=<member>; facts from the VAB app and VABShop contract only
- /earn/viraladblitz + sitemap entry (automatic from the registry); card image public/img/vab.jpg (VAB og image, 800x420)
- netsites.js: same file as ViralAdBlitz (CODES viraladblitz: nwvab, fallback list entry)
- layout.js: Pro personalization also swaps ?ref=martbost on viraladblitz.com links
- tools/indexer.py: VAB member payouts read-only from Polygon (VABShop Paid level 1-5 + Claimed, eth_getLogs from deploy block 97324419, cache vab-chain.json); level 0 (company), contract, company and keeper wallets excluded. Dry run on core: scanned to head, 0 logs (no Boost sold yet)
- README: sources

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:04:37 -06:00
martbost 349fa79643 Stack POL: Viral Banner Blitz program (Marty 2026-11-15 standing rule: every rebuilt network site joins Stack POL when it goes live)
- programs.js: 'vbb' entry (slug viral-banner-blitz, pop-art pink #ff2d87, Banner loop), join via the LinkSpin network link nwvbb?src=stackpol&s1=<member>; facts from the VBB app and VBBShop contract only
- /earn/viral-banner-blitz + sitemap entry (automatic from the registry); card image public/img/vbb.jpg (VBB og image, 800x420); also adds the missing public/img/dlb.jpg (DLB card image was a 404)
- server.js: per-program button verb (Join for the banner sites, not Play) and WebApplication JSON-LD for them; home description no longer calls every program a game
- layout.js: Pro personalization also swaps s1=martbost on LinkSpin network links and ?ref=martbost on downlinebanners.com / viralbannerblitz.com links
- tools/indexer.py: VBB member payouts read-only from Polygon (VBBShop Paid role 0 sponsor shares + Claimed, eth_getLogs from the deploy block, cache vbb-chain.json) plus weekly prize transfers from VBB prizes.json, each checked on chain (from the prize wallet, to the winner, succeeded); contract, prize, company and keeper wallets excluded. Decoder checked against the Downline Banners contract (same Paid signature): 70 logs, role-0 total matches its chain index exactly
- README: sources + the standing rule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 07:49:59 -06:00
martbost 1735748ee6 Tracked network links (Marty 2026-11-14: "make sure each of these sites is its own traffic source and link spun so we can track it"): the footer's Part of the network links go through the LinkSpin network link for each site with ?src=stackpol (linkspin.app/r/<code>, rel nofollow), so LinkSpin Reports show Stack POL as the source. netsites.js gains tracked() + go on /api/network-sites (same file in all five sites). Footer render checked locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 11:38:03 -06:00
martbost 275a5a48bc Dockerfile copies netsites.js (the 6cc1c6d deploy rolled back on MODULE_NOT_FOUND)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 10:14:15 -06:00
martbost 6cc1c6d366 Footer: 'Part of the network' column from the network hub (netsites.js: GET HUB_URL/v1/network-sites, 10 min cache, built-in fallback; Stack POL marked as current), company line TrustClickz, 615 Green Valley Drive, Moody, AL 35004, Support link; All games moves to Explore (never in the network list). Marty 2026-11-14 trust pack
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 10:12:59 -06:00
martbost 8bde289c39 Stack POL: Downline Banners program (member payouts = contract Paid events to sponsors and line spots, company + fund excluded); indexer reads LinkSpin/InstantAdPay data from MySQL (docstore docs table, via each app's DOCSTORE_URL) since those files moved there 2026-11-13: LinkSpin accounts, Banner Spins, spin links and InstantAdPay stack-optin (switch-offs + Pro)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 10:37:52 -06:00
martbost 3d74fa8195 PolHunter embed on every Stack POL page (mission: find your code on one of the program cards; silent without a hunter token)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 12:02:37 -06:00
martbost 8abd442984 Earners Corner on Stack POL (Marty 2026-11-10): program card + /earn/earners-corner (join via instantadpay.com/forum/join/<member>), indexer reads the forum reward service's /payouts over WireGuard (10.100.0.2:18950, Stack POL ingest key), attribution by wallet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:10:57 -06:00
martbost 137dc6a09a PassiveDrip on Stack POL (Marty 2026-11-10): program card (join via instantadpay.com/g/passivedrip, sponsor kept), card art in the set's style, indexer reads the PassiveDrip payout engine ledger on core (live passivedrip.com rows paid on chain only; staging tests and dry runs out; attribution by wallet).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 07:41:47 -06:00
martbost 31709ff051 Indexer: docker exec never reads the caller's stdin (it swallowed a remote script's remaining lines)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:43:22 -06:00
martbost 5b0ef24378 Indexer: every paid member gets a page by default; an explicit switch-off in IAP hides it (Marty 2026-11-09)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:41:24 -06:00
martbost 05f3514b9e Stack POL Pro pages (Marty 2026-11-09): a Pro member's page shows their own LinkSpin Banner Spins in the ad spots (a spot with no fitting size keeps the network zone), their spin links, a purple Polygon QR to the page (/qr/<username>.svg, qrcode module) and a "Want a personalized page like this?" panel (join under the member, or Unlock Pro in IAP). Every page opened with ?ref=<Pro member> credits them on every call to action (join links, game links, program pages, internal links carry the ref) and shows their banners; no ref or a non-Pro ref = the standard network pages and zones. Blog posts now carry an ad spot after the third paragraph, and personalized posts end with the member's links and the Pro panel. Member pages also get a network spot and the latest blog posts. Indexer reads pro[] from IAP stack-optin.json and adds each Pro member's active spins and spin links (matched by username in LinkSpin).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 15:31:39 -06:00
martbost e53565051b Ledger shows each payout's username (Marty 2026-11-09), linked only when the member has a Stack POL page; LinkSpin zone spots on the blog index, posts and ledger (one zone per screen size, the hidden size never loads)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:32:34 -06:00
martbost ad546660b9 Stack POL v1: live network totals, program pages, public ledger, opt-in member stacks, blog on the IAP/LinkSpin engine, full SEO (sitemap, robots, canonical, OG/Twitter, JSON-LD), branded share image; indexer on core pushes a snapshot every 5 min
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:14:16 -06:00
martbost 3f8ac7dfbb Mockup: LinkSpin card (pays the sponsor line in POL in the same transaction)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:49:40 -06:00
martbost 443d7789b3 Mockup: every network game in the stack (SpellWheel, ClutterHunt, Road Agent, PolyBreak, POL Miner, PolyWarriors) and Turkey Drop as the seasonal feature (Spooky Doors ended Oct 31)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:48:39 -06:00
108 changed files with 5902 additions and 81 deletions
+1
View File
@@ -0,0 +1 @@
node_modules
+2
View File
@@ -0,0 +1,2 @@
node_modules/
data/
+10 -2
View File
@@ -1,3 +1,11 @@
FROM nginx:1.27-alpine FROM node:20-alpine
COPY public/ /usr/share/nginx/html/ WORKDIR /app
COPY package.json package-lock.json server.js layout.js blog.js programs.js netsites.js netdeals.js chatbot.js chatcore.js kb.js netkb.js docstore.js legal.js networksso.js my.js iapswitch.js ./
RUN npm ci --omit=dev --no-audit --no-fund
COPY content/ ./content/
COPY public/ ./public/
ENV NODE_ENV=production PORT=80 DATA_DIR=/app/data
RUN mkdir -p /app/data
EXPOSE 80 EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s CMD wget -qO- http://127.0.0.1/health || exit 1
CMD ["node", "server.js"]
+11 -1
View File
@@ -1,3 +1,13 @@
# Stack POL # Stack POL
stackpol.com: a member's bag of POL from every network property, as a show-off and referral page. Placeholder (coming soon) since 2026-10-01; the real app replaces it in the same Coolify slot. stackpol.com: every POL payout across the network, stacked. Live app since 2026-11-09 (replaced the Oct 1 placeholder in the same Coolify slot k6p591wzomylttvsva3e6w7i).
- server.js (Node 20, no dependencies): home with live network totals, /programs, /earn/<slug> per program, /ledger (?p=<key>), opt-in member stacks at /<username>, /blog (+ /blog/<slug>, /blog/tag/<t>, /blog/feed.xml), /sitemap.xml, /robots.txt, /api/totals. Full SEO head on every page (layout.js): canonical, robots, Open Graph, Twitter card, JSON-LD (WebSite, Organization, FAQPage, BlogPosting, Breadcrumb, ItemList, VideoGame/WebApplication, ProfilePage).
- Data: tools/indexer.py runs on core every 5 min (/etc/cron.d/stackpol-indexer, copy in /root/stackpol-indexer) and POSTs a snapshot to /api/ingest (Bearer STACK_INGEST_KEY, key file /root/.stackpol-ingest-key). Sources: each game's payout file, IAP + LinkSpin chain-index TierPaid events, Downline Banners chain-index Paid events (sponsor + line), Viral Banner Blitz VBBShop Paid role 0 + Claimed logs read from Polygon (scan cache /root/stackpol-indexer/vbb-chain.json) and on-chain-checked weekly prize transfers from VBB prizes.json, ViralAdBlitz VABShop Paid level 1-5 + Claimed logs (cache vab-chain.json), Earners Corner + PassiveDrip payout ledgers, wallet->username from IAP accounts/positions and LinkSpin accounts. Members are named only when opted in (/root/stackpol-indexer/optin.txt + IAP stack-optin.json).
- Blog: content/blog/<slug>.json, one file per post (title, seoTitle, excerpt, body HTML, cover, tags, publishedAt, updated, faq[]). Same engine as InstantAdPay/LinkSpin blog.js, ported to file storage. Future-dated posts stay hidden until their time. Generators in tools/write_posts_*.py.
- programs.js: program registry (keys match the indexer); game blurbs are InstantAdPay's own.
- mockup/: the Oct design mockup (artifact https://claude.ai/artifact/1mN4dCYUcbw7EHicCdejM3).
- Standing rule (Marty 2026-11-15): every rebuilt network site is added here when it goes live: a programs.js entry, its /earn/<slug> page (automatic from the entry, plus public/img/<key>.jpg 800x420) and an indexer source for its member payouts (house/company wallets excluded). ViralAdBlitz, 5xYourTeam and DownlineHydra added 2026-11-15.
- Site assistant (2026-11-15): chat widget on every page (`public/assets/chat.js` + `chat.css`, loaded from layout.js). `chatbot.js` holds what it knows (CANNED + FACTS from this repo); `chatcore.js`, `kb.js` (kb.json is a MySQL document, see Storage) and `netkb.js` (the shared network knowledge on the hub, signed as `HUB_SITE=stackpol` with `HUB_SECRET`) are the same files as the rebuilt sites. OpenRouter key: Coolify env `OPENROUTER_API_KEY`. No admin KB editing on Stack POL. Test: `node qa/chatbot.test.mjs`.
- Storage (Marty 2026-11-16: "they should live in the database"): MySQL, Coolify `stackpol-mysql` yw404lxgfkbb5n9s3pxu1hxk (db `stackpol`, binlog expiry 3 h persisted, in core's hourly dumps). App env `DOCSTORE_URL`; `docstore.js` (same file as LinkSpin, skips unchanged writes) keeps the data documents of DATA_DIR (/app/data, no volume) in table `docs`: `stack-index.json` (the last indexer snapshot minus `at`), `stack-index-at.json` ({at}), `kb.json` (chatbot entries), `netkb-cache.json` (network knowledge cache). Loaded before the server listens, so a deploy serves the last totals at once. The ingest API is unchanged. Without DOCSTORE_URL (local only) they are plain files in DATA_DIR.
- My Stack POL (Marty approved 2026-11-19): signed-in member area at /my (my.js), "Sign in" / "My Stack POL" in the header. Network sign-in through the hub only (networksso.js, the shared file, unchanged copy of IAP's): envs HUB_SSO=on, HUB_URL, HUB_SECRET, HUB_SITE=stackpol (the last three already serve netkb). Needs stackpol in the hub's HUB_SSO_SITES. Session = signed cookie sp.sid (7 days, keyed off HUB_SECRET); sign-out writes my-signouts.json (MySQL document) so older cookies stop working. Shows the page link + switch, Pro (IAP's rule via stack-optin.json pro), join links (programs.js), share kit, and the member's own payout rows from the snapshot's `my` block (tools/indexer.py). The switch stays in IAP's stack-optin.json: iapswitch.js calls IAP POST /api/partner/stackpol/switch (spec in the file header) with STACKPOL_SWITCH_KEY; until IAP has that route and both apps have the key, /my links to IAP Promo tools instead. Test: node qa/my.test.mjs.
+113
View File
@@ -0,0 +1,113 @@
// Stack POL blog (2026-11-09, Marty: "use the same engine for the blog"): InstantAdPay/LinkSpin's blog.js, ported. Same
// sanitizer, paging, tags, related posts, RSS, BlogPosting + Breadcrumb JSON-LD. Storage is the repo itself: one JSON file per
// post in content/blog/<slug>.json ({ title, slug, excerpt, body (HTML), cover, tags[], publishedAt ISO, updated ISO }), loaded at
// boot, so posts ship with a deploy and are versioned in git. A post with publishedAt in the future stays hidden until then.
'use strict';
const fs = require('fs');
const path = require('path');
const { SITE, esc, head, tail, ZONES, spot, memberLinks, proCta } = require('./layout');
const AUTHOR = 'Marty Bostick';
const PER_PAGE = 9;
const DIR = path.join(__dirname, 'content', 'blog');
const slugify = s => String(s || '').toLowerCase().replace(/['’]/g, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 80);
const words = html => String(html || '').replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim();
const readMinutes = html => Math.max(1, Math.round(words(html).split(' ').length / 220));
const fmtDate = ts => new Date(ts).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric', timeZone: 'America/Chicago' });
function sanitize(html) {
const src = String(html || '').replace(/ /g, ' ').replace(/<(script|style|iframe|object|embed|form)\b[\s\S]*?<\/\1\s*>/gi, '').replace(/<(script|style|iframe|object|embed|form|input)\b[^>]*>/gi, '').replace(/<!--[\s\S]*?-->/g, '').replace(/\son[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, '');
const ALLOW = new Set(['p', 'br', 'hr', 'h2', 'h3', 'h4', 'ul', 'ol', 'li', 'b', 'strong', 'i', 'em', 'u', 'a', 'img', 'blockquote', 'pre', 'code', 'figure', 'figcaption', 'table', 'thead', 'tbody', 'tr', 'th', 'td']);
const safeSrc = s => /^(\/img\/[a-z0-9._-]+\.(png|jpg|webp|gif)|https:\/\/[^\s"'<>]+)$/i.test(s);
return src.replace(/<\s*(\/?)\s*([a-zA-Z0-9]+)((?:[^>"']|"[^"]*"|'[^']*')*)>/g, (m, close, tag, attrs) => {
tag = tag.toLowerCase();
if (!ALLOW.has(tag)) return '';
if (close) return '</' + tag + '>';
if (tag === 'a') {
const hm = /href\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(attrs || ''); const href = (hm && (hm[1] || hm[2])) || '';
if (!/^(https?:\/\/|\/)[^\s"'<>]*$/i.test(href)) return '';
const internal = href.startsWith('/') || href.startsWith(SITE);
return '<a href="' + href.replace(/"/g, '%22') + '"' + (internal ? '' : ' target="_blank" rel="noopener"') + '>';
}
if (tag === 'img') {
const sm = /src\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(attrs || ''); const s = (sm && (sm[1] || sm[2])) || '';
const am = /alt\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(attrs || ''); const alt = (am && (am[1] || am[2])) || '';
return safeSrc(s) ? '<img src="' + s.replace(/"/g, '%22') + '" alt="' + esc(alt) + '" loading="lazy">' : '';
}
return '<' + tag + '>';
});
}
let POSTS = [];
function load() {
const out = [];
let files = []; try { files = fs.readdirSync(DIR).filter(f => f.endsWith('.json')); } catch (e) {}
for (const f of files) {
try {
const r = JSON.parse(fs.readFileSync(path.join(DIR, f), 'utf8'));
const slug = slugify(r.slug || r.title); if (!slug || !r.title) continue;
const body = sanitize(r.body);
const pub = Date.parse(r.publishedAt) || 0;
out.push({ slug, title: String(r.title).slice(0, 140), seoTitle: r.seoTitle || '', excerpt: String(r.excerpt || words(body).slice(0, 200)).slice(0, 300), body, cover: r.cover || '', coverAlt: r.coverAlt || r.title,
tags: (r.tags || []).map(t => String(t).toLowerCase()).slice(0, 8), publishedAt: pub, created: pub, updated: Date.parse(r.updated) || pub, faq: Array.isArray(r.faq) ? r.faq : [] });
} catch (e) { console.error('[blog] bad post file', f, e.message); }
}
POSTS = out.sort((a, b) => b.publishedAt - a.publishedAt);
return POSTS.length;
}
const listPublished = () => POSTS.filter(p => p.publishedAt && p.publishedAt <= Date.now());
const get = slug => listPublished().find(p => p.slug === slugify(slug)) || null;
const cardHtml = p => '<a class="post-card" href="/blog/' + esc(p.slug) + '">' + (p.cover ? '<img src="' + esc(p.cover) + '" alt="' + esc(p.coverAlt) + '" loading="lazy" width="1200" height="630">' : '')
+ '<div class="pc"><h3>' + esc(p.title) + '</h3><p>' + esc(p.excerpt) + '</p><p class="meta">' + fmtDate(p.publishedAt) + ' · ' + readMinutes(p.body) + ' min read</p></div></a>';
function renderIndex(page, tag) {
const all = tag ? listPublished().filter(p => p.tags.includes(tag)) : listPublished();
const pages = Math.max(1, Math.ceil(all.length / PER_PAGE)); page = Math.min(Math.max(1, page || 1), pages);
const slice = all.slice((page - 1) * PER_PAGE, page * PER_PAGE);
const title = (tag ? tag + ' · ' : '') + 'Stack POL Blog: Earning POL Across the Network' + (page > 1 ? ' (page ' + page + ')' : '');
const desc = 'Guides to every program that pays POL in the network, weekly payout recaps from the public ledger, and Polygon basics for earners.';
const p = tag ? '/blog/tag/' + encodeURIComponent(tag) : '/blog' + (page > 1 ? '/page/' + page : '');
let h = head({ title, desc, path: p, nav: '/blog', noindex: !!tag, jsonld: [{ '@context': 'https://schema.org', '@type': 'Blog', name: 'Stack POL Blog', url: SITE + '/blog', description: desc, publisher: { '@type': 'Organization', name: 'Stack POL', url: SITE } }] });
h += '<section style="padding:40px 0 10px"><p class="kick">' + (tag ? 'Tag: ' + esc(tag) : 'The Stack POL blog') + '</p><h1>Earning POL across the network, <span style="color:var(--gold)">one stack at a time</span></h1><p class="lead">' + esc(desc) + '</p></section>';
h += slice.length ? '<div class="posts">' + slice.map(cardHtml).join('') + '</div>' : '<p class="lead">Nothing published yet. Check back soon.</p>';
if (!tag && page === 1) { // Guides across the network (2026-11-17): each program's own evergreen Guides section
const gs = require('./programs').PROGRAMS.filter(x => x.guides);
if (gs.length) h += '<div class="sec-head"><h2>Guides across the network</h2></div><p class="lead" style="max-width:72ch">How each program works, whether it is legit (the contract, the ledger and the split) and the FAQ, each on its own site: '
+ gs.map(x => '<a href="' + esc(x.guides) + '" target="_blank" rel="noopener">' + esc(x.n) + '</a>').join(', ') + '.</p>';
}
h += spot(ZONES.banner, ZONES.strip);
if (pages > 1) h += '<div class="pager">' + (page > 1 ? '<a href="/blog' + (page - 1 > 1 ? '/page/' + (page - 1) : '') + '">&larr; Newer</a>' : '<span></span>') + (page < pages ? '<a href="/blog/page/' + (page + 1) + '">Older &rarr;</a>' : '<span></span>') + '</div>';
return h + tail();
}
function related(p) {
return listPublished().filter(x => x.slug !== p.slug).map(x => ({ x, s: x.tags.filter(t => p.tags.includes(t)).length })).sort((a, b) => b.s - a.s || b.x.publishedAt - a.x.publishedAt).slice(0, 3).map(r => r.x);
}
function renderPost(p, pc) {
const url = SITE + '/blog/' + p.slug;
const ld = [{ '@context': 'https://schema.org', '@type': 'BlogPosting', headline: p.title, description: p.excerpt, image: p.cover ? (p.cover.startsWith('http') ? p.cover : SITE + p.cover) : SITE + '/og-stackpol-1200x630.jpg',
datePublished: new Date(p.publishedAt).toISOString(), dateModified: new Date(p.updated).toISOString(), wordCount: words(p.body).split(' ').length, keywords: p.tags.join(', '),
author: { '@type': 'Person', name: AUTHOR, url: SITE + '/blog' }, publisher: { '@type': 'Organization', name: 'Stack POL', url: SITE, logo: { '@type': 'ImageObject', url: SITE + '/apple-touch-icon.png' } }, mainEntityOfPage: { '@type': 'WebPage', '@id': url } },
{ '@context': 'https://schema.org', '@type': 'BreadcrumbList', itemListElement: [{ '@type': 'ListItem', position: 1, name: 'Stack POL', item: SITE + '/' }, { '@type': 'ListItem', position: 2, name: 'Blog', item: SITE + '/blog' }, { '@type': 'ListItem', position: 3, name: p.title, item: url }] }];
if (p.faq.length) ld.push({ '@context': 'https://schema.org', '@type': 'FAQPage', mainEntity: p.faq.map(q => ({ '@type': 'Question', name: q.q, acceptedAnswer: { '@type': 'Answer', text: q.a } })) });
let h = head({ title: (p.seoTitle || p.title) + ' | Stack POL', ogTitle: p.title, desc: p.excerpt, path: '/blog/' + p.slug, image: p.cover, imageAlt: p.coverAlt, type: 'article', article: p, nav: '/blog', jsonld: ld });
h += '<div class="bl"><p class="crumb"><a href="/">Stack POL</a> / <a href="/blog">Blog</a>' + (p.tags[0] ? ' / <a href="/blog/tag/' + encodeURIComponent(p.tags[0]) + '">' + esc(p.tags[0]) + '</a>' : '') + '</p>';
h += '<h1>' + esc(p.title) + '</h1><p class="meta">By ' + AUTHOR + ' · ' + fmtDate(p.publishedAt) + (p.updated > p.publishedAt + 864e5 ? ' · updated ' + fmtDate(p.updated) : '') + ' · ' + readMinutes(p.body) + ' min read</p>';
if (p.cover) h += '<img class="cover" src="' + esc(p.cover) + '" alt="' + esc(p.coverAlt) + '" width="1200" height="630">';
// an ad spot inside the article (Marty 2026-11-09): after the third paragraph of a long post; a Pro member's banner when personalized
let body = p.body; const paras = body.split('</p>'); if (paras.length > 6) body = paras.slice(0, 3).join('</p>') + '</p>' + spot(ZONES.blogBox, ZONES.strip) + paras.slice(3).join('</p>');
h += '<article>' + body;
if (p.faq.length) h += '<h2>Questions people ask</h2>' + p.faq.map(q => '<h3>' + esc(q.q) + '</h3><p>' + esc(q.a) + '</p>').join('');
h += '</article>' + (pc && pc.st.pro ? memberLinks(pc.who, pc.st) : '') + spot(ZONES.blogBox, ZONES.blogBox) + (pc && pc.st.pro ? proCta(pc.who) : '');
if (p.tags.length) h += '<p class="tags" style="margin-top:22px">' + p.tags.map(t => '<a href="/blog/tag/' + encodeURIComponent(t) + '">' + esc(t) + '</a>').join('') + '</p>';
h += '<p class="share" style="margin-top:18px"><a href="https://x.com/intent/tweet?url=' + encodeURIComponent(url) + '&text=' + encodeURIComponent(p.title) + '" target="_blank" rel="noopener">Share on X</a><a href="https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(url) + '" target="_blank" rel="noopener">Share on Facebook</a><a href="https://t.me/share/url?url=' + encodeURIComponent(url) + '&text=' + encodeURIComponent(p.title) + '" target="_blank" rel="noopener">Telegram</a></p>';
h += '<div class="author"><span class="av">M</span><div><b>' + AUTHOR + '</b><span>Founder of InstantAdPay, LinkSpin and the Crypto Team Build Network. Twenty-plus years of internet marketing, and a habit of writing down what actually worked.</span></div></div>';
const rel = related(p); if (rel.length) h += '<div style="margin-top:40px"><h2 style="margin-bottom:14px">Keep reading</h2><div class="posts">' + rel.map(cardHtml).join('') + '</div></div>';
h += '<p class="disc">Stack POL shows payouts from programs in the network. Nothing here is investment advice, no income is guaranteed, and cryptocurrency involves risk of loss.</p></div>';
return h + tail();
}
function rss() {
const items = listPublished().slice(0, 30).map(p => '<item><title>' + esc(p.title) + '</title><link>' + SITE + '/blog/' + p.slug + '</link><guid isPermaLink="true">' + SITE + '/blog/' + p.slug + '</guid><pubDate>' + new Date(p.publishedAt).toUTCString() + '</pubDate><description>' + esc(p.excerpt) + '</description></item>').join('');
return '<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Stack POL Blog</title><link>' + SITE + '/blog</link><description>Guides to every program that pays POL in the network, payout recaps and Polygon basics.</description><language>en-us</language>' + items + '</channel></rss>';
}
module.exports = { load, listPublished, get, renderIndex, renderPost, rss, cardHtml, fmtDate, readMinutes };
+89
View File
@@ -0,0 +1,89 @@
// Stack POL's site assistant (Marty 2026-11-15): what it knows. The engine is chatcore.js (the same on every rebuilt site);
// retrieval also covers the other network sites through the hub (netkb.js), this site's entries first.
// Storage (2026-11-16): kb.json and netkb-cache.json are MySQL documents through docstore.js (DOCSTORE_URL, stackpol-mysql), so
// the entries and the cached network set survive a deploy. The OpenRouter key comes from the OPENROUTER_API_KEY env (a Coolify
// secret). No admin knowledge-base editing here.
//
// Every fact below was checked against this repo on KNOWLEDGE_DATE: server.js (the on-page FAQ, the pages, /api/totals, member
// stacks only when switched on), programs.js (the programs and their kinds), README.md (the indexer refreshes every 5 minutes;
// members are named only when opted in). Stack POL sells nothing and holds nothing.
// HOUSE RULE: when a feature changes, update CANNED and FACTS in the same commit and bump KNOWLEDGE_DATE.
// Plain words, no em dashes, never a promise of income, never quote totals as what someone will earn, never RM Circle.
'use strict';
const core = require('./chatcore');
const { PROGRAMS } = require('./programs');
const KNOWLEDGE_DATE = '2026-11-20';
// Network Weekend (Black Friday to Cyber Monday 2026): live Fri 11-27 00:00 CT to Tue 12-01 00:00 CT (CST = UTC-6); WEEKEND_NOW = test clock
const NW_START = Date.parse('2026-11-27T06:00:00Z'), NW_END = Date.parse('2026-12-01T06:00:00Z');
const nwNow = () => { const t = process.env.WEEKEND_NOW ? Date.parse(process.env.WEEKEND_NOW) : NaN; return Number.isNaN(t) ? Date.now() : t; };
const nwLive = () => { const t = nwNow(); return t >= NW_START && t < NW_END; };
const URL_ = String(process.env.SITE_URL || 'https://stackpol.com').replace(/\/+$/, '');
const SUPPORT = 'https://instantadpay.com/support';
const NAMES = PROGRAMS.map(p => p.n).join(', ');
const NOT_INCOME = 'No promise of income is made: the totals are what the whole network has paid so far, and many members earn little or nothing.';
const CANNED = [
{ id: 'support', title: 'Talk to a person, or a problem with my account', q: ['How do I contact support?', 'My payout is not on the ledger', 'I need a real person'], tags: ['support', 'help', 'ticket', 'problem'],
re: core.SUPPORT_RE, handoff: true,
a: 'Network support handles every network site: open ' + SUPPORT + ', say which program it is about, and include your username, your wallet address and the transaction link if you have one. Marty answers there and by email. Tap "Open network support" below and your question goes with you.' },
{ id: 'pro', title: 'Stack POL Pro: what it gives and how it unlocks', q: ['What is Stack POL Pro?', 'What does Pro give me?', 'Why does my Pro say Not yet?'], tags: ['pro', 'stack pol pro', 'banners', 'qr code', 'unlock'],
re: /(pro|pro member|premium|upgrade|not yet)/i,
a: 'Stack POL Pro puts your own LinkSpin Banner Spins in the ad spots on your Stack POL page, adds your spin links, and shows your QR code; any Stack POL page opened with ?ref=your-username carries your referral. It unlocks once, for good, with an InstantAdPay ad package of $10 or more bought on or after November 9, 2026, when Pro launched (packages bought before then do not unlock it). Your Pro status shows at ' + URL_ + '/my. If you think yours should be on, ask network support with your username.' },
{ id: 'my-stack', title: 'My Stack POL: signing in', q: ['How do I sign in to Stack POL?', 'What is My Stack POL?', 'Where are my join links?'], tags: ['sign in', 'my stack pol', 'login', 'join links', 'share kit'],
re: /(sign ?in|log ?in|my stack pol|\/my|join links|share kit)/i,
a: 'Go to ' + URL_ + '/my and tap "Sign in with your network account": it uses the account you already have on InstantAdPay, with no new password (not signed in there yet, it takes you through the InstantAdPay sign-in and straight back). Inside: your page switch, Pro, your join links for every network site, a share kit with a ready post, banner code, images and your QR code, and your own payouts.' },
{ id: 'about', title: 'What is Stack POL?', q: ['What is Stack POL?', 'How does Stack POL work?', 'What is this site?'], tags: ['stack pol', 'overview', 'ledger', 'payouts'],
re: /(what('s| is) (stack ?pol|this (site|place))|how does (stack ?pol|this site|it) work)/i,
a: 'Stack POL adds up every POL payout from the programs in the network: InstantAdPay, LinkSpin, the other network sites and the games that pay POL. The front page shows everyone combined, every row links to its Polygon transaction, and a member who switches it on gets their own page with their own stack. Stack POL only shows payouts; it sells nothing and holds nothing. ' + NOT_INCOME },
{ id: 'numbers', title: 'Where the numbers come from', q: ['Where do the numbers come from?', 'How often does it update?', 'Can I check a payment?'], tags: ['numbers', 'ledger', 'polygonscan', 'update'],
re: /(where do the numbers|numbers come from|how often|update[sd]?\b|refresh|check (a |the )?payment|polygonscan|verify)/i,
a: 'From each program\'s own payout records and from the network contracts on Polygon, refreshed every 5 minutes. Every row in the ledger (' + URL_ + '/ledger) links to its Polygon transaction, so anyone can check it on Polygonscan.' },
{ id: 'income', title: 'Is this income? Will I earn this much?', q: ['Will I earn this much?', 'Is this income?', 'How much can I make?'], tags: ['income', 'earnings', 'promise'],
re: /(will i (earn|make|get)|how much (can|will|do) (i|you|people) (earn|make)|is (this|it) income|earn this much|guarantee)/i,
a: NOT_INCOME + ' What one member stacks depends on what they do in each program.' },
{ id: 'my-page', title: 'Your own Stack POL page', q: ['How do I get my own Stack POL page?', 'Why is my name not on Stack POL?', 'How do I hide my page?'], tags: ['my page', 'opt in', 'username', 'promo tools'],
re: /(my (own )?(stack|page)|own (stack )?page|switch on|opt.?in|my name (is )?not|hide my|show my stack)/i,
a: 'Join InstantAdPay free, link a wallet, and switch on "Show my Stack POL page" in Promo tools. Your page lives at ' + URL_ + '/your-username and updates every 5 minutes. Members are named on Stack POL only when they switch it on.' },
{ id: 'programs', title: 'Which programs are on Stack POL', q: ['Which programs are on Stack POL?', 'Where does the POL come from?', 'Are the games included?'], tags: ['programs', 'games', 'sites', 'earn pages'],
re: /(which programs|what programs|programs (are|on)|where does the pol come from|games? (included|on)|\/earn)/i,
a: 'The programs on Stack POL: ' + NAMES + '. Each has its own page (for example ' + URL_ + '/earn/viraladblitz) and its own ledger filter, and each pays straight to members\' own wallets on Polygon. See them all at ' + URL_ + '/programs' },
{ id: 'start', title: 'How to start', q: ['How do I start?', 'How do I join?', 'Is it free?'], tags: ['join', 'start', 'free', 'instantadpay'],
re: /(how (do|can) i (start|join|sign ?up)|\bjoin\b|sign ?up|get started|is (it|this) free|free to join)/i,
a: 'Start free on InstantAdPay (https://instantadpay.com/join): one network account works across every network site. What you stack depends on what you do in each program. ' + NOT_INCOME },
{ id: 'custody', title: 'Does Stack POL hold my money?', q: ['Does Stack POL hold my money?', 'How do I withdraw from Stack POL?'], tags: ['custody', 'withdraw', 'wallet', 'safe'],
re: /(hold (my|the) (money|funds|pol)|withdraw|cash ?out|balance|safe|scam|legit)/i,
a: 'No. Stack POL only shows payouts. Every payment goes straight from the program to your own wallet on Polygon, so there is nothing here to withdraw.' },
{ id: 'pol', title: 'What is POL?', q: ['What is POL?', 'Is POL the same as MATIC?', 'Which wallet do I need?'], tags: ['pol', 'polygon', 'matic', 'wallet'],
re: /(what is pol|\bpol\b|matic|polygon|wallet|safepal|metamask)/i,
a: 'POL is the native token of the Polygon network, formerly MATIC. Fees are a fraction of a cent and transfers confirm in seconds, which is why small payouts work on it. To receive payouts, use SafePal or any other crypto wallet on Polygon, and never share your recovery phrase.' },
{ id: 'blog', title: 'The blog', q: ['Is there a blog?', 'Where are the guides?'], tags: ['blog', 'guides', 'articles'],
re: /\bblog\b|articles?|guides?|rss/i,
a: 'The blog at ' + URL_ + '/blog has guides on building in POL across the network, with an RSS feed at ' + URL_ + '/blog/feed.xml.' }
];
const FAQ = [
{ id: 'f-network', title: 'Stack POL and the network', source: 'faq', tags: ['network', 'one account'],
questions: ['Is Stack POL part of InstantAdPay?', 'Which network sites are there?'],
answer: 'Stack POL is the network\'s payout tracker. One network account works across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, ViralAdBlitz, DownlineHydra, 5xYourTeam, Stack POL and Earners Corner, and each site\'s member payouts show here.' }
];
const FACTS = () => [
'- WHAT IT IS: Stack POL (' + URL_ + ') adds up every POL payout across the network: ' + NAMES + '. Front page = everyone combined (network totals, last 7 days, latest payouts), /programs, /earn/<program> pages, /ledger (filter ?p=), opt-in member pages ' + URL_ + '/<username>, /blog. It sells nothing and holds nothing: every payment goes from the program straight to the member\'s wallet on Polygon.',
'- DATA: each program\'s payout records and the network contracts on Polygon, refreshed every 5 minutes; every ledger row links to its Polygon transaction. Members are named only when they switch on "Show my Stack POL page" in InstantAdPay Promo tools (join InstantAdPay free and link a wallet first).',
(nwLive() ? '- NETWORK WEEKEND (live now, Black Friday to Cyber Monday, Fri 11-27 to Mon 11-30, midnight to midnight Central): Stack POL sells nothing itself. Its Pro view unlocks with any InstantAdPay package of $10 or more (an existing perk, not a weekend price), so a $10+ InstantAdPay pack this weekend also unlocks Stack POL Pro. Every network deal: https://instantadpay.com/weekend. Ad credits buy advertising, not income.' : null),
'- MY STACK POL (' + URL_ + '/my, live 2026-11-19): sign in with the network account (the InstantAdPay account; no new password). Shows the page switch, Pro status, join links for every network site, a share kit (ready post, banner code, images, QR code) and the payouts of that member.',
'- STACK POL PRO (it EXISTS; never say there is no Pro or paid tier): own LinkSpin Banner Spins in the page ad spots, own spin links and a QR code on the member page; ?ref=username on any Stack POL page carries their referral. Unlocks once, for good, with ONE InstantAdPay ad package of $10 or more bought on or after 2026-11-09 (Pro launch); packages bought before that date do not count, and several smaller packages do not add up. Status shows on /my as Pro or Not yet. Questions about a missing unlock go to network support.',
'- NEVER quote a total as what someone will earn; never state a maximum. ' + NOT_INCOME,
'- For how a program pays (prices, splits, rules), use that program\'s own knowledge-base entries and send people to that site. SUPPORT: network support at ' + SUPPORT + '.'
].filter(Boolean).join('\n');
const SITE = {
id: 'stackpol', hubSite: 'stackpol', netId: 'stackpol', name: 'Stack POL', url: URL_, supportUrl: SUPPORT, knowledgeDate: KNOWLEDGE_DATE,
dataDir: process.env.DATA_DIR || require('path').join(__dirname, 'data'), canned: CANNED, faq: FAQ, facts: FACTS,
intro: 'You are the assistant on Stack POL (' + URL_ + '), the network\'s payout tracker: it adds up every POL payout across the network\'s sites and games, each one checkable on Polygon. Most questions about how to earn belong to a specific program: answer from that program\'s entries and link to it.',
quickTopics: ['What is Stack POL?', 'How do I get my own page?', 'What is ViralAdBlitz?', 'How does Downline Banners pay?']
};
function init() { return core.init(SITE); }
module.exports = { init, handle: core.handle, answer: core.answer, KNOWLEDGE_DATE, CANNED, FAQ, SITE };
+229
View File
@@ -0,0 +1,229 @@
// The site assistant's engine (Marty 2026-11-15: a chatbot on every rebuilt network site), ported from LinkSpin's chatbot.js.
// The site's own chatbot.js holds what it knows (CANNED instant answers + FACTS, written from that site's code); this file
// holds how it answers, the same on every site:
// 1. the knowledge base's instant answers (kb.js, seeded from CANNED; first matching pattern wins, no AI call)
// (since 2026-11-16 only a hand-off pattern answers outright; any other pattern hit is checked against step 1b)
// 1b. the hub's semantic match by meaning (netkb.route, core2 embeddings): answers with this site's entry when it is sure,
// keeps or overrules a pattern hit, and picks the prompt context; fails soft to the old path within NETKB_MATCH_MS
// 2. retrieval over the merged NETWORK knowledge base (this site's entries boosted, netkb.js), into the system prompt
// 3. OpenRouter (deepseek/deepseek-v4-flash:nitro, reasoning OFF, retried once), house rules in the prompt and on the way out
// Account problems go to the network support desk on InstantAdPay (handoff: true makes the widget offer it).
// Routes: POST /api/chat, GET /api/chat/kb-stamp, admin GET/POST /api/admin/kb, GET/PUT/DELETE /api/admin/kb/<id>,
// POST /api/admin/kb/test, GET /api/admin/kb/network (x-admin-token, the site's own isAdmin).
// The SAME file ships in ViralAdBlitz, DownlineHydra, 5xYourTeam, Viral Banner Blitz, Downline Banners and Stack POL.
'use strict';
const fs = require('fs');
const path = require('path');
const https = require('https');
const http = require('http');
const kb = require('./kb');
const netkb = require('./netkb');
const MODEL = process.env.OPENROUTER_MODEL || 'deepseek/deepseek-v4-flash:nitro';
let S = null; // the site: { id, hubSite, name, url, dataDir, canned, faq, facts(), about, supportUrl, linkFor, quickTopics }
function key() {
if (process.env.OPENROUTER_API_KEY) return process.env.OPENROUTER_API_KEY.trim();
if (!S || !S.dataDir) return '';
try { return fs.readFileSync(path.join(S.dataDir, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; }
}
const enabled = () => !!key();
// CANNED + FAQ in the shape kb.js stores (order keeps the first-match-wins sequence)
function seeds() {
return S.canned.map((c, i) => ({ id: 'c-' + c.id, title: c.title, questions: c.q || [], answer: c.a, tags: c.tags || [], pattern: c.re ? c.re.source : '',
handoff: !!c.handoff, order: (i + 1) * 10, source: 'canned' })).concat(S.faq || []);
}
const supportUrl = () => S.supportUrl || 'https://instantadpay.com/support';
// asking for a person, or one person's own account problem: every site's first CANNED entry uses this (handoff: true)
const SUPPORT_RE = /((contact|reach|email|e-mail|message|talk to|speak (to|with)|get hold of) (the )?(support|admin|administrator|owner|marty|staff|someone|a (human|person|real person))|real person|\bhuman\b|customer (service|support)|open a ticket|support (ticket|desk|team|email)|help ?desk|(my|the) (boost|purchase|payment|payout|order|account|sign.?in|log.?in|pro|upgrade|ad|banner|pick)s? (is |was |has |did |does )?(not|never|n.?t|missing|stuck|wrong|failed|broken|lost|gone)|(did ?n.?t|did not|never|has ?n.?t|have ?n.?t) (show|arriv|appear|receiv|get paid|go through|work|confirm)|i (was|got) (charged|scammed)|charged twice)/i;
const HOUSE_RULES = () => `RULES:
- 1 to 4 sentences, plain text, no markdown, include full URLs when pointing at a page.
- Your main job is ${S.name}. Questions about another network site: answer from that site's knowledge-base entry, say which site it is about, and give that site's link exactly as the entry gives it. Never mix two sites' prices, splits or rules.
- NEVER promise or estimate income, and never state a maximum or total anyone can earn. This is advertising with a referral program, never an investment. Nobody earns unless real purchases happen in their line. Crypto payments are final.
- Whenever ad credits come up, say: Ad credits buy advertising, not income.
- Wallets: say "SafePal or any other crypto wallet". Never recommend MetaMask.
- Never mention RM Circle. It is not part of this network.
- No em dashes. If you do not know, say so plainly; never guess a price, a percentage or a rule.
- Anything about one person's own account (a missing payout, a sign-in that will not work, a purchase that did not show, a bug) you cannot look up: say so and send them to network support at ${supportUrl()}.`;
function networkLine() {
const list = netkb.sites();
if (!list.length) return '';
return '\nNETWORK SITES (one network account works across them; link to use for each):\n' + list.map(s => '- ' + s.name + ': ' + s.go).join('\n') + '\n';
}
function systemPrompt(kbBlock) {
return S.intro + '\n\nFACTS (checked against this site\'s code on ' + S.knowledgeDate + '):\n' + S.facts() + '\n' + networkLine() + '\n' + HOUSE_RULES() + (kbBlock ? '\n\n' + kbBlock : '');
}
function endpoint() {
try { return new URL(process.env.OPENROUTER_URL || 'https://openrouter.ai/api/v1/chat/completions'); } catch (e) { return new URL('https://openrouter.ai/api/v1/chat/completions'); }
}
function askOnce(message, historyText, kbBlock) {
return new Promise((resolve, reject) => {
const body = JSON.stringify({
model: MODEL,
reasoning: { enabled: false }, // deepseek-v4-flash reasons by default and can spend the whole max_tokens on it (2026-10-16)
max_tokens: 320,
messages: [
{ role: 'system', content: systemPrompt(kbBlock) },
...(historyText ? [{ role: 'user', content: 'Earlier context: ' + String(historyText).slice(0, 800) }] : []),
{ role: 'user', content: String(message).slice(0, 600) }
]
});
const ep = endpoint();
const req = (ep.protocol === 'http:' ? http : https).request({ hostname: ep.hostname, port: ep.port || undefined, path: ep.pathname + ep.search, method: 'POST',
headers: { Authorization: 'Bearer ' + key(), 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body),
'HTTP-Referer': S.url, 'X-Title': S.name + ' assistant' }, timeout: 30000 },
res => {
let d = '';
res.on('data', c => { d += c; });
res.on('end', () => {
// OpenRouter can pad a slow upstream with keepalive lines before the JSON (IAP, 2026-09-17): find the object
const i = d.indexOf('{'); let txt = '';
try { txt = String(JSON.parse(i < 0 ? d : d.slice(i)).choices[0].message.content || '').trim(); }
catch (e) { return reject(new Error('openrouter ' + res.statusCode + ': ' + d.slice(0, 150))); }
if (!txt) return reject(new Error('openrouter ' + res.statusCode + ': empty content'));
resolve(txt);
});
});
req.on('error', reject);
req.on('timeout', () => req.destroy(new Error('openrouter timeout')));
req.end(body);
});
}
async function askAI(message, historyText, kbBlock) {
try { return await askOnce(message, historyText, kbBlock); }
catch (e) { await new Promise(r => setTimeout(r, 700)); return askOnce(message, historyText, kbBlock); } // one provider dropping it is the usual cause
}
// house rules on the way out, whatever the model wrote
const RMC_RE = /\brm ?circle\b|rmcircle/i;
function scrub(t) {
let s = String(t || '').replace(/\s*[—―]\s*/g, ', ').replace(/(\d)\s*–\s*(\d)/g, '$1-$2').replace(/\s*–\s*/g, ', ');
s = s.replace(/\*\*(.+?)\*\*/g, '$1').replace(/^#+\s*/gm, '');
s = s.replace(/\bMeta ?Mask\b(\s*(,|or|and)\s*)?/gi, '').replace(/\s{2,}/g, ' ').trim();
return s;
}
const UNSURE_RE = /(not sure|do not know|don't know|cannot help|can't help|unable to help|no way for me|i (can|could) ?not (see|check|look)|contact support|network support|support desk|\/support\b)/i;
async function answer(message, historyText) {
const r = await answerRaw(message, historyText);
if (r && typeof r.reply === 'string') {
r.reply = scrub(r.reply);
if (RMC_RE.test(r.reply)) r.reply = 'I can only help with ' + S.name + ' and the network sites. For anything else, network support at ' + supportUrl() + ' can point you the right way.';
}
return r;
}
async function answerRaw(message, historyText) {
const msg = String(message || '').trim().slice(0, 600);
if (!msg) return { error: 'Say something first.' };
let hit = null, kbOk = true, other = [];
try {
await kb.load();
// a question about another network site (named, and this site not named) skips this site's instant answers, except a hand-off
other = kb.namesOther(msg, S.hubSite);
if (other.length && new RegExp('\\b' + S.name.replace(/[^A-Za-z0-9]+/g, '\\s*') + '\\b', 'i').test(msg)) other = [];
hit = await kb.fastPath(msg);
if (hit && other.length && !hit.handoff) hit = null;
} catch (e) { kbOk = false; console.error('kb fast path', e.message); }
// a hand-off (support, one person's account problem) always answers from its exact pattern, before anything else
if (hit && hit.handoff) return { reply: hit.answer, canned: true, kb: hit.id, handoff: true };
// then meaning (2026-11-16, netkb.route): the hub's semantic match over the network KB answers, keeps or overrules the
// pattern hit, and picks the prompt context. Hub or model slow or down: null, and the pattern + BM25 path below runs as before.
let sem = null;
if (kbOk) { try { sem = await netkb.route(msg, { fast: hit, own: await kb.own(), prefer: other }); } catch (e) { sem = null; } }
if (sem) hit = sem.hit;
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
let kbBlock = '', kbIds = [], hits = [];
try {
const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg;
hits = sem && sem.hits.length ? sem.hits : await kb.context(query, 6);
kbBlock = kb.promptBlock(hits); kbIds = hits.map(h => h.entry.id);
} catch (e) { console.error('kb search', e.message); }
if (!enabled()) {
// no AI: the best matching entry, if it is a clear match, else the honest fallback
if (hits.length) { const e = hits[0].entry; return { reply: e.answer + (e.site ? ' More at ' + e.go : ''), kb: [e.id] }; }
return { reply: S.fallback || ('Good question. The quick answers I have cover how ' + S.name + ' works, what it costs and how payouts work. For anything else, network support at ' + supportUrl() + ' will help.'), handoff: true };
}
try { const reply = await askAI(msg, historyText, kbBlock); return Object.assign({ reply }, kbIds.length ? { kb: kbIds } : {}, UNSURE_RE.test(reply) ? { handoff: true } : {}); }
catch (e) {
console.error('chat AI failed', e.message);
if (hits.length) { const x = hits[0].entry; return { reply: x.answer + (x.site ? ' More at ' + x.go : ''), kb: [x.id] }; }
return { reply: 'I hit a snag answering that one, on our side. The live ledger at ' + S.url + '/ledger and the contract page at ' + S.url + '/contract cover most deep questions, or network support at ' + supportUrl() + ' will answer.', handoff: true };
}
}
// ---- rate limit: per visitor, in memory ----
const hits = new Map();
function limited(ip) {
const now = Date.now(); const h = hits.get(ip) || { m: 0, mAt: now, d: 0, dAt: now };
if (now - h.mAt > 60000) { h.m = 0; h.mAt = now; }
if (now - h.dAt > 86400000) { h.d = 0; h.dAt = now; }
h.m++; h.d++; hits.set(ip, h);
if (hits.size > 20000) hits.clear();
return h.m > 12 || h.d > 300;
}
const ipOf = req => String(req.headers['cf-connecting-ip'] || String(req.headers['x-forwarded-for'] || '').split(',')[0] || (req.socket && req.socket.remoteAddress) || 'x').trim();
// h: { json(res, code, obj, extra), readBody(req), isAdmin(req) }; returns true when it answered
async function handle(req, res, p, u, h) {
if (p === '/api/chat' && req.method === 'POST') {
if (limited(ipOf(req))) { h.json(res, 429, { error: 'Give it a minute, then ask again.' }); return true; }
const b = await h.readBody(req);
const hist = Array.isArray(b.history) ? b.history.map(x => String(x || '')).join(' ').slice(-800) : String(b.history || '').slice(-800);
const r = await answer(b.message, hist);
if (r.handoff) r.support = supportLink(b.message);
h.json(res, r.error ? 400 : 200, r); return true;
}
if (p === '/api/chat/config' && req.method === 'GET') { h.json(res, 200, { name: S.name, support: supportUrl(), topics: S.quickTopics || [] }, { 'Cache-Control': 'public, max-age=300' }); return true; }
if (p === '/api/chat/kb-stamp' && req.method === 'GET') { h.json(res, 200, Object.assign(await kb.stamp(), { knowledgeDate: S.knowledgeDate }), { 'Cache-Control': 'no-store' }); return true; }
if (!p.startsWith('/api/admin/kb')) return false;
if (!h.isAdmin(req)) { h.json(res, 401, { error: 'no' }); return true; }
if (p === '/api/admin/kb') {
if (req.method === 'GET') { h.json(res, 200, { entries: await kb.list(u.searchParams.get('q') || ''), stamp: await kb.stamp() }); return true; }
if (req.method === 'POST') { const r = await kb.create(await h.readBody(req)); h.json(res, r.error ? 400 : 200, r); return true; }
}
if (p === '/api/admin/kb/test' && req.method === 'POST') { const b = await h.readBody(req); h.json(res, 200, Object.assign(await kb.test(b.question), b.answer ? { answer: await answer(b.question) } : {})); return true; }
if (p === '/api/admin/kb/network' && req.method === 'GET') {
if (u.searchParams.get('refresh') === '1') await netkb.refresh();
if (u.searchParams.get('publish') === '1') await netkb.publish();
h.json(res, 200, Object.assign(netkb.view(), { ai: enabled(), model: MODEL })); return true;
}
const m = /^\/api\/admin\/kb\/([A-Za-z0-9._:-]{1,80})$/.exec(p);
if (m) {
if (req.method === 'GET') { const e = await kb.get(m[1]); h.json(res, e ? 200 : 404, e ? { entry: e } : { error: 'Entry not found.' }); return true; }
if (req.method === 'PUT') { const r = await kb.update(m[1], await h.readBody(req)); h.json(res, r.error ? (r.error === 'Entry not found.' ? 404 : 400) : 200, r); return true; }
if (req.method === 'DELETE') { const r = await kb.remove(m[1]); h.json(res, r.error ? 404 : 200, r); return true; }
}
h.json(res, 404, { error: 'Not found' }); return true;
}
// the support desk link the widget offers: InstantAdPay's public form, told which site and question it came from
function supportLink(q) {
const qs = new URLSearchParams({ from: S.id, subject: (S.name + ': ' + String(q || '').replace(/\s+/g, ' ').trim()).slice(0, 120) });
return supportUrl() + '?' + qs.toString();
}
// the link to another network site: its LinkSpin tracked link with ?src=<this site> (netsites.js), else its plain address
const hostOf = x => { try { return new URL(x).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
function linkVia(netId) {
return url => {
try {
const ns = require('./netsites'); const h = hostOf(url);
const m = ns.list().concat(ns.FALLBACK || []).find(s => hostOf(s.url) === h);
return (m && netId && m.id !== netId && ns.tracked(m.id, netId)) || url;
} catch (e) { return url; }
};
}
// site: see S above. Call after docstore.init (kb.json is a MySQL document there).
function init(site) {
S = site; if (!S.linkFor) S.linkFor = linkVia(S.netId);
const ready = kb.init({ dataDir: site.dataDir, seeds: seeds(), siteUrl: site.url, helpText: 'network support at ' + supportUrl() });
netkb.init({ dataDir: site.dataDir, site: site.hubSite, name: site.name, url: site.url, entries: () => kb.own(), linkFor: site.linkFor });
return ready;
}
module.exports = { init, handle, answer, enabled, seeds, systemPrompt, scrub, supportLink, linkVia, SUPPORT_RE, _limited: limited };
@@ -0,0 +1,34 @@
{
"slug": "games-that-pay-pol-on-polygon",
"title": "Games That Pay POL on Polygon: Every Game in the Network, Compared",
"seoTitle": "Games That Pay POL on Polygon (2026): 10 Games Compared",
"excerpt": "Ten browser games in the network pay POL straight to your wallet. Here is what each one is, how it pays, and what it has paid so far, all checkable on Polygonscan.",
"cover": "/img/gk.jpg",
"coverAlt": "Gem Kingdom, one of the games that pay POL",
"tags": [
"games",
"play to earn",
"polygon",
"gem-kingdom",
"polhunter",
"spellwheel",
"clutterhunt"
],
"publishedAt": "2026-11-09T14:10:00-06:00",
"updated": "2026-11-09T14:10:00-06:00",
"body": "<p>\"Play to earn\" has a reputation problem. Too many games promised big rewards and paid in tokens nobody could sell. The games in this network take a plainer approach: they pay small amounts of POL, the native token of Polygon, straight to your wallet, and every payment is a public transaction you can check.</p>\n<p>Below is every game in the network that pays POL, with what each has paid so far according to the <a href=\"/ledger\">Stack POL ledger</a> on November 9, 2026. All of them run in a browser, and all of them are free to play.</p>\n<h2>The games, side by side</h2>\n<table><thead><tr><th>Game</th><th>Type</th><th>POL paid so far</th><th>Payments</th></tr></thead><tbody>\n<tr><td><a href=\"/earn/polhunter\">PolHunter</a></td><td>Scavenger hunt</td><td>652.51</td><td>4,859</td></tr>\n<tr><td><a href=\"/earn/gem-kingdom\">Gem Kingdom</a></td><td>Fantasy match-3</td><td>379.04</td><td>686</td></tr>\n<tr><td><a href=\"/earn/spellwheel\">SpellWheel</a></td><td>Word game</td><td>50.58</td><td>134</td></tr>\n<tr><td><a href=\"/earn/clutterhunt\">ClutterHunt</a></td><td>Hidden objects</td><td>33.70</td><td>305</td></tr>\n<tr><td><a href=\"/earn/polywarriors\">PolyWarriors</a></td><td>Cyberpunk fighting</td><td>16.66</td><td>50</td></tr>\n<tr><td><a href=\"/earn/pol-miner\">POL Miner</a></td><td>Mining adventure</td><td>14.33</td><td>48</td></tr>\n<tr><td><a href=\"/earn/drip-runner\">Drip Runner</a></td><td>Arcade runner</td><td>11.28</td><td>153</td></tr>\n<tr><td><a href=\"/earn/turkey-drop\">Turkey Drop</a></td><td>Seasonal arcade</td><td>6.91</td><td>33</td></tr>\n<tr><td><a href=\"/earn/polybreak\">PolyBreak</a></td><td>Brick breaker</td><td>6.28</td><td>48</td></tr>\n<tr><td><a href=\"/earn/road-agent\">Road Agent</a></td><td>Highway shooter</td><td>4.69</td><td>48</td></tr>\n</tbody></table>\n<p>Some games have been live much longer than others, so the totals say more about age and player count than about how generous a game is. Turkey Drop, for example, only opened on November 2.</p>\n<h2>A quick look at each one</h2>\n<h3>PolHunter</h3><p>Hunt hidden codes on sites across the network. Every find drips POL straight to your wallet. It is the busiest program on the ledger by far, with thousands of small payments.</p>\n<h3>Gem Kingdom</h3><p>Match gems to battle monsters with three heroes, earn stars and rebuild your village. First clears and boss wins pay POL.</p>\n<h3>SpellWheel</h3><p>Swipe the letter wheel to fill the crossword, travel through six cozy places, and solve a new daily puzzle with everyone. Clear levels and chapters to earn POL.</p>\n<h3>ClutterHunt</h3><p>Search cozy, cluttered rooms for hidden objects. New rooms arrive every season, starting with the Haunted Manor.</p>\n<h3>PolyWarriors</h3><p>Turn-based fights with collectible low-poly warriors. Recruit fighters born with rare traits, climb the arena and challenge other members.</p>\n<h3>POL Miner</h3><p>Dig down through the layers, haul ore to sell, upgrade your pick, lamp and cart, and beat a drill boss every 30 m. Rare pink Polygon crystals pay POL.</p>\n<h3>Drip Runner</h3><p>Hop the network, dodge the bots and clear chapters. Each first clear drips POL into your game balance.</p>\n<h3>Turkey Drop</h3><p>A Thanksgiving game that runs November 2 to 30. Catch the turkeys the radio station helicopter drops over the mall. Score milestones pay POL the first time you reach them, and the weekly top 3 win a POL prize.</p>\n<h3>PolyBreak</h3><p>Break walls of glass jewel bricks with the classic arcade capsules and catch the purple Polygon gem when it falls. First clears of each round pay POL.</p>\n<h3>Road Agent</h3><p>Drive the night highway, shoot the hostiles that hunt you and spare the civilians. Every sector you clear for the first time pays POL.</p>\n<h2>How to start</h2>\n<p>Every game uses your InstantAdPay account to sign in, so one free account covers all of them. Link a Polygon wallet and your rewards go straight to it. Pick a game from the <a href=\"/programs\">programs page</a> and press play.</p>\n<p><i>Game rewards are small and depend on how you play. No income is promised, and cryptocurrency involves risk.</i></p>",
"faq": [
{
"q": "Do these games cost anything to play?",
"a": "No. All of them are free to play in a browser. Some offer an optional Game Pass, but you can start without paying."
},
{
"q": "How are the rewards paid?",
"a": "In POL on the Polygon network, sent from each game's own payout wallet straight to the wallet linked to your account. Every payment is a public transaction."
},
{
"q": "Which game pays the most?",
"a": "PolHunter and Gem Kingdom have paid the most so far, but they have also been live the longest. Totals reflect how long a game has run and how many people play it."
}
]
}
@@ -0,0 +1,27 @@
{
"slug": "how-to-check-a-payout-on-polygonscan",
"title": "How to Check Any Payout on Polygonscan in 30 Seconds",
"seoTitle": "How to Check a POL Payout on Polygonscan (Step by Step)",
"excerpt": "Every payout on Stack POL links to Polygonscan. Here is how to read a transaction page: who sent it, who received it, how much, and when.",
"cover": "/og-stackpol-1200x630.jpg",
"coverAlt": "Checking a POL payout on Polygonscan",
"tags": [
"polygonscan",
"polygon",
"payouts",
"beginners"
],
"publishedAt": "2026-11-09T14:20:00-06:00",
"updated": "2026-11-09T14:20:00-06:00",
"body": "<p>\"Paid\" means very little until you can see it. On Polygon you can, and it takes about 30 seconds. Every row on the <a href=\"/ledger\">Stack POL ledger</a> ends with a link to its transaction on Polygonscan, the public explorer for the Polygon network. Here is how to read what you find there.</p>\n<h2>Step 1: open the transaction</h2>\n<p>Click the transaction link on any ledger row. It opens a page on polygonscan.com titled <b>Transaction Details</b>. The long code at the top, starting with 0x, is the transaction hash: a unique fingerprint for that one payment.</p>\n<h2>Step 2: check the status</h2>\n<p>Look for <b>Status</b>. \"Success\" means the payment went through and is final. Polygon transactions confirm in seconds, so anything on the ledger is already settled.</p>\n<h2>Step 3: who paid whom</h2>\n<ul><li><b>From</b> is the wallet that sent the payment. For a game reward, that is the game's own payout wallet. For an InstantAdPay or LinkSpin referral payment, it is the buyer interacting with the smart contract.</li>\n<li><b>To</b> is either the receiving wallet (game rewards) or the smart contract (package purchases).</li>\n<li><b>Internal transactions</b> or <b>transfers</b>: on a package purchase, the contract splits the money in the same transaction and you will see each payment to each wallet listed here. That is what \"paid in the same transaction\" looks like on the chain.</li></ul>\n<h2>Step 4: amount and time</h2>\n<p><b>Value</b> shows the POL amount. <b>Timestamp</b> shows when it happened, in UTC; Stack POL shows the same time in US Central. If the numbers on Stack POL and Polygonscan ever disagree, the chain is right and we want to know.</p>\n<h2>Step 5: check your own wallet</h2>\n<p>Paste your own wallet address into the search box at the top of Polygonscan. You will see every transaction your wallet has ever made or received. If your wallet is linked to your account, that list and your Stack POL page should tell the same story.</p>\n<h2>Why this matters</h2>\n<p>Most platforms ask you to trust a number on a dashboard. The programs in this network chose to pay on a public chain so you do not have to. Stack POL just puts all those public payments in one place.</p>",
"faq": [
{
"q": "Is Polygonscan safe to use?",
"a": "Yes. It is a read-only explorer. You never need to connect a wallet or sign anything to look up a transaction."
},
{
"q": "Why does the time look different?",
"a": "Polygonscan shows UTC. Stack POL shows US Central time, which is 6 hours behind UTC in winter and 5 in summer."
}
]
}
@@ -0,0 +1,16 @@
{
"slug": "network-payout-recap-november-2-8-2026",
"title": "Network Payout Recap: November 2 to 8, 2026",
"seoTitle": "POL Payout Recap, Nov 2-8 2026: 1,728 POL in 521 Payments",
"excerpt": "The network paid 1,728.60 POL in 521 payments to 52 wallets from November 2 to 8. Here is how it split across InstantAdPay, LinkSpin, PolHunter and the games.",
"cover": "/og-stackpol-1200x630.jpg",
"coverAlt": "Stack POL weekly payout recap",
"tags": [
"payout recap",
"payouts",
"polygon"
],
"publishedAt": "2026-11-09T14:05:00-06:00",
"updated": "2026-11-09T14:05:00-06:00",
"body": "<p>Every Monday Stack POL looks back at the week before: how much POL the network paid, to how many wallets, and from which programs. These numbers come straight from the payout records and the chain, the same data behind the <a href=\"/ledger\">live ledger</a>.</p>\n<h2>The week at a glance</h2>\n<p>From Monday, November 2 to Sunday, November 8 (US Central time), the network paid <b>1,728.60 POL</b> in <b>521 payments</b> to <b>52 different wallets</b>. The week before, October 26 to November 1, came to 2,138.31 POL in 928 payments, so this was a quieter week overall.</p>\n<h2>Where it came from</h2>\n<table><thead><tr><th>Program</th><th>POL paid</th><th>Payments</th><th>Wallets</th></tr></thead><tbody>\n<tr><td><a href=\"/earn/instantadpay\">InstantAdPay</a></td><td>1,463.03</td><td>26</td><td>9</td></tr>\n<tr><td><a href=\"/earn/linkspin\">LinkSpin</a></td><td>200.14</td><td>2</td><td>2</td></tr>\n<tr><td><a href=\"/earn/polhunter\">PolHunter</a></td><td>45.45</td><td>337</td><td>38</td></tr>\n<tr><td><a href=\"/earn/turkey-drop\">Turkey Drop</a></td><td>4.91</td><td>30</td><td>18</td></tr>\n<tr><td><a href=\"/earn/gem-kingdom\">Gem Kingdom</a></td><td>3.51</td><td>28</td><td>6</td></tr>\n<tr><td><a href=\"/earn/spellwheel\">SpellWheel</a></td><td>2.56</td><td>7</td><td>5</td></tr>\n<tr><td><a href=\"/earn/polywarriors\">PolyWarriors</a></td><td>2.22</td><td>11</td><td>3</td></tr>\n<tr><td><a href=\"/earn/drip-runner\">Drip Runner</a></td><td>2.00</td><td>30</td><td>9</td></tr>\n<tr><td><a href=\"/earn/road-agent\">Road Agent</a></td><td>1.58</td><td>17</td><td>5</td></tr>\n<tr><td><a href=\"/earn/clutterhunt\">ClutterHunt</a></td><td>1.15</td><td>20</td><td>5</td></tr>\n<tr><td><a href=\"/earn/polybreak\">PolyBreak</a></td><td>1.03</td><td>9</td><td>3</td></tr>\n<tr><td><a href=\"/earn/pol-miner\">POL Miner</a></td><td>1.02</td><td>4</td><td>4</td></tr>\n</tbody></table>\n<h2>What stands out</h2>\n<ul><li><b>Two kinds of payouts.</b> InstantAdPay and LinkSpin pay fewer, larger amounts: they are referral payments that the smart contract sends up the sponsor line when an ad package sells. The games pay many small amounts for things players do.</li>\n<li><b>PolHunter is the busiest program.</b> 337 payments in one week, to 38 different wallets. Its drips are small and frequent, one for each hidden code a hunter finds.</li>\n<li><b>Turkey Drop's first week.</b> The Thanksgiving game opened November 2 and paid 30 times to 18 players, including its first weekly top-3 prizes.</li></ul>\n<h2>Check it yourself</h2>\n<p>Every one of these payments is a public Polygon transaction. Open the <a href=\"/ledger\">ledger</a>, pick any row and follow the link to Polygonscan to see the sender, the receiving wallet, the amount and the time. Our guide to <a href=\"/blog/how-to-check-a-payout-on-polygonscan\">checking a payout on Polygonscan</a> walks through it.</p>\n<p><i>These are network-wide totals, not a promise of what any one member will earn. Cryptocurrency involves risk.</i></p>"
}
@@ -0,0 +1,27 @@
{
"slug": "paid-in-the-same-transaction-instantadpay-linkspin",
"title": "Paid in the Same Transaction: How InstantAdPay and LinkSpin Pay the Sponsor Line",
"seoTitle": "Paid in the Same Transaction: How InstantAdPay and LinkSpin Pay",
"excerpt": "When an ad package sells on InstantAdPay or LinkSpin, the smart contract pays the sponsor line in that same transaction. Nothing is held. Here is how it works and how to see it.",
"cover": "/img/iap.jpg",
"coverAlt": "InstantAdPay pays on-chain, instantly",
"tags": [
"instantadpay",
"linkspin",
"smart contract",
"payouts"
],
"publishedAt": "2026-11-09T14:25:00-06:00",
"updated": "2026-11-09T14:25:00-06:00",
"body": "<p>The two biggest numbers on Stack POL come from <a href=\"/earn/instantadpay\">InstantAdPay</a> and <a href=\"/earn/linkspin\">LinkSpin</a>. On November 9, 2026, InstantAdPay had paid 32,266 POL in 474 payments and LinkSpin 4,221 POL in 44 payments. Those payments work differently from game rewards, and the difference is worth understanding.</p>\n<h2>What is being sold</h2>\n<p>Both platforms sell advertising. A member buys an ad package, and the package buys ad delivery across the network: text ads, banners, visits and more. The ad credits are spent on advertising. They are not an investment and they do not pay income by themselves.</p>\n<h2>Where the money goes, in the same transaction</h2>\n<p>When a package sells, the payment goes into the platform's smart contract on Polygon. In that same transaction, the contract pays the buyer's sponsor line: the member who invited the buyer, and the levels above them. On InstantAdPay the direct sponsor receives 50%, the second level 20% and the third level 10%. Nothing waits in a company account and nobody presses a payout button. If the purchase happens, the payments happen with it.</p>\n<p>That is why these two programs show fewer, larger payments than the games. Each one is a share of a real package sale.</p>\n<h2>How to see it on the chain</h2>\n<p>Open any InstantAdPay or LinkSpin row on the <a href=\"/ledger\">ledger</a> and follow it to Polygonscan. The transaction shows the purchase going into the contract and, inside the same transaction, the transfers out to each wallet in the sponsor line. Our guide to <a href=\"/blog/how-to-check-a-payout-on-polygonscan\">reading a transaction</a> points out where to look.</p>\n<h2>What this does not mean</h2>\n<p>Payments only happen when real packages sell. A sponsor line with no purchases pays nothing. The totals on Stack POL are the whole network added together, and most of it went to members who built active lines over time. It is a record of what happened, not a forecast.</p>\n<h2>Getting started</h2>\n<p>Joining either platform is free. If you advertise, point your ads at a LinkSpin spin link so you can see which page turns clicks into sign-ups, and link a Polygon wallet so any payment reaches you directly.</p>\n<p><i>Ad credits buy advertising, not income. No income is promised, and cryptocurrency involves risk.</i></p>",
"faq": [
{
"q": "Does InstantAdPay hold my money before paying it?",
"a": "No. The smart contract pays the sponsor line in the same transaction as the purchase. Nothing is held by the company."
},
{
"q": "Do I have to buy a package to join?",
"a": "No. Joining is free and starts with your email. Packages are for advertising."
}
]
}
@@ -0,0 +1,31 @@
{
"slug": "video-app-income-business-on-your-phone",
"title": "A complete business that fits on your phone, and the first video is free",
"seoTitle": "Video App Income: A Complete Business on Your Phone, First Video Free",
"excerpt": "Video App Income makes short promo videos on your phone for any link you paste, puts each one on a tracked share page, and lets you try it with one free video.",
"cover": "/img/vai-open.jpg",
"coverAlt": "Video App Income: short videos made on your phone",
"tags": [
"video app income",
"video marketing",
"polygon",
"getting started"
],
"publishedAt": "2026-11-21T06:25:00-06:00",
"updated": "2026-11-21T06:25:00-06:00",
"body": "<p>Most online businesses ask you to build five things before you can start. A page. A video. A way to track clicks. A way to get paid. A reason for anyone to say yes.</p>\n<p>Video App Income puts all five on your phone. It opened this week, and you can try it with one free video before you spend anything.</p>\n<h2>Start with a link</h2>\n<p>Paste a link to whatever you promote. It can be a program you're in, your own website, a store, a blog or a booking page. The app reads the page and writes a short script from what it says. Then it adds a voice, captions that light up word by word, footage and music.</p>\n<p>About a minute and a half later you have a finished vertical video. You never pick up a camera and you never edit anything.</p>\n<h2>Every video gets its own page</h2>\n<p>The video sits on a share page with a headline, your name and one button. The button goes wherever you choose. Send the page with a ready-made message, or hold up the QR code and let someone scan it in person.</p>\n<h2>Know who watched</h2>\n<p>This is the part most people have never had. You can make a link for one person and the page greets them by name. Then you see what they did: whether they opened it, how much they watched and whether they tapped your button. You follow up with the people who showed interest, not the ones who didn't.</p>\n<h2>Pay for what you use</h2>\n<p>Your first video is free, with no card and no purchase. After that a video is 10 credits. A $10 pack is 100 credits, enough for 10 videos. You pay in POL on Polygon, one time. There is no subscription and credits do not expire.</p>\n<h2>The earning side</h2>\n<p>You can use the app only for your own offers and never refer anyone. If you want to share it, here is how that works. Once you've bought credits, you can refer others. When someone you referred buys credits, a smart contract splits the payment in that same transaction: 30% to you, and 8% to each of the five positions above the buyer in the team matrix. It happens again every time they top up. The percentages are written into the contract and nobody can change them, including us. Every purchase and payout is public on the Polygon ledger.</p>\n<h2>Try it</h2>\n<p>Sign in with SafePal or any other crypto wallet, or with your InstantAdPay account. Make your first video free and see what comes back.</p>\n<p><a href=\"https://videoappincome.com/join?ref=martbost\" target=\"_blank\">Make your first video free on Video App Income</a></p>\n<p><a href=\"https://videoappincome.com/m/how-it-works.mp4\" target=\"_blank\">Watch the three-minute walkthrough</a></p>\n<p><em>No income is guaranteed. Most members will earn little or nothing. What you earn depends on your own effort and on purchases made by people you refer. Payouts are in POL, a cryptocurrency whose price changes.</em></p>\n<p>Video App Income also has its own page here, with the payouts its contract has made so far: <a href=\"/earn/video-app-income\">Video App Income on Stack POL</a>.</p>",
"faq": [
{
"q": "Is the first video really free?",
"a": "Yes. Your first video is free, with no card and no purchase. After that a video is 10 credits."
},
{
"q": "What does a credit cost?",
"a": "One credit is 10 cents. A $10 pack is 100 credits, enough for 10 videos. You pay one time in POL on Polygon, and there is no subscription."
},
{
"q": "How does the earning side work?",
"a": "Once you have bought credits, you can refer others. When someone you referred buys credits, the contract pays 30% to you and 8% to each of the five positions above the buyer, in that same transaction. No income is guaranteed."
}
]
}
@@ -0,0 +1,31 @@
{
"slug": "what-is-pol-polygon-guide-for-earners",
"title": "What Is POL (Formerly MATIC)? A Plain Guide for Earners",
"seoTitle": "What Is POL (Formerly MATIC)? A Plain Guide for Earners",
"excerpt": "POL is the native token of the Polygon network, formerly MATIC. Here is what it is, why small payouts work on it, which wallets hold it, and how to move it.",
"cover": "/og-stackpol-1200x630.jpg",
"coverAlt": "What is POL on Polygon",
"tags": [
"polygon",
"pol",
"wallets",
"beginners"
],
"publishedAt": "2026-11-09T14:15:00-06:00",
"updated": "2026-11-09T14:15:00-06:00",
"body": "<p>Every payout on Stack POL is in POL. If you are new to crypto, that raises a fair question: what exactly are you being paid in? Here is the plain version, written for people who earn POL rather than trade it.</p>\n<h2>Polygon and POL in one paragraph</h2>\n<p>Polygon is a blockchain network that runs alongside Ethereum. It started in 2017 under the name Matic Network, built to make transactions faster and cheaper than on Ethereum itself. The network went live in 2020, rebranded to Polygon in 2021, and in 2024 its token changed from MATIC to <b>POL</b>. Same network, new name. When you see older guides mention MATIC, they mean the token that is now POL.</p>\n<h2>Why small payouts work on Polygon</h2>\n<p>On many blockchains, sending a small amount costs more in fees than the amount itself. On Polygon, a transfer usually costs a fraction of a cent and confirms in a few seconds. That is what makes it practical for a game to send you a reward of a few cents, or for an ad platform to pay four levels of a sponsor line in one transaction.</p>\n<h2>Which wallet holds POL?</h2>\n<p>Any wallet that supports the Polygon network can hold POL. Common choices include MetaMask, Trust Wallet and SafePal. Add or switch on the Polygon network in the wallet, copy your address (it starts with 0x), and paste it into your account. That one address receives payouts from every program on Stack POL.</p>\n<ul><li><b>Keep your recovery phrase offline.</b> Nobody from any program will ever ask for it.</li>\n<li><b>Use the same address everywhere.</b> Your Stack POL page adds up payouts by wallet, so one address keeps your stack in one place.</li>\n<li><b>Keep a little POL for fees.</b> Moving POL out of your wallet costs a tiny fee, paid in POL.</li></ul>\n<h2>What can you do with POL?</h2>\n<p>You can hold it, send it to another wallet, or exchange it for another currency on a major exchange that lists POL. Inside the network, you can also use it to buy advertising on InstantAdPay. Prices move every day, so the dollar value of the same POL changes over time.</p>\n<h2>Checking that you were paid</h2>\n<p>Because Polygon is public, every payout can be looked up. Paste your wallet address into <a href=\"https://polygonscan.com\" target=\"_blank\" rel=\"noopener\">Polygonscan</a> and you will see every transaction in and out. Our step-by-step guide on <a href=\"/blog/how-to-check-a-payout-on-polygonscan\">checking a payout</a> shows exactly where to look.</p>\n<p><i>This is general information, not investment advice. Cryptocurrency prices go up and down, and you can lose money.</i></p>",
"faq": [
{
"q": "Is POL the same as MATIC?",
"a": "Yes, in practice. MATIC was the original token of the Polygon network; in 2024 it became POL. The network and how you use it stayed the same."
},
{
"q": "Do I need to buy POL to earn it?",
"a": "No. The games pay POL to the wallet on your account. You only need a small amount of POL if you want to send it somewhere else, to cover the transfer fee."
},
{
"q": "What network do I pick in my wallet?",
"a": "Polygon (sometimes listed as Polygon PoS or Polygon Mainnet, chain ID 137)."
}
]
}
+30
View File
@@ -0,0 +1,30 @@
{
"slug": "what-is-stack-pol",
"title": "What Is Stack POL? Every POL Payout in the Network, in One Place",
"seoTitle": "What Is Stack POL? Every POL Payout in One Place",
"excerpt": "Stack POL adds up every POL payout from InstantAdPay, LinkSpin and the network games, refreshes every 5 minutes, and links every payment to Polygonscan so anyone can check it.",
"cover": "/og-stackpol-1200x630.jpg",
"coverAlt": "Stack POL: every POL the network pays, stacked in one place",
"tags": [
"stack pol",
"polygon",
"payouts"
],
"publishedAt": "2026-11-09T14:00:00-06:00",
"updated": "2026-11-09T15:00:00-06:00",
"body": "<p>If you have been in the network for a while, your POL probably arrives from several places. A referral payment from InstantAdPay. A drip from PolHunter. A chapter reward from SpellWheel. A weekly prize from Turkey Drop. Each one lands in your wallet, and each one is a separate line on Polygonscan.</p>\n<p>Stack POL puts those lines back together. It is one page that adds up every POL payout across the network, shows where each one came from, and links every single payment to its transaction on the Polygon chain.</p>\n<h2>What you see on Stack POL</h2>\n<ul><li><b>The network total.</b> Everything every program has paid to members so far, refreshed every 5 minutes. On November 9, 2026 that was 37,663 POL across 6,882 payments to 164 wallets.</li>\n<li><b>One card per program.</b> InstantAdPay, LinkSpin and every game that pays POL, each with its own total and number of payments.</li>\n<li><b>The public ledger.</b> The latest 300 payouts, newest first: the program, the member it was paid to, the amount and a link to Polygonscan.</li>\n<li><b>Member stacks.</b> A member who switches it on gets their own page at stackpol.com/their-username, showing their own total and where it came from.</li></ul>\n<h2>Where the numbers come from</h2>\n<p>Nothing on Stack POL is typed in by hand. A small indexer reads each program's own payout records every 5 minutes, plus the payment events the InstantAdPay and LinkSpin smart contracts write to Polygon. Pages read that snapshot, so the site stays fast, and the chain stays the source of truth: every row carries its transaction hash.</p>\n<p>That matters because the network was built so payments are checkable. InstantAdPay and LinkSpin pay the sponsor line in the same transaction as the purchase, and the games send POL straight from their own payout wallets. Stack POL simply makes all of that visible in one place.</p>\n<h2>Your own stack page</h2>\n<p>Member pages are opt-in. The ledger shows each payout's username, the same name members already use across the network, but only members who switch it on get a page of their own. To get yours, join <a href=\"https://instantadpay.com/join/martbost?src=stackpol\">InstantAdPay</a> free, link a wallet, and switch on your Stack POL page in Promo tools. Your page updates every 5 minutes and carries your own referral links on every program card, so it works as a proof page you can share.</p>\n<h2>An honest note</h2>\n<p>The totals are what the whole network has paid out, added together. They are not a forecast for any one person. What a member stacks depends on what they do, and many members earn little or nothing. Cryptocurrency involves risk. Stack POL shows payouts; it never holds or sends anyone's money.</p>",
"faq": [
{
"q": "Is Stack POL a wallet?",
"a": "No. Stack POL only shows payouts. Every payment goes from the program straight to the member's own wallet on Polygon."
},
{
"q": "How often does Stack POL update?",
"a": "Every 5 minutes. The indexer reads each program's payout records and the InstantAdPay and LinkSpin contract events, then refreshes the site."
},
{
"q": "Who gets a Stack POL page?",
"a": "Any member who switches it on in InstantAdPay Promo tools. The ledger shows each payout with its username either way; the page adds your own total and your referral links on every program."
}
]
}
+210
View File
@@ -0,0 +1,210 @@
// Database-backed data documents (Marty 2026-11-13, standing rule: "everything database-driven ... files only for early
// prototyping"). Every *.json / *.jsonl data document under DATA_DIR that a module reads or writes with the fs *Sync calls lives
// in MySQL instead of on the volume: table `docs` (name = path relative to DATA_DIR, body LONGTEXT, updated_at). The modules keep
// their code; install() routes their fs calls on those paths to an in-memory copy that init() loads from MySQL at boot, and every
// change is written through to MySQL (coalesced per document, newest body wins, in order, retried until it lands).
//
// One writer at a time: init() claims the `docs_writer` row; an older app copy still running during a deploy finds the row taken
// and stops writing (logged), so it can never put stale data over the new copy's (the 2026-11-13 rotator.json loss).
// First boot: a document missing from MySQL is imported from its file, and the file is renamed <name>.imported-<date> (kept, not
// read again). Files the volume keeps on purpose: KEEP (rebuildable caches, uploads, images, the geo database, queues read by
// listing a folder). The SAME file ships in InstantAdPay and LinkSpin.
'use strict';
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
const KEEP_FILES = new Set(['chain-index.json']); // a rebuildable cache of the blockchain
const KEEP_DIRS = ['uploads', 'geo', 'refuel-pending', 'backups', 'marks', 'kits', 'kitimg']; // binary files, or folders read by listing
const O = { readFileSync: fs.readFileSync, writeFileSync: fs.writeFileSync, existsSync: fs.existsSync, renameSync: fs.renameSync,
unlinkSync: fs.unlinkSync, statSync: fs.statSync, appendFileSync: fs.appendFileSync };
let ROOT = null, pool = null, ME = crypto.randomBytes(8).toString('hex'), ready = false, writer = true;
const cache = new Map(); // name -> { body: string, at: ms }
const pending = new Map(); // name -> body string | null (delete)
const stored = new Map(); // name -> body as last read from or written to MySQL: an unchanged save is not rewritten (2026-11-15: whole-document rewrites filled core with 115 GB of binlogs)
let flushing = false, timer = null;
const stats = { writes: 0, deletes: 0, refused: 0, errors: 0, imported: 0, lastError: null };
function nameOf(p) {
if (!ROOT || typeof p !== 'string' || !/\.jsonl?$/i.test(p)) return null;
const abs = path.resolve(p); if (!abs.startsWith(ROOT + path.sep)) return null;
const rel = abs.slice(ROOT.length + 1).split(path.sep).join('/');
if (KEEP_FILES.has(rel) || KEEP_DIRS.some(d => rel === d || rel.startsWith(d + '/'))) return null;
return rel;
}
const enoent = p => { const e = new Error("ENOENT: no such file or directory, open '" + p + "'"); e.code = 'ENOENT'; e.errno = -2; e.path = p; return e; };
const enc = o => (typeof o === 'string' ? o : o && o.encoding) || null;
function put(name, body) {
cache.set(name, { body, at: Date.now() });
if (stored.get(name) === body) { pending.delete(name); return; } // same as what MySQL already holds: nothing to write
pending.set(name, body); kick();
}
function drop(name) { cache.delete(name); pending.set(name, null); kick(); }
function kick() { if (!timer) timer = setTimeout(() => { timer = null; flush().catch(() => {}); }, 300); }
async function flush() {
if (!pool || flushing || !pending.size) return;
flushing = true;
try {
for (const [name, body] of [...pending]) {
if (pending.get(name) !== body) continue; // replaced while we were busy: the newer body goes next round
if (!writer) { pending.delete(name); stats.refused++; continue; }
const c = await pool.getConnection();
try {
await c.beginTransaction();
const [[w]] = await c.query('SELECT owner FROM docs_writer WHERE id = 1 FOR UPDATE');
if (!w || w.owner !== ME) { await c.rollback(); writer = false; pending.delete(name); stats.refused++; console.error('docstore: another app copy took over writing; this copy stops writing'); continue; }
if (body === null) { await c.query('DELETE FROM docs WHERE name = ?', [name]); stats.deletes++; }
else { await c.query('INSERT INTO docs (name, body, updated_at) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE body = VALUES(body), updated_at = VALUES(updated_at)', [name, body, Date.now()]); stats.writes++; }
await c.commit();
if (body === null) stored.delete(name); else stored.set(name, body);
if (pending.get(name) === body) pending.delete(name);
} catch (e) { try { await c.rollback(); } catch (x) {} stats.errors++; stats.lastError = String(e.message).slice(0, 200); console.error('docstore write', name, e.message); }
finally { c.release(); }
}
} finally { flushing = false; if (pending.size) setTimeout(() => flush().catch(() => {}), 1000); }
}
// Route the fs *Sync calls on data documents. Installed before any module runs; until init() the documents read from disk.
function install(dataDir) {
if (ROOT) return; ROOT = path.resolve(dataDir);
fs.readFileSync = function (p, o) {
if (!ready && process.env.DOCSTORE_URL && nameOf(p)) console.error('docstore: read before init', p, new Error().stack.split('\n')[2]);
const n = ready ? nameOf(p) : null; if (!n) return O.readFileSync.apply(fs, arguments);
const d = cache.get(n); if (!d) throw enoent(p);
return enc(o) ? d.body : Buffer.from(d.body, 'utf8');
};
fs.existsSync = function (p) { const n = ready ? nameOf(p) : null; return n ? cache.has(n) : O.existsSync.apply(fs, arguments); };
fs.writeFileSync = function (p, data, o) {
const n = ready ? nameOf(p) : null; if (!n) return O.writeFileSync.apply(fs, arguments);
const flag = o && typeof o === 'object' ? o.flag : null;
const s = Buffer.isBuffer(data) ? data.toString('utf8') : String(data);
put(n, flag && flag[0] === 'a' ? ((cache.get(n) || {}).body || '') + s : s);
};
fs.appendFileSync = function (p, data) {
const n = ready ? nameOf(p) : null; if (!n) return O.appendFileSync.apply(fs, arguments);
put(n, ((cache.get(n) || {}).body || '') + (Buffer.isBuffer(data) ? data.toString('utf8') : String(data)));
};
fs.renameSync = function (a, b) {
const nb = ready ? nameOf(b) : null; const na = ready ? nameOf(a) : null;
if (!nb && !na) return O.renameSync.apply(fs, arguments);
let body;
if (na) { const d = cache.get(na); if (!d) throw enoent(a); body = d.body; drop(na); }
else { body = O.readFileSync.call(fs, a, 'utf8'); try { O.unlinkSync.call(fs, a); } catch (e) {} }
if (nb) put(nb, body); else O.writeFileSync.call(fs, b, body);
};
fs.unlinkSync = function (p) { const n = ready ? nameOf(p) : null; if (!n) return O.unlinkSync.apply(fs, arguments); if (!cache.has(n)) throw enoent(p); drop(n); };
fs.statSync = function (p, o) {
const n = ready ? nameOf(p) : null; if (!n) return O.statSync.apply(fs, arguments);
const d = cache.get(n); if (!d) { if (o && o.throwIfNoEntry === false) return undefined; throw enoent(p); }
const size = Buffer.byteLength(d.body, 'utf8'); const t = new Date(d.at);
return { size, mtimeMs: d.at, mtime: t, ctime: t, birthtime: t, isFile: () => true, isDirectory: () => false, isSymbolicLink: () => false };
};
}
// Connect, claim writing, load every document, import files MySQL does not have yet. Throws if MySQL is unreachable: the app
// must not run on an empty copy.
async function init(opts) {
const url = String(process.env.DOCSTORE_URL || '').trim();
if (!url) { console.log('docstore: no DOCSTORE_URL, documents stay files (prototype mode)'); return false; }
const mysql = require('mysql2/promise');
pool = mysql.createPool({ uri: url, connectionLimit: 6, charset: 'utf8mb4' });
await pool.query('CREATE TABLE IF NOT EXISTS docs (name VARCHAR(190) PRIMARY KEY, body LONGTEXT NOT NULL, updated_at BIGINT NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4');
await pool.query('CREATE TABLE IF NOT EXISTS docs_writer (id TINYINT PRIMARY KEY, owner VARCHAR(40) NOT NULL, at BIGINT NOT NULL) ENGINE=InnoDB');
await pool.query('INSERT INTO docs_writer (id, owner, at) VALUES (1, ?, ?) ON DUPLICATE KEY UPDATE owner = VALUES(owner), at = VALUES(at)', [ME, Date.now()]);
const [rows] = await pool.query('SELECT name, body, updated_at FROM docs');
for (const r of rows) { cache.set(r.name, { body: r.body, at: Number(r.updated_at) }); stored.set(r.name, r.body); }
for (const sp of (opts && opts.splits) || []) await openSplit(sp);
// first boot for any document: import its file, then set the file aside
const stamp = new Date().toISOString().slice(0, 10);
const walk = dir => { let out = []; let ents = []; try { ents = fs.readdirSync(dir, { withFileTypes: true }); } catch (e) {} for (const e of ents) { const p = path.join(dir, e.name); if (e.isDirectory()) out = out.concat(walk(p)); else out.push(p); } return out; };
for (const p of walk(ROOT)) {
const n = nameOf(p); if (!n || cache.has(n)) continue;
const body = O.readFileSync.call(fs, p, 'utf8');
if (/\.json$/i.test(n) && body.trim()) { try { JSON.parse(body); } catch (e) { throw new Error('docstore: ' + n + ' is not valid JSON; fix or move it before switching to MySQL'); } }
await pool.query('INSERT INTO docs (name, body, updated_at) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE name = name', [n, body, Date.now()]);
const [[got]] = await pool.query('SELECT body FROM docs WHERE name = ?', [n]);
cache.set(n, { body: got.body, at: Date.now() }); stats.imported++;
O.renameSync.call(fs, p, p + '.imported-' + stamp);
}
for (const sp of (opts && opts.splits) || []) await migrateSplit(sp);
ready = true;
console.log('docstore: MySQL documents ready,', cache.size, 'documents,', stats.imported, 'imported from files this boot');
const shut = () => { flush().catch(() => {}).finally(() => {}); };
process.once('beforeExit', shut);
return true;
}
// ---- row tables: an ever-growing array (spin-link clicks) is one row per item, never a rewrite of the whole document ----
// spec { doc: 'rotator.json', field: 'hits', table: 'rot_hits', key: 'id', ts: 'ts' }. rows(table) gives the loaded items (oldest
// first); the module inserts / deletes rows itself and saves its document WITHOUT the field.
const ROWS = new Map(); const rowQ = []; let rowBusy = false;
async function openSplit(sp) {
await pool.query('CREATE TABLE IF NOT EXISTS `' + sp.table + '` (id VARCHAR(64) PRIMARY KEY, ts BIGINT NOT NULL, body MEDIUMTEXT NOT NULL, KEY ts (ts)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4');
const [r] = await pool.query('SELECT body FROM `' + sp.table + '` ORDER BY ts, id');
ROWS.set(sp.table, r.map(x => JSON.parse(x.body)));
}
async function insertMany(table, items, key, ts) {
for (let i = 0; i < items.length; i += 500) {
const part = items.slice(i, i + 500);
await pool.query('INSERT INTO `' + table + '` (id, ts, body) VALUES ? ON DUPLICATE KEY UPDATE body = VALUES(body), ts = VALUES(ts)', [part.map(x => [String(x[key]), Number(x[ts]) || 0, JSON.stringify(x)])]);
}
}
// first boot: the array still inside the document moves to its table, then the document is saved without it
async function migrateSplit(sp) {
const d = cache.get(sp.doc); if (!d) return;
let obj; try { obj = JSON.parse(d.body); } catch (e) { return; }
const arr = Array.isArray(obj[sp.field]) ? obj[sp.field] : null; if (!arr || !arr.length) return;
await insertMany(sp.table, arr, sp.key, sp.ts);
const [[{ n }]] = await pool.query('SELECT COUNT(*) n FROM `' + sp.table + '`');
if (n < arr.length) throw new Error('docstore: ' + sp.table + ' holds ' + n + ' rows after moving ' + arr.length + '; stopping before the document is changed');
const seen = new Set((ROWS.get(sp.table) || []).map(x => String(x[sp.key]))); const merged = (ROWS.get(sp.table) || []).concat(arr.filter(x => !seen.has(String(x[sp.key]))));
merged.sort((a, b) => (Number(a[sp.ts]) || 0) - (Number(b[sp.ts]) || 0)); ROWS.set(sp.table, merged);
obj[sp.field] = []; const body = JSON.stringify(obj);
await pool.query('UPDATE docs SET body = ?, updated_at = ? WHERE name = ?', [body, Date.now(), sp.doc]); cache.set(sp.doc, { body, at: Date.now() });
console.log('docstore:', arr.length, sp.field, 'moved from', sp.doc, 'to table', sp.table);
}
function rows(table) { return ROWS.get(table) || null; }
function rowOp(op) { if (!pool || !writer) return; rowQ.push(op); if (!rowBusy) runRows(); }
async function runRows() {
rowBusy = true;
try {
while (rowQ.length && writer) {
const op = rowQ[0];
try {
if (op.del) await pool.query('DELETE FROM `' + op.table + '` WHERE id IN (?)', [op.ids]);
else await pool.query('INSERT INTO `' + op.table + '` (id, ts, body) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE body = VALUES(body), ts = VALUES(ts)', [op.id, op.ts, op.body]);
rowQ.shift();
} catch (e) { stats.errors++; stats.lastError = String(e.message).slice(0, 200); await new Promise(r => setTimeout(r, 1000)); }
}
} finally { rowBusy = false; }
}
const rowPut = (table, id, ts, obj) => rowOp({ table, id: String(id), ts: Number(ts) || 0, body: JSON.stringify(obj) });
const rowDel = (table, ids) => { const list = [...ids].map(String); for (let i = 0; i < list.length; i += 1000) rowOp({ table, del: true, ids: list.slice(i, i + 1000) }); };
function isOn() { return ready && !!pool; }
// once across app copies (two run side by side during a deploy): true for the first caller of a key, false after. Without MySQL: true.
async function claim(key) {
if (!pool) return true;
await pool.query('CREATE TABLE IF NOT EXISTS doc_claims (k VARCHAR(190) PRIMARY KEY, at BIGINT NOT NULL) ENGINE=InnoDB');
const [r] = await pool.query('INSERT IGNORE INTO doc_claims (k, at) VALUES (?, ?)', [String(key).slice(0, 190), Date.now()]);
return r.affectedRows === 1;
}
// SIGTERM during a deploy: write what is pending, then exit
async function drain(ms) { const end = Date.now() + (ms || 8000); while ((pending.size || flushing || rowQ.length || rowBusy) && Date.now() < end) { await flush().catch(() => {}); await new Promise(r => setTimeout(r, 100)); } }
function view() { return Object.assign({ ready, writer, documents: cache.size, pending: pending.size, rowQueue: rowQ.length, rowTables: Object.fromEntries([...ROWS].map(([k, v]) => [k, v.length])), bytes: [...cache.values()].reduce((t, d) => t + d.body.length, 0) }, stats); }
const names = () => [...cache.keys()]; // every document name (the member erase walks them all, 2026-11-15)
// member erase (2026-11-15): count or delete the rows of a row table whose JSON body has `field` (e.g. '$.r') in `values`. Waits
// for queued row writes first, so a click queued before the erase cannot land after it.
async function rowsWhere(table, field, values, del) {
if (!pool || !values.length) return 0;
for (let i = 0; i < 100 && (rowQ.length || rowBusy); i++) await new Promise(r => setTimeout(r, 100));
const vals = values.map(String); const where = 'CAST(JSON_UNQUOTE(JSON_EXTRACT(body, ?)) AS CHAR) IN (?)';
if (!del) { const [[r]] = await pool.query('SELECT COUNT(*) n FROM `' + table + '` WHERE ' + where, [field, vals]); return Number(r.n); }
if (!writer) return 0;
const [r] = await pool.query('DELETE FROM `' + table + '` WHERE ' + where, [field, vals]);
const mem = ROWS.get(table); if (mem) { const k = field.replace(/^\$\./, ''); ROWS.set(table, mem.filter(x => !vals.includes(String(x[k])))); }
return Number(r.affectedRows || 0);
}
module.exports = { install, init, drain, flush, view, nameOf, rows, rowPut, rowDel, isOn, claim, names, rowsWhere };
+52
View File
@@ -0,0 +1,52 @@
// The Stack POL page switch, read and written from stackpol.com/my (Marty approved the My Stack POL area 2026-11-19).
//
// ONE PLACE FOR THE SWITCH. The switch lives in InstantAdPay: its document stack-optin.json { users: { username: true|false },
// pro: { username: true } } (an IAP MySQL document), written by IAP's Promo tools > Stack POL toggle (POST /api/my/stackpol). The
// Stack POL indexer reads that document every 5 minutes. Stack POL never keeps a second copy: a switch made here is sent to IAP, which
// writes the same document with the same code, so the two can never disagree.
//
// THE INTERFACE IAP NEEDS (not built in IAP yet; until it is, configured() is false and /my links to IAP's Promo tools instead):
// POST <IAP_URL>/api/partner/stackpol/switch
// Headers: Content-Type: application/json
// X-Stack-Ts: milliseconds since 1970 (IAP refuses anything more than 5 minutes from its own clock)
// X-Stack-Sig: hex HMAC-SHA256(STACKPOL_SWITCH_KEY, X-Stack-Ts + "\n" + raw body)
// Body: { "email": "<the member's email, from their network sign-in>" } read only
// { "email": "...", "on": true|false } switch it
// IAP does: verify the signature and the time (timingSafeEqual), find the account by email (accounts.byEmail), refuse when there is
// none (404) or it has no username (409), then run the SAME code as /api/my/stackpol: so.users[un] = !!on when `on` is given, refresh
// so.pro[un] from gamepass.stackProView(email), write stack-optin.json atomically (tmp + rename), and answer
// 200 { "on": so.users[un] !== false, "username": un, "pro": !!pv.pro }.
// The secret is a new env on BOTH apps, the same value: STACKPOL_SWITCH_KEY (32+ characters). IAP_URL on Stack POL is optional
// (default https://instantadpay.com).
// Only Stack POL can call it (the key), only for the member signed in on Stack POL (the email comes from their verified hub token),
// and it changes nothing but the page switch.
'use strict';
const crypto = require('crypto');
const KEY = () => String(process.env.STACKPOL_SWITCH_KEY || '').trim();
const BASE = () => String(process.env.IAP_URL || 'https://instantadpay.com').trim().replace(/\/+$/, '');
const ROUTE = '/api/partner/stackpol/switch';
const configured = () => KEY().length >= 32 && /^https?:\/\/[a-z0-9.:-]+$/i.test(BASE());
const sign = (ts, raw) => crypto.createHmac('sha256', KEY()).update(ts + '\n' + raw).digest('hex');
// -> { ok: true, on, username, pro } or { ok: false, reason }
async function call(body, ms) {
if (!configured()) return { ok: false, reason: 'off' };
if (typeof fetch !== 'function') return { ok: false, reason: 'no fetch' };
const raw = JSON.stringify(body); const ts = String(Date.now());
const ac = new AbortController(); const tm = setTimeout(() => ac.abort(), ms || 3000);
try {
const r = await fetch(BASE() + ROUTE, { method: 'POST', body: raw, signal: ac.signal, headers: { 'Content-Type': 'application/json', 'X-Stack-Ts': ts, 'X-Stack-Sig': sign(ts, raw), 'User-Agent': 'stackpol-my' } });
let j = null; try { j = await r.json(); } catch (e) {}
if (r.status !== 200 || !j || typeof j.on !== 'boolean') return { ok: false, reason: 'iap ' + r.status + (j && j.error ? ': ' + String(j.error).slice(0, 120) : '') };
const un = String(j.username || '').toLowerCase();
return { ok: true, on: j.on, username: /^[a-z0-9_]{3,30}$/.test(un) ? un : null, pro: !!j.pro };
} catch (e) { return { ok: false, reason: 'iap unreachable' }; }
finally { clearTimeout(tm); }
}
const get = email => call({ email: String(email || '').toLowerCase() }, 2500);
const set = (email, on) => call({ email: String(email || '').toLowerCase(), on: !!on }, 5000);
// the deep link to IAP's own toggle (always works, needs no key)
const promoUrl = () => BASE() + '/my#promo?s=stackpol';
module.exports = { configured, get, set, promoUrl, sign, ROUTE };
+289
View File
@@ -0,0 +1,289 @@
// Knowledge base behind the site assistant (Marty's support-desk plan, 2026-10-20).
// The chatbot answers from maintained entries, and good support replies become entries.
//
// An entry: { id, title, questions[], answer, tags[], pattern, handoff, order, source, ticketRef,
// updated, created, edited, deleted, seedHash }
// pattern optional regex (case-insensitive). Entries with one are the instant CANNED fast path:
// the first pattern that matches (lowest order) is the reply, no AI call. The CANNED list
// in chatbot.js seeds these, so there is ONE source: edit the answer here and the fast
// path serves the new text.
// source canned | faq | ticket | admin
//
// Retrieval: BM25 over title, question variants and tags, plus the answer text at a low weight, with
// word bigrams so phrase overlap counts more than scattered words. No embeddings, no external calls.
// The top hits go into the AI system prompt as "Knowledge base" context (chatbot.js).
//
// Seeds stay in step with the code: an entry that came from a seed and was never edited in the admin
// pane is refreshed when the seed text changes; an edited one is left alone; a deleted seed stays
// deleted (tombstone row), and a seed dropped from the code is retired unless an admin edited it.
//
// Store: DATA_DIR/kb.json (written to a temp file and renamed), which docstore.js keeps in MySQL when DOCSTORE_URL is set
// (Marty's database rule). Ported from LinkSpin's kb.js (2026-11-15); keep the scoring and seed rules in step.
//
// NETWORK (2026-11-15, netkb.js): the other network sites' entries, read from the hub, sit in the same index. This site's
// own entries are boosted first (HOME_BOOST); a question that names another site boosts that site's entries instead
// (NAMED_BOOST). Other sites' entries never take the instant-answer fast path: they only ride along as context, labelled
// with the site and the link to send people to. This site's own entries are published to the hub (netkb.publish).
// The SAME file ships in ViralAdBlitz, DownlineHydra, 5xYourTeam, Viral Banner Blitz, Downline Banners and Stack POL.
const fs = require('fs');
const path = require('path');
const crypto = require('crypto');
let netkb = null; try { netkb = require('./netkb'); } catch (e) {}
let DATA_DIR = null, SEEDS = [], ready = null, SITE_URL = '', HELP_TEXT = '', MEMORY = false;
let cache = null, cacheAt = 0, index = null, netVer = '';
const TTL = 30000; // two app copies share the volume for about 30 s during a deploy: re-read now and then
// ---------------------------------------------------------------- text + scoring (pure, unit-tested)
const STOP = new Set(('a an and are as at be been being but by can could do does did doing for from has have having how i if in into is it its '
+ 'me my of on or our ours so than that the their them then there these they this those to too us was we were what when where which who whom why '
+ 'will with would you your yours im ive id am just also any about please hi hello hey thanks thank ok okay really very much some there here '
+ 'should shall may might must anyone someone something thing things want wanted like know tell').split(' '));
const SYN = { paid: 'pay', payment: 'pay', payments: 'pay', paying: 'pay', withdrawal: 'withdraw', withdrawals: 'withdraw', cashout: 'withdraw',
signup: 'join', register: 'join', registration: 'join', joining: 'join', joined: 'join', login: 'log', logged: 'log', logout: 'log', signin: 'log',
wallets: 'wallet', email: 'email', mail: 'email', pol: 'pol', matic: 'pol', prices: 'price', pricing: 'price', cost: 'price', costs: 'price',
ads: 'ad', advert: 'ad', adverts: 'ad', advertising: 'ad', referrals: 'referral', refer: 'referral', referring: 'referral', referred: 'referral' };
function stem(w) {
if (SYN[w]) return SYN[w];
if (w.length > 6 && w.endsWith('able')) return w.slice(0, -4);
if (w.length > 5 && w.endsWith('ing')) return w.slice(0, -3);
if (w.length > 4 && w.endsWith('ies')) return w.slice(0, -3) + 'y';
if (w.length > 4 && w.endsWith('ed') && !w.endsWith('eed')) return w.slice(0, -2);
if (w.length > 3 && w.endsWith('s') && !w.endsWith('ss') && !w.endsWith('us')) return w.slice(0, -1);
return w;
}
function words(text) {
return String(text || '').toLowerCase().replace(/['’]/g, '').replace(/[^a-z0-9$]+/g, ' ').split(' ')
.filter(w => w && !STOP.has(w) && (w.length > 1 || /\d/.test(w))).map(stem);
}
// unigrams + bigrams of the content words: "coinbase account" scores as a phrase, not two loose words
function terms(text) {
const w = words(text), out = w.slice();
for (let i = 0; i + 1 < w.length; i++) out.push(w[i] + '_' + w[i + 1]);
return out;
}
const FIELDS = { title: 2.0, questions: 2.5, tags: 2.0, answer: 0.35 };
const K1 = 1.2, B = 0.75;
function fieldText(e, f) {
if (f === 'questions') return (e.questions || []).join(' . ');
if (f === 'tags') return (e.tags || []).join(' . ');
return e[f] || '';
}
function buildIndex(entries) {
const docs = entries.map(e => {
const d = { e, f: {} };
for (const f of Object.keys(FIELDS)) {
const t = terms(fieldText(e, f)), tf = new Map();
for (const x of t) tf.set(x, (tf.get(x) || 0) + 1);
d.f[f] = { tf, len: t.length };
}
return d;
});
const df = new Map(), avg = {};
for (const f of Object.keys(FIELDS)) avg[f] = docs.reduce((s, d) => s + d.f[f].len, 0) / Math.max(1, docs.length) || 1;
for (const d of docs) {
const seen = new Set();
for (const f of Object.keys(FIELDS)) for (const t of d.f[f].tf.keys()) seen.add(t);
for (const t of seen) df.set(t, (df.get(t) || 0) + 1);
}
return { docs, df, avg, n: docs.length };
}
const HOME_BOOST = 2, NAMED_BOOST = 3;
// which network sites a question names, by the site name or a short alias ("dlb", "vbb", "iap", ...)
const ALIASES = { iap: ['iap', 'instant ad pay'], linkspin: ['link spin'], bannerline: ['dlb', 'downline banner', 'downline banners'], vbb: ['vbb', 'viral banner'],
viraladblitz: ['vab', 'viral ad blitz'], downlinehydra: ['hydra', 'dh'], fivex: ['5x', '5x your team', 'five x', 'the draft'], stackpol: ['stack pol', 'stackpol'] };
const norm = s => ' ' + String(s || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim() + ' ';
function namedSites(query, idx) {
const q = norm(query); const out = new Set();
for (const s of (idx && idx.sites) || []) {
const names = [s.name, s.site].concat(ALIASES[s.site] || []).map(norm);
if (names.some(n => n.trim() && q.includes(n))) out.add(s.site);
}
return out;
}
// does the question name a network site other than this one (hub site id `self`)? Then the home fast path stands aside and the
// answer comes from retrieval over the whole network (a "how much" about another site must not get this site's price).
const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz',
downlinehydra: 'DownlineHydra', fivex: '5xYourTeam', stackpol: 'Stack POL', earnerscorner: 'Earners Corner' };
function namesOther(query, self) {
const q = norm(query); const out = [];
const ids = new Set(Object.keys(NAMES).concat(((index && index.sites) || []).map(s => s.site)));
for (const id of ids) {
if (id === self) continue;
const s = ((index && index.sites) || []).find(x => x.site === id) || {};
const names = [s.name, NAMES[id], id.length > 3 ? id : ''].concat(ALIASES[id] || []).filter(Boolean).map(norm);
if (names.some(n => n.trim() && q.includes(n))) out.push(id);
}
return out;
}
function rank(idx, query, k) {
if (!idx || !idx.n) return [];
const qt = [...new Set(terms(query))];
if (!qt.length) return [];
const named = namedSites(query, idx);
const out = [];
for (const d of idx.docs) {
let s = 0;
for (const t of qt) {
const n = idx.df.get(t); if (!n) continue;
const idf = Math.log(1 + (idx.n - n + 0.5) / (n + 0.5)) * (t.includes('_') ? 1.5 : 1);
for (const f of Object.keys(FIELDS)) {
const tf = d.f[f].tf.get(t); if (!tf) continue;
s += FIELDS[f] * idf * (tf * (K1 + 1)) / (tf + K1 * (1 - B + B * d.f[f].len / idx.avg[f]));
}
}
if (s > 0 && d.e.site) s *= named.has(d.e.site) ? NAMED_BOOST : 1;
else if (s > 0) s *= named.size ? 1 : HOME_BOOST;
if (s > 0) out.push({ entry: d.e, score: Math.round(s * 100) / 100 });
}
out.sort((a, b) => b.score - a.score);
return out.slice(0, k || 5);
}
// keep hits that are close to the best one, and only when the best is a real match
const MIN_SCORE = 3;
function relevant(hits) {
if (!hits.length || hits[0].score < MIN_SCORE) return [];
const floor = Math.max(MIN_SCORE, hits[0].score * 0.3);
return hits.filter(h => h.score >= floor);
}
// ---------------------------------------------------------------- store
const mem = { entries: [] }; // a site with no data volume (Stack POL): seeds in memory only
const J = {
file: () => path.join(DATA_DIR, 'kb.json'),
async ensure() {},
async all() { if (MEMORY) return mem.entries.slice(); try { const d = JSON.parse(fs.readFileSync(J.file(), 'utf8')); return Array.isArray(d.entries) ? d.entries : []; } catch (e) { return []; } },
async put(e) {
const all = await J.all(), i = all.findIndex(x => x.id === e.id);
if (i >= 0) all[i] = e; else all.push(e);
if (MEMORY) { mem.entries = all; return; }
const tmp = J.file() + '.tmp';
fs.writeFileSync(tmp, JSON.stringify({ entries: all }));
fs.renameSync(tmp, J.file());
}
};
const store = () => J;
// ---------------------------------------------------------------- seeds
const SEED_FIELDS = ['title', 'questions', 'answer', 'tags', 'pattern', 'handoff', 'order', 'source'];
const seedHash = s => crypto.createHash('sha1').update(JSON.stringify(SEED_FIELDS.map(f => s[f] == null ? null : s[f]))).digest('hex');
function seedEntry(s) {
return { id: s.id, title: s.title, questions: s.questions || [], answer: s.answer, tags: s.tags || [], pattern: s.pattern || '', handoff: !!s.handoff,
order: s.order == null ? null : s.order, source: s.source || 'faq' };
}
async function syncSeeds() {
const all = await store().all(), byId = new Map(all.map(e => [e.id, e])), now = Date.now();
const seedIds = new Set(SEEDS.map(s => s.id));
let added = 0, refreshed = 0, retired = 0;
for (const s of SEEDS) {
const h = seedHash(seedEntry(s)), cur = byId.get(s.id);
if (!cur) { await store().put(Object.assign(seedEntry(s), { ticketRef: '', seedHash: h, edited: false, deleted: false, created: now, updated: now })); added++; }
else if (!cur.deleted && !cur.edited && cur.seedHash !== h) { await store().put(Object.assign({}, cur, seedEntry(s), { seedHash: h, updated: now })); refreshed++; }
}
// a seed taken out of the code goes with it, unless an admin has made the entry their own (guard: a broken seed list retires nothing)
if (SEEDS.length >= 10) for (const e of all) if (e.seedHash && !e.edited && !e.deleted && !seedIds.has(e.id)) { await store().put(Object.assign({}, e, { deleted: true, updated: now })); retired++; }
if (added || refreshed || retired) console.log('kb: seeds synced, ' + added + ' added, ' + refreshed + ' refreshed, ' + retired + ' retired');
}
// opts: { dataDir (null = memory only), seeds, siteUrl, helpText (where a member gets a person) }
function init(opts) {
DATA_DIR = opts.dataDir || null; MEMORY = !DATA_DIR; SEEDS = opts.seeds || []; cache = null; index = null; mem.entries = [];
SITE_URL = String(opts.siteUrl || '').replace(/\/+$/, ''); HELP_TEXT = opts.helpText || 'network support at https://instantadpay.com/support';
ready = (async () => { await store().ensure(); await syncSeeds(); })().catch(e => { console.error('kb init', e.message); });
return ready;
}
// this site's own entries, for netkb.publish
async function own() { await load(); return cache.slice(); }
async function load(force) {
if (ready) await ready;
if (!force && cache && Date.now() - cacheAt < TTL && (!netkb || netkb.version() === netVer)) return cache; // a new network set rebuilds at once
const all = await store().all();
cache = all.filter(e => !e.deleted); cacheAt = Date.now(); rx.clear(); netVer = netkb ? netkb.version() : '';
index = buildIndex(cache.concat(netkb ? netkb.remote() : [])); index.sites = netkb ? netkb.sites() : [];
return cache;
}
const rx = new Map();
function compiled(src) {
if (!rx.has(src)) { let r = null; try { r = new RegExp(src, 'i'); } catch (e) {} rx.set(src, r); }
return rx.get(src);
}
const byOrder = (a, b) => (a.order == null ? 1e9 : a.order) - (b.order == null ? 1e9 : b.order) || a.updated - b.updated;
// ---------------------------------------------------------------- the chatbot side
async function fastPath(msg) {
const list = (await load()).filter(e => e.pattern).sort(byOrder);
for (const e of list) { const r = compiled(e.pattern); if (r && r.test(msg)) return e; }
return null;
}
async function search(query, k) { await load(); return rank(index, query, k || 5); }
async function context(query, k) { return relevant(await search(query, k || 6)); }
const label = e => e.site ? ' (about ' + e.siteName + ', another network site; send people to ' + e.go + ')' : '';
function promptBlock(hits) {
const unsure = 'say "I\'m not sure, ask support" and point to ' + HELP_TEXT + '.';
if (!hits.length) return 'KNOWLEDGE BASE: no entry matches this question. If the FACTS above do not answer it either, ' + unsure + ' Do not guess.';
return 'KNOWLEDGE BASE (maintained answers, most relevant first). Answer from these when one fits: keep its facts, numbers and links exactly, in your own short words. '
+ 'If none of them and none of the FACTS answer the question, ' + unsure + ' Never guess.\n'
+ hits.map((h, i) => '[' + (i + 1) + '] ' + h.entry.title + label(h.entry) + '\nAsked as: ' + (h.entry.questions || []).slice(0, 4).join(' | ') + '\nAnswer: ' + h.entry.answer).join('\n\n');
}
// ---------------------------------------------------------------- the admin side
const clean = s => String(s == null ? '' : s).replace(/\s*[—―]\s*/g, ', ').replace(/(\d)\s*–\s*(\d)/g, '$1-$2').replace(/\s*–\s*/g, ', ').replace(/\r\n/g, '\n').trim(); // house rule: no em dashes in member-facing text
function validate(o, cur) {
o = o || {};
const questions = (Array.isArray(o.questions) ? o.questions : String(o.questions || '').split('\n')).map(clean).filter(Boolean).map(q => q.slice(0, 300)).slice(0, 15);
const tags = (Array.isArray(o.tags) ? o.tags : String(o.tags || '').split(',')).map(t => clean(t).toLowerCase().slice(0, 40)).filter(Boolean).slice(0, 15);
const answer = clean(o.answer).slice(0, 4000);
const title = (clean(o.title) || questions[0] || '').slice(0, 200);
const pattern = String(o.pattern == null ? (cur ? cur.pattern : '') : o.pattern).trim().slice(0, 2000);
if (!title) return { error: 'Give the entry a title or at least one question.' };
if (!answer) return { error: 'The answer is empty.' };
if (pattern) { try { new RegExp(pattern, 'i'); } catch (e) { return { error: 'The instant-answer pattern is not a valid regular expression: ' + e.message }; } }
const order = o.order === '' || o.order == null ? (cur ? cur.order : null) : Number(o.order);
return { title, questions, tags, answer, pattern, handoff: o.handoff == null ? !!(cur && cur.handoff) : !!o.handoff, order: Number.isFinite(order) ? Math.round(order) : null };
}
async function list(q) {
const all = (await load(true)).slice();
if (!q) return all.sort((a, b) => b.updated - a.updated);
const ranked = rank(index, q, 50).filter(h => !h.entry.site).map(h => Object.assign({ score: h.score }, h.entry));
const lc = String(q).toLowerCase(), seen = new Set(ranked.map(e => e.id));
const plain = all.filter(e => !seen.has(e.id) && (e.id.includes(lc) || (e.title + ' ' + e.answer + ' ' + (e.ticketRef || '')).toLowerCase().includes(lc)));
return ranked.concat(plain);
}
async function get(id) { return (await load(true)).find(e => e.id === String(id)) || null; }
async function create(o) {
const v = validate(o); if (v.error) return v;
const now = Date.now(), id = 'kb-' + now.toString(36) + crypto.randomBytes(2).toString('hex');
const src = ['ticket', 'admin'].includes(o.source) ? o.source : 'admin';
const e = Object.assign(v, { id, source: src, ticketRef: String(o.ticketRef || '').slice(0, 20), seedHash: '', edited: true, deleted: false, created: now, updated: now });
await store().put(e); await load(true); if (netkb) netkb.publishSoon();
return { ok: true, entry: e };
}
async function update(id, o) {
const cur = await get(id); if (!cur) return { error: 'Entry not found.' };
const v = validate(o, cur); if (v.error) return v;
const e = Object.assign({}, cur, v, { edited: true, updated: Date.now() });
await store().put(e); await load(true); if (netkb) netkb.publishSoon();
return { ok: true, entry: e };
}
async function remove(id) {
const cur = await get(id); if (!cur) return { error: 'Entry not found.' };
await store().put(Object.assign({}, cur, { deleted: true, updated: Date.now() })); await load(true); if (netkb) netkb.publishSoon();
return { ok: true };
}
// newest change made by a person (admin pane or a saved ticket reply), as a Central-time day. The chatbot-sync
// guard compares it with release-note dates. Seed refreshes do not count: those follow chatbot.js, whose
// KNOWLEDGE_DATE already speaks for the code.
const ctDay = ts => new Date(ts).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' });
async function stamp() {
const all = await load();
const max = all.reduce((m, e) => e.edited ? Math.max(m, e.updated || 0) : m, 0);
return { updated: max ? ctDay(max) : '', count: all.length };
}
async function test(question) {
const fast = await fastPath(String(question || ''));
const hits = await search(String(question || ''), 8), used = new Set(relevant(hits).map(h => h.entry.id));
return { fast: fast ? { id: fast.id, title: fast.title } : null, ranked: hits.map(h => ({ id: h.entry.id, site: h.entry.site || '', title: h.entry.title, score: h.score, used: used.has(h.entry.id) })) };
}
module.exports = { init, load, own, namesOther, fastPath, search, context, promptBlock, list, get, create, update, remove, stamp, test,
_pure: { words, terms, buildIndex, rank, relevant, validate, seedHash, namedSites, MIN_SCORE, HOME_BOOST, NAMED_BOOST } };
+214
View File
@@ -0,0 +1,214 @@
// Shared page shell for every Stack POL page (2026-11-09): full SEO head (title, description, canonical, robots, Open Graph,
// Twitter card, RSS link, JSON-LD slots) and the site's own look (Polygon violet + coin gold on deep night, one dark theme on
// purpose, matching the hero video). Server-rendered so crawlers read real HTML.
'use strict';
const netsites = require('./netsites'); // footer network list from the hub (2026-11-14)
const SITE = (process.env.SITE_URL || 'https://stackpol.com').replace(/\/+$/, '');
const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
const V = '20261109a';
const OG = '/og-stackpol-1200x630.jpg';
const CSS = `
:root{color-scheme:dark;--ground:#0a0715;--panel:#130c24;--panel-2:#1b1232;--line:rgba(183,148,255,.18);--ink:#f3efff;--muted:#a8a0c6;--violet:#8247e5;--violet-hi:#b794ff;--gold:#ffc24b;--gold-d:#b9781a;--ok:#4ade80;
--display:"Sora","Segoe UI",system-ui,sans-serif;--body:"Manrope",system-ui,sans-serif;--mono:"JetBrains Mono",ui-monospace,Consolas,monospace}
*{box-sizing:border-box}html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;background:var(--ground);color:var(--ink);font:15px/1.6 var(--body);padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:0 56px;
background-image:radial-gradient(ellipse 60% 38% at 78% 4%,rgba(130,71,229,.30),transparent 70%),radial-gradient(ellipse 50% 30% at 10% 0%,rgba(255,194,75,.08),transparent 70%)}
.wrap{max-width:1180px;margin:0 auto}a{color:var(--violet-hi)}img{max-width:100%}
header.bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-block:18px 4px;flex-wrap:wrap}
.logo{display:flex;gap:10px;align-items:center;font:800 19px var(--display);letter-spacing:-.01em;color:var(--ink);text-decoration:none}.logo svg{width:30px;height:30px}
nav.top{display:flex;gap:18px;flex-wrap:wrap;font:600 14px var(--body)}nav.top a{color:var(--muted);text-decoration:none}nav.top a:hover,nav.top a[aria-current]{color:var(--ink)}
.live{font-size:12.5px;color:var(--muted);display:flex;gap:8px;align-items:center}.dot{width:8px;height:8px;border-radius:50%;background:var(--ok);box-shadow:0 0 0 4px rgba(74,222,128,.15);flex:none}
h1{font:800 clamp(34px,5.4vw,58px)/1.06 var(--display);letter-spacing:-.03em;margin:8px 0 14px;text-wrap:balance}
h2{font:800 clamp(22px,3vw,30px) var(--display);letter-spacing:-.015em;margin:0;text-wrap:balance}
.kick{margin:22px 0 0;font:700 13px var(--body);letter-spacing:.14em;text-transform:uppercase;color:var(--violet-hi)}
.lead{font-size:18px;color:var(--muted);max-width:60ch;margin:0 0 6px}
.hero{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:40px;align-items:center;padding-block:26px 6px}
@media (max-width:880px){.hero{grid-template-columns:1fr;gap:24px}}
.total{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:4px 0 2px}
.total .n{font:800 clamp(50px,8vw,88px)/1 var(--display);letter-spacing:-.035em;color:var(--gold);text-shadow:0 0 46px rgba(255,194,75,.28);font-variant-numeric:tabular-nums}.total .u{font:800 26px var(--display);color:var(--gold)}
.verify{display:inline-flex;gap:7px;align-items:center;font-size:13.5px;color:var(--ok);margin:2px 0 16px}
.stats{display:flex;gap:26px;flex-wrap:wrap;margin:6px 0 14px}.stats div b{display:block;font:800 22px var(--display);font-variant-numeric:tabular-nums}.stats div span{color:var(--muted);font-size:13px}
.stackbar{display:flex;height:16px;border-radius:999px;overflow:hidden;background:var(--panel-2);gap:2px}.stackbar i{display:block;height:100%;background:var(--c);min-width:3px}
.keys{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:10px;font-size:12.5px;color:var(--muted)}.keys span{display:inline-flex;gap:6px;align-items:center}.keys i{width:9px;height:9px;border-radius:3px;background:var(--c)}.keys b{color:var(--ink);font-weight:700;font-variant-numeric:tabular-nums}
.cta{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:22px}
.btn{font:800 17px var(--display);color:#160b02;background:var(--gold);border-radius:14px;padding:15px 26px;text-decoration:none;box-shadow:0 6px 0 var(--gold-d),0 14px 30px rgba(255,194,75,.18);display:inline-block}
.btn.sec{background:transparent;color:var(--ink);box-shadow:none;border:1px solid var(--line);padding:13px 22px}
.btn:focus-visible,a:focus-visible{outline:3px solid var(--violet-hi);outline-offset:3px}
.fine{font-size:12.5px;color:var(--muted);max-width:34ch;line-height:1.45}
.vid .frame{border-radius:20px;overflow:hidden;border:1px solid var(--line);box-shadow:0 30px 70px rgba(0,0,0,.5),0 0 0 6px rgba(130,71,229,.10);background:#000;aspect-ratio:16/9;max-width:100%;position:relative}
.vid video{width:100%;height:100%;display:block;object-fit:cover}
.snd{position:absolute;right:12px;bottom:12px;font:600 12px var(--body);color:#fff;background:rgba(10,7,21,.72);border:1px solid rgba(255,255,255,.22);border-radius:999px;padding:6px 12px;cursor:pointer}
.trust{margin-top:14px;display:flex;gap:12px;align-items:flex-start;font-size:13.5px;color:var(--muted)}.trust b{color:var(--ink)}
.sec-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:52px 0 16px}.sec-head p{margin:0;color:var(--muted);font-size:14px}
.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}@media (max-width:960px){.cards{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width:600px){.cards{grid-template-columns:1fr}}
.card{background:var(--panel);border:1px solid var(--line);border-radius:18px;overflow:hidden;display:flex;flex-direction:column;transition:transform .18s ease,border-color .18s ease}
.card:hover{transform:translateY(-3px);border-color:rgba(183,148,255,.4)}
.card .img{position:relative;aspect-ratio:800/420;background:#000}.card .img img{width:100%;height:100%;object-fit:cover;display:block}.bl .cover{height:auto}
.card .body{padding:14px 16px 16px;display:flex;flex-direction:column;gap:6px;flex:1}
.card .head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.card .nm{display:flex;gap:8px;align-items:center;font:700 17px var(--display)}.card .nm a{color:var(--ink);text-decoration:none}.card .nm i{width:10px;height:10px;border-radius:3px;background:var(--c)}
.card .kind{font-size:12px;color:var(--muted)}
.card .earned{text-align:right;flex:none}.card .earned b{display:block;font:800 21px/1.05 var(--display);color:var(--gold);font-variant-numeric:tabular-nums}.card .earned b small{font-size:12px;margin-left:3px}.card .earned span{font-size:11.5px;color:var(--muted)}
.card p{margin:0;color:var(--muted);font-size:13.5px;line-height:1.5}
.card a.join{margin-top:auto;padding-top:10px;text-decoration:none}.card a.join span{display:block;text-align:center;font:700 14px var(--body);color:#120a1f;background:var(--c);border-radius:11px;padding:10px}
.feature{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);background:var(--panel);border:1px solid rgba(251,146,60,.45);border-radius:20px;overflow:hidden;margin-bottom:18px;box-shadow:0 0 0 6px rgba(251,146,60,.07)}
@media (max-width:760px){.feature{grid-template-columns:1fr}}.feature img{width:100%;height:100%;object-fit:cover;display:block;aspect-ratio:800/420}
.feature .fb{padding:22px 24px;display:flex;flex-direction:column;gap:10px;justify-content:center}
.feature .ftag{align-self:flex-start;font:700 11px var(--body);letter-spacing:.1em;text-transform:uppercase;color:#2b0418;background:#fb923c;padding:5px 10px;border-radius:7px}
.feature h3{margin:0;font:800 26px var(--display)}.feature p{margin:0;color:var(--muted)}.feature .ends{font:700 13px var(--body);color:#fb923c}
.feature a.go{align-self:flex-start;text-decoration:none;font:800 15px var(--display);color:#2b0418;background:#fb923c;border-radius:12px;padding:11px 18px}
.ltools{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.chip{font:600 13px var(--body);color:var(--ink);background:var(--panel);border:1px solid var(--line);border-radius:999px;padding:6px 14px;text-decoration:none}.chip[aria-current]{background:var(--violet);border-color:var(--violet)}
.tbl{overflow-x:auto;border:1px solid var(--line);border-radius:16px;background:var(--panel)}
table{border-collapse:collapse;width:100%;min-width:640px;font-size:14px}th{text-align:left;font:700 11px var(--body);letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding:11px 16px;border-bottom:1px solid var(--line)}
td{padding:9px 16px;border-bottom:1px solid rgba(183,148,255,.07);font-variant-numeric:tabular-nums;vertical-align:middle}tr:last-child td{border-bottom:0}
td.pg{font-weight:700}td.pg i{display:inline-block;width:9px;height:9px;border-radius:3px;background:var(--c);margin-right:8px}
td.amt{font:700 15px var(--display);color:var(--gold);text-align:right}th.r{text-align:right}td.tx{font:500 12.5px var(--mono);color:var(--muted);white-space:nowrap}td.who{color:var(--muted)}
@media (max-width:640px){.tbl{overflow:visible}table{min-width:0}thead{display:none}tbody tr{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:12px 14px;border-bottom:1px solid rgba(183,148,255,.1)}tbody td{padding:0;border:0}td.amt{grid-row:1/span 2;grid-column:2;align-self:center}td.when,td.tx,td.who{font-size:12px}}
.faq details{border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:14px 18px;margin:0 0 10px}.faq summary{cursor:pointer;font:700 16px var(--display)}.faq p{color:var(--muted);margin:10px 0 0;max-width:72ch}
.posts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}@media (max-width:900px){.posts{grid-template-columns:1fr}}
.post-card{display:block;background:var(--panel);border:1px solid var(--line);border-radius:16px;overflow:hidden;color:inherit;text-decoration:none}.post-card:hover{border-color:rgba(183,148,255,.45)}
.post-card img{width:100%;height:auto;aspect-ratio:1200/630;object-fit:cover;display:block}.post-card .pc{padding:14px 16px 16px}.post-card h3{font:700 18px/1.3 var(--display);margin:0 0 6px}.post-card p{margin:0;color:var(--muted);font-size:14px}.post-card .meta{margin-top:8px;font-size:12.5px;color:var(--muted)}
.bl{max-width:760px;margin:0 auto}.bl h1{font-size:clamp(30px,4.6vw,46px)}.bl .meta{color:var(--muted);font-size:14px;margin:0 0 22px}.bl .cover{width:100%;border-radius:16px;border:1px solid var(--line);margin:0 0 26px;display:block}
.bl article{font-size:17.5px;line-height:1.72}.bl article p{margin:0 0 18px;max-width:68ch}.bl article h2{font-size:26px;margin:36px 0 12px}.bl article h3{font-size:20px;margin:28px 0 10px;font-family:var(--display)}
.bl article ul,.bl article ol{margin:0 0 18px 22px;max-width:66ch}.bl article li{margin:6px 0}.bl article blockquote{border-left:4px solid var(--gold);margin:0 0 18px;padding:8px 18px;color:var(--muted);font-style:italic}
.bl article img{border-radius:12px;border:1px solid var(--line)}.bl article table{min-width:0;font-size:15px}.bl article th,.bl article td{border-bottom:1px solid var(--line);padding:8px 10px}
.tags a{display:inline-block;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--violet-hi);border:1px solid var(--line);border-radius:999px;padding:3px 10px;margin:0 6px 6px 0;text-decoration:none}
.author{display:flex;gap:14px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:36px 0 0;background:var(--panel)}.author .av{width:52px;height:52px;border-radius:50%;background:linear-gradient(135deg,var(--violet),var(--violet-hi));display:grid;place-items:center;font:800 20px var(--display);flex:none}.author b{display:block}.author span{color:var(--muted);font-size:14px}
.share a{margin-right:14px;font-size:14px}.pager{display:flex;justify-content:space-between;margin:26px 0}
footer.site{margin-top:64px;border-top:1px solid var(--line);padding-top:22px;display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:18px;font-size:13.5px;color:var(--muted)}
footer.site b{display:block;color:var(--ink);font:700 14px var(--display);margin-bottom:6px}footer.site a{color:var(--muted);text-decoration:none;display:block;margin:3px 0}footer.site a:hover{color:var(--ink)}
.disc{font-size:12.5px;color:var(--muted);margin-top:22px;max-width:90ch}
.who{display:flex;gap:12px;align-items:center}.av{width:44px;height:44px;border-radius:50%;background:linear-gradient(135deg,var(--violet),var(--violet-hi));display:grid;place-items:center;font:800 18px var(--display);color:#fff;flex:none}
.who b{font:700 17px var(--display);display:block;line-height:1.2}.who span{color:var(--muted);font-size:13.5px}
.crumb{font-size:13px;color:var(--muted);margin-top:26px}.crumb a{color:var(--muted)}
/* ad spots (LinkSpin zones): neutral class names, ad blockers hide .adzone-style names (feedback 2026-10-08) */
.spot{display:flex;flex-direction:column;align-items:center;gap:4px;margin:28px auto;max-width:100%;overflow:hidden}.spot .sl{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
/* Stack POL Pro (2026-11-09): the member's own links, the purple QR, the get-a-page-like-this panel */
.mylinks{margin:26px 0}.mylinks .ml{display:flex;flex-wrap:wrap;gap:10px;margin-top:8px}
.prorow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:22px;align-items:center;background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:20px;margin:28px 0}
.qr{background:#fff;border-radius:14px;padding:10px;width:170px;text-align:center}.qr img{display:block;width:150px;height:150px}.qr span{font:700 11px var(--body);color:#5b2bb5;letter-spacing:.06em;text-transform:uppercase}
.procta{display:flex;flex-wrap:wrap;gap:12px 16px;align-items:center;border:1px solid var(--violet);border-radius:18px;padding:18px 20px;margin:30px 0;background:linear-gradient(135deg,rgba(130,71,229,.16),transparent)}
.procta div{flex:1 1 280px;min-width:0}.procta b{display:block;font:800 18px var(--display);margin-bottom:4px}.procta span{color:var(--muted)}
@media (max-width:640px){.prorow{grid-template-columns:1fr}.qr{margin:0 auto}}
.myvids{margin:28px 0}.vrow{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,220px));gap:14px}.vcard{position:relative;display:block;aspect-ratio:9/16;max-width:100%;border-radius:16px;overflow:hidden;background:var(--panel);border:1px solid var(--line);color:#fff;text-decoration:none}.vcard img{width:100%;height:100%;object-fit:cover;display:block}.vcard .vplay{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:54px;height:54px;border-radius:50%;background:rgba(20,10,40,.72);display:grid;place-items:center}.vcard b{position:absolute;left:0;right:0;bottom:0;padding:26px 10px 10px;font:700 13px/1.3 var(--body);background:linear-gradient(transparent,rgba(10,5,25,.85))}
/* My Stack POL (2026-11-19) */
nav.top a.mylink{color:#160b02;background:var(--gold);border-radius:999px;padding:3px 12px;margin-left:2px}nav.top a.mylink:hover,nav.top a.mylink[aria-current]{color:#160b02;background:#ffd27a}
.myhero{padding:26px 0 4px}.myhead{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap}.soform{margin:0}
.mynote{border:1px solid var(--line);background:var(--panel);border-radius:12px;padding:10px 14px;margin:14px 0 0;max-width:72ch}.mynote.ok{border-color:rgba(74,222,128,.45)}.mynote.warn{border-color:rgba(255,194,75,.55)}
.mygrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:22px}@media (max-width:820px){.mygrid{grid-template-columns:1fr}}
.mycard+.tbl{margin-top:14px}.mycard{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:18px 20px;min-width:0}.mycard h2{font-size:21px}
.mct{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.pill{font:700 12px var(--body);letter-spacing:.08em;text-transform:uppercase;border-radius:999px;padding:4px 11px;flex:none}.pill.on{background:rgba(74,222,128,.16);color:var(--ok)}.pill.off{background:var(--panel-2);color:var(--muted)}
.mysub{color:var(--muted);font-size:14px;margin:10px 0 0}.mono{font-family:var(--mono);font-size:12.5px}
.cprow{margin:0 0 10px}.cprow label{display:block;font-size:12.5px;color:var(--muted);margin:0 0 4px}
.cpbox{display:flex;gap:8px;min-width:0}.cpbox input,.cpbox textarea{flex:1;min-width:0;background:var(--ground);color:var(--ink);border:1px solid var(--line);border-radius:10px;padding:9px 11px;font:500 13px var(--mono);resize:none}
.cpb{flex:none;font:700 13px var(--body);color:var(--ink);background:var(--violet);border:0;border-radius:10px;padding:0 14px;cursor:pointer;min-height:38px}.cpb:focus-visible{outline:3px solid var(--violet-hi);outline-offset:2px}
.swform{margin:14px 0 6px}.swform .btn{cursor:pointer;border:0;font-size:15px;padding:11px 20px}.swform .btn.sec{border:1px solid var(--line)}.myhead .btn,.myfoot .btn{cursor:pointer;font-size:14px;padding:9px 16px}
.jlinks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}@media (max-width:820px){.jlinks{grid-template-columns:1fr}}
.jl{background:var(--panel);border:1px solid var(--line);border-left:4px solid var(--c);border-radius:14px;padding:12px 14px 4px;min-width:0}.jn{display:flex;gap:8px;align-items:baseline;margin-bottom:8px;flex-wrap:wrap}.jn i{width:9px;height:9px;border-radius:3px;background:var(--c);display:inline-block}.jn b{font:700 15px var(--display)}.jn span{color:var(--muted);font-size:12.5px}
.kimgs{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-content:start}.kimgs figure{margin:0}.kimgs img{width:100%;border-radius:10px;border:1px solid var(--line);aspect-ratio:1200/630;object-fit:cover;display:block}.kimgs figcaption{font-size:12.5px;color:var(--muted);margin-top:6px}
.kqr{display:flex;gap:12px;align-items:center;margin-top:6px}.kqr img{background:#fff;border-radius:10px;padding:6px}.kqr span{font-size:13px;color:var(--muted)}
.myfoot{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-top:34px}.myfoot form{margin:0}.linkbtn{background:none;border:0;color:var(--violet-hi);font:600 14px var(--body);cursor:pointer;text-decoration:underline;padding:0}
@media (prefers-reduced-motion:reduce){.card,.btn{transition:none}.card:hover{transform:none}}
`;
const LOGO = '<svg viewBox="0 0 64 64" aria-hidden="true"><path d="M32 4l24 14v28L32 60 8 46V18z" fill="#8247e5"/><path d="M20 28l12-7 12 7v10l-12 7-12-7z" fill="#ffc24b"/></svg>';
// o: { title, desc, path, image, type ('website'|'article'|'profile'), article, noindex, jsonld: [objects], nav }
function head(o) {
const url = SITE + (o.path || '/');
const img = o.image ? (/^https?:/.test(o.image) ? o.image : SITE + o.image) : SITE + OG;
const a = o.article;
return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">'
+ '<title>' + esc(o.title) + '</title><meta name="description" content="' + esc(o.desc) + '"><link rel="canonical" href="' + esc(url) + '">'
+ '<meta name="robots" content="' + (o.noindex ? 'noindex,follow' : 'index,follow,max-image-preview:large,max-snippet:-1') + '"><meta name="theme-color" content="#0a0715">'
+ '<meta property="og:type" content="' + (o.type || 'website') + '"><meta property="og:site_name" content="Stack POL"><meta property="og:locale" content="en_US">'
+ '<meta property="og:title" content="' + esc(o.ogTitle || o.title) + '"><meta property="og:description" content="' + esc(o.desc) + '"><meta property="og:url" content="' + esc(url) + '">'
+ '<meta property="og:image" content="' + esc(img) + '"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:image:alt" content="' + esc(o.imageAlt || 'Stack POL: every POL payout across the network, stacked in one place') + '">'
+ (a ? '<meta property="article:published_time" content="' + new Date(a.publishedAt || a.created).toISOString() + '"><meta property="article:modified_time" content="' + new Date(a.updated).toISOString() + '"><meta property="article:author" content="Marty Bostick">' + (a.tags || []).map(t => '<meta property="article:tag" content="' + esc(t) + '">').join('') : '')
+ '<meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="' + esc(o.ogTitle || o.title) + '"><meta name="twitter:description" content="' + esc(o.desc) + '"><meta name="twitter:image" content="' + esc(img) + '">'
+ '<link rel="alternate" type="application/rss+xml" title="Stack POL blog" href="' + SITE + '/blog/feed.xml">'
+ '<link rel="icon" href="/favicon.svg" type="image/svg+xml"><link rel="apple-touch-icon" href="/apple-touch-icon.png"><link rel="manifest" href="/site.webmanifest">'
+ '<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>'
+ '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">'
+ '<style>' + CSS + '</style>'
+ (o.jsonld || []).map(j => '<script type="application/ld+json">' + JSON.stringify(j).replace(/</g, '\\u003c') + '</script>').join('')
+ '</head><body><div class="wrap">'
+ '<header class="bar"><a class="logo" href="/" aria-label="Stack POL home">' + LOGO + 'Stack POL</a>'
+ '<nav class="top" aria-label="Main">' + [['/', 'Home'], ['/programs', 'Programs'], ['/ledger', 'Ledger'], ['/blog', 'Blog']].map(([h, l]) => '<a href="' + h + '"' + (o.nav === h ? ' aria-current="page"' : '') + '>' + l + '</a>').join('')
// My Stack POL (2026-11-19): pages are cached for everyone, so the label comes from the sp.in cookie (no data in it, set by /my)
+ '<a class="mylink" id="spmy" href="/my"' + (o.nav === '/my' ? ' aria-current="page"' : '') + ' rel="nofollow">Sign in</a></nav>'
+ '<script>(function(){if(/(?:^|; )sp\\.in=1/.test(document.cookie)){var a=document.getElementById("spmy");if(a)a.textContent="My Stack POL";}})();</script></header>';
}
// a LinkSpin zone spot. wide = zone for screens 760px and up, narrow = zone below that; only the one that fits is loaded, so a
// hidden size never counts a view. Zones are on Marty's LinkSpin account, site stackpol.com (created 2026-11-09).
const ZONES = { banner: 'ls-9c2a52', strip: 'ls-dc8bdd', blogBox: 'ls-72413f', ledgerBox: 'ls-1f308f' };
const spot = (wide, narrow) => '<div class="spot" data-w="' + (wide || '') + '" data-n="' + (narrow || wide || '') + '"><span class="sl">Sponsored</span></div>';
const MEMBER_HOST = 'rubav.com'; // a LinkSpin link domain: /i/<code>.gif image, /c/<code> click, /r/<code> spin link
const SPOT_JS = '<script>(function(){var w=innerWidth>=760;document.querySelectorAll(".spot").forEach(function(d){var m=w?d.dataset.mw:d.dataset.mn;if(m){m=m.split("|");var a=document.createElement("a");a.href="https://' + MEMBER_HOST + '/c/"+m[0];a.target="_blank";a.rel="sponsored noopener";var i=document.createElement("img");i.src="https://' + MEMBER_HOST + '/i/"+m[0]+".gif";i.width=+m[1];i.height=+m[2];i.alt="";i.style.cssText="max-width:100%;height:auto";a.appendChild(i);d.appendChild(a);return;}var id=w?d.dataset.w:d.dataset.n;if(!id){d.remove();return;}var s=document.createElement("script");s.async=true;s.src="https://linkspin.app/z.js";s.setAttribute("data-zone",id);d.appendChild(s);});})();</script>';
// Stack POL Pro (2026-11-09): a page that belongs to a Pro member (their /<username>, or any page opened with ?ref=<username>) shows
// THEIR LinkSpin Banner Spins in the ad spots instead of the network zones (a spot with no spin of a fitting size keeps the network
// zone), and every internal link and join link carries their referral. Free members' pages keep the network zones but still credit
// the member on join links. Not personalized = the standard network ads.
const FIT = { [ZONES.banner]: ['728x90', '468x60'], [ZONES.strip]: ['468x60', '300x250', '125x125'], [ZONES.blogBox]: ['300x250', '125x125', '468x60'], [ZONES.ledgerBox]: ['300x250', '125x125', '468x60'] };
function pickSpin(spins, zone) {
for (const size of FIT[zone] || []) { const c = spins.filter(x => x.size === size); if (c.length) { const x = c[Math.floor(Math.random() * c.length)]; return x.code + '|' + size.replace('x', '|'); } }
return '';
}
function personalize(html, who, st) {
if (!who) return html;
const pro = st && st.pro, spins = (pro && pro.spins) || [];
if (spins.length) html = html.replace(/<div class="spot" data-w="([^"]*)" data-n="([^"]*)">/g, (m, w, n) => {
const mw = pickSpin(spins, w), mn = pickSpin(spins, n);
return '<div class="spot mine" data-w="' + w + '" data-n="' + n + '"' + (mw ? ' data-mw="' + mw + '"' : '') + (mn ? ' data-mn="' + mn + '"' : '') + '>';
});
return html.replace(/href="([^"]*)"/g, (m, h) => {
if (/^\/(earn|blog|programs|ledger)(\/|\?|$)/.test(h) && !/\/blog\/feed\.xml/.test(h)) return 'href="' + h + (h.includes('?') ? '&amp;' : '?') + 'ref=' + who + '"';
if (h === '/') return 'href="/' + who + '"';
if (/^https:\/\/(instantadpay\.com|linkspin\.app)\/?$/.test(h)) return 'href="' + h.replace(/\/?$/, '/join/' + who) + '"';
// the footer's network links carry the referral (Marty 2026-11-15): a LinkSpin network link without a member gets s1 (LinkSpin sends
// it on as ?ref=); Earners Corner (nwec) takes none
if (/^https:\/\/linkspin\.app\/r\/nw[a-z]+\?/.test(h) && !/[?&](?:amp;)?s1=/.test(h)) return /\/r\/nwec\?/.test(h) ? m : 'href="' + h + '&amp;s1=' + who + '"';
if (/^https:\/\/(instantadpay\.com|linkspin\.app)\//.test(h)) return 'href="' + h.replace(/\/join\/martbost\b/, '/join/' + who).replace(/([?&](?:amp;)?ref=)martbost\b/, '$1' + who).replace(/([?&](?:amp;)?s1=)martbost\b/, '$1' + who) + '"'; // s1 = the member on a LinkSpin network link (nwvbb, 2026-11-15)
if (/^https:\/\/(downlinebanners\.com|viralbannerblitz\.com|viraladblitz\.com|viraladsource\.com|yourprogrambuilder\.com|videoappincome\.com|5xyourteam\.com|downlinehydra\.com)\//.test(h)) return 'href="' + h.replace(/([?&](?:amp;)?ref=)martbost\b/, '$1' + who) + '"';
return m;
});
}
// shown on a Pro page and on articles opened from one: the visitor can get a page like this (Marty 2026-11-09). New visitors join
// under the Pro member; members go straight to the Stack POL tab, where Get Pro opens the order a $10+ package fulfils.
function proCta(who) {
return '<div class="procta"><div><b>Want a personalized page like this?</b><span>Your own Stack POL page with your banners, your links and your QR code. Unlocked one time with any InstantAdPay ad package of $10 or more.</span></div>'
+ '<a class="btn" href="https://instantadpay.com/join/' + esc(who) + '?src=stackpol-pro" rel="noopener">Get your own page</a><a class="btn sec" href="https://instantadpay.com/my#promo?s=stackpol" rel="noopener">Already a member? Unlock Pro</a></div>';
}
// the member's spin links, as a block for their page and the end of articles opened from it
function memberLinks(who, st) {
const links = (st && st.pro && st.pro.links) || []; if (!links.length) return '';
return '<div class="mylinks"><p class="kick">@' + esc(who) + ' recommends</p><div class="ml">' + links.map(l => '<a class="chip" href="https://' + MEMBER_HOST + '/r/' + esc(l.code) + '" target="_blank" rel="sponsored noopener">' + esc(l.name || 'Open link') + ' &rarr;</a>').join('') + '</div></div>';
}
// Stack POL Pro (Marty 2026-11-23): the member's LinkSpin Video Spin. One short link that opens a different one of their Social Tube
// videos each visit (made on Video App Income); LinkSpin counts the plays. Up to three posters, every one opens the same spin link.
function memberVideos(who, st) {
const v = st && st.pro && st.pro.video; if (!v || !/^[A-Za-z0-9]{3,20}$/.test(v.code || '')) return '';
const url = 'https://' + MEMBER_HOST + '/r/' + v.code, ps = (v.posters || []).filter(p => /^https:\/\/socialtube\.club\//.test(p.poster || '')).slice(0, 3);
const a = inner => '<a class="vcard" href="' + url + '" target="_blank" rel="noopener">' + inner + '</a>';
const play = '<span class="vplay" aria-hidden="true"><svg width="22" height="22" viewBox="0 0 24 24" fill="currentColor"><path d="M8 5v14l11-7z"/></svg></span>';
const cards = ps.length ? ps.map(p => a('<img src="' + esc(p.poster) + '" alt="' + esc(p.label || 'Video') + '" loading="lazy">' + play + (p.label ? '<b>' + esc(p.label) + '</b>' : ''))).join('') : a(play + '<b>' + esc(v.name || 'Watch a video') + '</b>');
return '<div class="myvids"><div class="sec-head"><h2>Watch @' + esc(who) + '\'s videos</h2><p>' + (v.count > 1 ? v.count + ' short videos. Each tap opens a different one.' : 'A short video, made on a phone.') + '</p></div><div class="vrow">' + cards + '</div></div>';
}
function tail(extra) {
const year = new Date().getFullYear();
return '<footer class="site"><div><b>Stack POL</b>Every POL payout across the network, stacked in one place and checkable on Polygon.</div>'
+ '<div><b>Explore</b><a href="/programs">All programs</a><a href="/ledger">Live ledger</a><a href="/blog">Blog</a><a href="/blog/feed.xml">RSS feed</a><a href="https://instantadpay.com/games" rel="noopener">All games</a><a href="https://instantadpay.com/support" rel="noopener">Support</a><a href="/terms">Terms</a><a href="/disclaimer">Earnings disclaimer</a><a href="/privacy">Privacy</a></div>'
// Part of the network (Marty 2026-11-14 trust pack): the list comes from the hub (netsites.js, cached), built-in copy if not
+ '<div><b>Part of the network</b><span style="display:block;margin-bottom:4px">One account across the network</span>' + netsites.list().map(s => (s.id === 'stackpol' || /stackpol\.com/.test(s.url))
? '<span aria-current="page" style="display:block;margin:3px 0;color:var(--ink);font-weight:600">' + esc(s.name) + ' (you are here)</span>'
: '<a href="' + esc(netsites.tracked(s.id, 'stackpol') || s.url) + '" rel="noopener nofollow">' + esc(s.name) + '</a>').join('') + '</div>'
+ '<div><b>Honest numbers</b>Totals are the combined payouts of everyone in the network, read from each program\'s payout records and the Polygon chain. One member\'s results are not a promise of yours. Cryptocurrency involves risk.</div></footer>'
+ '<p class="disc">&copy; ' + year + ' Stack POL by TrustClickz. Part of the Crypto Team Build Network. Stack POL shows payouts; it does not hold, invest or pay out anyone\'s money.</p>'
// PolHunter mission (Marty 2026-11-10): silent unless a hunter arrives with their own #ph token; the code lands on one of the
// program cards (3 slots, which one rotates per hunter per day)
+ '</div>' + (extra || '') + SPOT_JS + '<script src="https://polhunter.com/embed.js" data-slots="3" data-selector=".card" async></script><script src="/assets/chat.js?v=hide1" defer></script><script src="/assets/netweekend.js?v=20261117" data-site="stackpol" defer></script></body></html>';
}
module.exports = { SITE, esc, head, tail, OG, V, ZONES, spot, personalize, memberLinks, memberVideos, proCta, MEMBER_HOST };
+61
View File
@@ -0,0 +1,61 @@
'use strict';
// Terms, Privacy and Earnings disclaimer pages (2026-11-17 network tidy-up, same structure as the other network sites).
// Operator is named TrustClickz only: no street address on site pages (Marty 2026-11-16).
const { head, tail } = require('./layout');
const UPDATED = 'November 17, 2026';
const SUPPORT = '<a href="https://instantadpay.com/support" rel="noopener">network support</a> (TrustClickz)';
const sec = (h, ...ps) => '<h2>' + h + '</h2>' + ps.map(p => '<p>' + p + '</p>').join('');
const PAGES = {
'/terms': {
title: 'Terms and Conditions | Stack POL', h1: 'Stack POL Terms and Conditions', lead: 'The rules for using Stack POL, in plain English.',
desc: 'The terms for using stackpol.com, the public POL payout ledger of the network.',
body: [
sec('Who we are', 'Stack POL (stackpol.com) is run by TrustClickz. It is part of the network: one network account works across InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, ViralAdBlitz, ViralAdSource, DownlineHydra, 5xYourTeam, Stack POL and Earners Corner. By using Stack POL you agree to these terms.'),
sec('What Stack POL is', 'Stack POL is a public, read-only ledger. It collects the POL payouts made by the programs in the network from each program\'s payout records and the Polygon blockchain, adds them up, and links every row to its transaction on Polygonscan. It also has program pages, a blog and an assistant that answers questions about the network.'),
sec('Stack POL does not hold money', 'Stack POL does not sell anything, take payments, hold funds, invest for anyone or pay anyone. Every payout shown was made by the program named on the row. Questions about a payout go to that program.'),
sec('Member pages', 'A member\'s own Stack POL page is off until the member switches it on in InstantAdPay Promo tools. A Pro page (your banners, links and QR code) is unlocked through an InstantAdPay ad package, bought and governed on InstantAdPay under its terms. You can ask for your page to be switched off at any time.'),
sec('Accuracy', 'We work to keep the totals correct and refresh them every few minutes, but they can be late or incomplete, and a program may change or stop. The Polygon blockchain is the record that counts: check any row there.'),
sec('Nothing is promised', 'The numbers show what has been paid to members in the past. They are not a promise, forecast or typical result of what you will receive. Read the <a href="/disclaimer">Earnings Disclaimer</a>.'),
sec('Crypto risk', 'The price of POL moves. The dollar value of a payout can be higher or lower later than when it was paid. Blockchain transactions are final. You are responsible for your own wallet and its recovery phrase; never share it with anyone. We will never ask for it.'),
sec('Links and ads', 'Stack POL links to the network programs and carries network ad zones and member banners. Those sites and ads are run by others under their own terms. We are not responsible for third-party websites.'),
sec('Fair use', 'Do not try to break, overload or scrape the site at a rate that harms it. The public data feeds may be rate limited.'),
sec('The service', 'The site is provided as it is. We may change features or these terms; changes apply from the date they are posted here.'),
sec('Limits', 'As far as the law allows, we are not responsible for losses caused by the blockchain, your wallet, the price of POL, the programs listed, third-party websites, or events outside our control. These terms are governed by the laws of the State of Alabama, USA.'),
sec('Contact', 'Questions, problems or a request about your data: ' + SUPPORT + '.')
]
},
'/privacy': {
title: 'Privacy Policy | Stack POL', h1: 'Stack POL Privacy Policy', lead: 'What Stack POL keeps about you, why, and for how long.',
desc: 'What stackpol.com keeps about visitors and members.',
body: [
sec('Who we are', 'Stack POL is run by TrustClickz.'),
sec('What we show', 'Payout rows from the network programs: the program, the amount in POL, the date, the transaction and the receiving member\'s network username or a shortened wallet. This information is already public on the Polygon blockchain or in the program\'s own public ledger. A member page appears only after the member switches it on.'),
sec('What we keep', 'Stack POL has no accounts and no sign-in, and it does not store your email. Questions you ask the site assistant are answered and not stored with anything that identifies you; your internet address is held in memory for a short time only to limit how often the assistant can be asked.'),
sec('Cookies', 'Stack POL sets no cookies of its own. Pages and embeds from other services may set their own.'),
sec('Who else sees data', 'The Polygon blockchain: every payout is public there, by its nature. Services the pages load: Google Fonts, LinkSpin network ad zones and member banners, the PolHunter mission script and the network hub\'s shared assistant knowledge. We do not sell personal data.'),
sec('Your choices', 'You can switch your member page off in InstantAdPay Promo tools or ask us to remove it. Records on the blockchain cannot be removed by anyone.'),
sec('Contact', 'Questions, problems or a request about your data: ' + SUPPORT + '.')
]
},
'/disclaimer': {
title: 'Earnings Disclaimer | Stack POL', h1: 'Stack POL Earnings Disclaimer', lead: 'Real payouts, not promises.',
desc: 'The numbers on stackpol.com show past payouts, not a promise of results.',
body: [
sec('What the numbers are', 'Every total, ledger row and member page on Stack POL shows what the programs in the network really paid in the past, read from their payout records and the Polygon blockchain. They are combined across everyone in the network.'),
sec('Not a promise', 'None of it is a promise, forecast or typical result of what you will receive. One member\'s results are not a promise of yours. Many people receive nothing or less than they spend. Your results depend on the program, what you do and other people\'s free choices.'),
sec('Not advice', 'Stack POL is not financial, investment or tax advice, and listing a program is not a recommendation to spend money in it. Read each program\'s own terms and earnings disclaimer before you buy anything.'),
sec('Prices and taxes', 'Payouts are in POL, whose price moves, so their dollar value can change. You are responsible for any taxes on what you receive where you live.'),
sec('Who to ask', 'TrustClickz. ' + SUPPORT.replace('network support', 'Network support').replace(' (TrustClickz)', '') + '.')
]
}
};
function render(p) {
const d = PAGES[p]; if (!d) return null;
return head({ title: d.title, desc: d.desc, path: p })
+ '<div class="bl"><article style="padding:28px 0 10px"><p class="kick">Last updated ' + UPDATED + '</p><h1>' + d.h1 + '</h1><p class="lead">' + d.lead + '</p>'
+ d.body.join('') + '</article></div>' + tail();
}
module.exports = { render, PATHS: Object.keys(PAGES) };
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

+1
View File
@@ -0,0 +1 @@
https://clutterhunt.com/og-clutterhunt.jpg?v=c2
+18
View File
@@ -0,0 +1,18 @@
// PassiveDrip share image (it had none): art + title in the same clean style as the InstantAdPay / PolHunter cards.
import pkg from 'file:///D:/Projects/MarketingAgent/qa-tester/node_modules/playwright/index.js';
import fs from 'node:fs';
const { chromium } = pkg;
const D = 'D:/Projects/HighRisk/stackpol/mockup/og/';
const img = 'data:image/png;base64,' + fs.readFileSync(D + 'pd-art.png').toString('base64');
const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1200, height: 630 } });
await p.setContent(`<!doctype html><html><head><link href="https://fonts.googleapis.com/css2?family=Sora:wght@700;800&family=Manrope:wght@500;600&display=swap" rel="stylesheet">
<style>*{margin:0;box-sizing:border-box}body{width:1200px;height:630px;position:relative;overflow:hidden;font-family:Manrope,sans-serif;color:#fff}
.bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.shade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(10,8,30,.9) 0%,rgba(10,8,30,.7) 38%,rgba(10,8,30,0) 62%)}
.t{position:absolute;left:62px;top:0;bottom:0;width:560px;display:flex;flex-direction:column;justify-content:center;gap:16px}
.eb{font:600 20px Manrope;letter-spacing:.16em;text-transform:uppercase;color:#7fe3d6}
h1{font:800 84px/1 Sora,sans-serif;letter-spacing:-.02em}h1 em{font-style:normal;color:#b794ff}
.s{font:600 30px/1.3 Manrope;color:#e9e4ff}.u{font:600 18px Manrope;color:#c9c2e8;margin-top:6px}</style></head>
<body><img class="bg" src="${img}"><div class="shade"></div><div class="t"><div class="eb">Earn · faucet · offers</div><h1>Passive<em>Drip</em></h1><div class="s">Earn every day.<br>Paid out in POL to your wallet.</div><div class="u">passivedrip.com</div></div></body></html>`);
await p.evaluate(() => document.fonts.ready); await p.waitForTimeout(400);
await p.screenshot({ path: D + 'pd.src', type: 'jpeg', quality: 88 });
await b.close(); console.log('ok');
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 782 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

+1
View File
@@ -0,0 +1 @@
https://linkspin.app/banners/linkspin-og-1200x630.png
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+1
View File
@@ -0,0 +1 @@
https://polybreak.app/og-polybreak.jpg?v=1
+14
View File
@@ -0,0 +1,14 @@
Generating 1200x630 banner via kie.ai [nano-banana-pro @ 2K] at aspect 16:9 (~1.778), target ratio 1.905, center-cropping with 5% buffer
kie.ai task created: d80b3ba26a9cfc6d4219822598e8f09d
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
[poll] task d80b3ba26a9cfc6d4219822598e8f09d: waiting
kie.ai image ready: https://tempfile.aiquickdraw.com/workers/images/image_28723bfa7b3b55dc5f17a6991e12458d.png
kie.ai output: 2752x1536 (target: 1200x630)
Banner image saved: D:\Projects\HighRisk\stackpol\mockup\og\pd-art.png
Binary file not shown.

After

Width:  |  Height:  |  Size: 916 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

+1
View File
@@ -0,0 +1 @@
https://polminer.com/og-polminer.jpg?v=2
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

+1
View File
@@ -0,0 +1 @@
https://www.polywarriors.com/og-polywarriors.jpg
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

+1
View File
@@ -0,0 +1 @@
https://roadagent.app/og-roadagent.jpg
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

+1
View File
@@ -0,0 +1 @@
https://spellwheel.com/og-spellwheel.jpg?v=1
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

+1
View File
@@ -0,0 +1 @@
https://turkeydropgame.com/og-turkeydrop.jpg?v=1
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

File diff suppressed because one or more lines are too long
+239
View File
@@ -0,0 +1,239 @@
<title>Stack POL Member Page</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&family=Manrope:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap">
<style>
/* Stack POL's own look: Polygon violet + coin gold on deep night. One dark theme on purpose (matches the live site + video). */
:root {
color-scheme: dark;
--ground: #0a0715; --panel: #130c24; --panel-2: #1b1232; --line: rgba(183,148,255,.18);
--ink: #f3efff; --muted: #a8a0c6; --violet: #8247e5; --violet-hi: #b794ff; --gold: #ffc24b; --gold-d: #b9781a; --ok: #4ade80;
--display: "Sora", "Segoe UI", system-ui, sans-serif; --body: "Manrope", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.6 var(--body); padding-inline: 16px; padding-block: 0 64px;
background-image: radial-gradient(ellipse 60% 38% at 78% 4%, rgba(130,71,229,.30), transparent 70%), radial-gradient(ellipse 50% 30% at 10% 0%, rgba(255,194,75,.08), transparent 70%); }
.wrap { max-width: 1180px; margin: 0 auto; }
a { color: var(--violet-hi); }
.mock { margin: 14px auto 0; max-width: 1180px; font-size: 12.5px; color: var(--muted); border: 1px dashed rgba(255,194,75,.4); border-radius: 10px; padding: 7px 12px; }
.mock b { color: var(--gold); letter-spacing: .08em; font-size: 11px; text-transform: uppercase; margin-right: 8px; }
header.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 18px 4px; flex-wrap: wrap; }
.logo { display: flex; gap: 10px; align-items: center; font: 800 19px var(--display); letter-spacing: -.01em; }
.logo svg { width: 30px; height: 30px; }
.live { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(74,222,128,.15); flex: none; }
/* ---- hero: proof on the left, the video on the right ---- */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 26px 10px; }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; gap: 24px; } }
.who { display: flex; gap: 12px; align-items: center; }
.av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--violet-hi)); display: grid; place-items: center; font: 800 18px var(--display); color: #fff; flex: none; box-shadow: 0 0 0 3px rgba(183,148,255,.25); }
.who b { font: 700 17px var(--display); display: block; line-height: 1.2; }
.who span { color: var(--muted); font-size: 13.5px; }
.kick { margin: 22px 0 0; font: 700 13px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--violet-hi); }
.total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.total .n { font: 800 clamp(54px, 8.5vw, 92px)/1 var(--display); letter-spacing: -.035em; color: var(--gold); text-shadow: 0 0 46px rgba(255,194,75,.28); font-variant-numeric: tabular-nums; }
.total .u { font: 800 26px var(--display); color: var(--gold); }
.verify { display: inline-flex; gap: 7px; align-items: center; font-size: 13.5px; color: var(--ok); margin: 2px 0 18px; }
/* the stack: one bar, a segment per program, sized by what it paid */
.bar-wrap { margin-bottom: 10px; }
.stackbar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--panel-2); gap: 2px; }
.stackbar i { display: block; height: 100%; background: var(--c); min-width: 3px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.keys span { display: inline-flex; gap: 6px; align-items: center; }
.keys i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.keys b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.btn { font: 800 17px var(--display); color: #160b02; background: var(--gold); border-radius: 14px; padding: 15px 26px; text-decoration: none; box-shadow: 0 6px 0 var(--gold-d), 0 14px 30px rgba(255,194,75,.18); display: inline-block; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .card a:focus-visible { outline: 3px solid var(--violet-hi); outline-offset: 3px; }
.cta .fine { font-size: 12.5px; color: var(--muted); max-width: 30ch; line-height: 1.45; }
.vid .frame { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 70px rgba(0,0,0,.5), 0 0 0 6px rgba(130,71,229,.10); background: #000; aspect-ratio: 16 / 9; max-width: 100%; position: relative; }
.vid video { width: 100%; height: 100%; display: block; object-fit: cover; }
.snd { position: absolute; right: 12px; bottom: 12px; font: 600 12px var(--body); color: #fff; background: rgba(10,7,21,.72); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.vid .trust { margin-top: 14px; display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.vid .trust svg { flex: none; margin-top: 2px; }
.vid .trust b { color: var(--ink); }
/* ---- program cards: the share image does the explaining ---- */
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 52px 0 16px; }
h2 { font: 800 clamp(22px, 3vw, 28px) var(--display); letter-spacing: -.015em; margin: 0; }
.sec-head p { margin: 0; color: var(--muted); font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-3px); border-color: rgba(183,148,255,.4); }
.card .img { position: relative; aspect-ratio: 1200 / 630; background: #000; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .earned { text-align: right; flex: none; }
.card .earned b { display: block; font: 800 22px/1.05 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.card .earned b small { font-size: 12px; margin-left: 3px; }
.card .earned span { font-size: 11.5px; color: var(--muted); }
/* the seasonal feature: one wide card above the grid */
.feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); background: var(--panel); border: 1px solid rgba(251,146,60,.45); border-radius: 20px; overflow: hidden; margin-bottom: 18px; box-shadow: 0 0 0 6px rgba(251,146,60,.07); }
@media (max-width: 760px) { .feature { grid-template-columns: 1fr; } }
.feature img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 1200 / 630; }
.feature .fb { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.feature .ftag { align-self: flex-start; font: 700 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #2b0418; background: #fb923c; padding: 5px 10px; border-radius: 7px; }
.feature h3 { margin: 0; font: 800 26px var(--display); letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--muted); }
.feature .ends { font: 700 13px var(--body); color: #fb923c; }
.feature a { align-self: flex-start; text-decoration: none; font: 800 15px var(--display); color: #2b0418; background: #fb923c; border-radius: 12px; padding: 11px 18px; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .nm { display: flex; gap: 8px; align-items: center; font: 700 17px var(--display); }
.card .nm i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.card a.join { margin-top: auto; padding-top: 10px; }
.card a.join span { display: block; text-align: center; font: 700 14px var(--body); color: #120a1f; background: var(--c); border-radius: 11px; padding: 10px; text-decoration: none; }
.card a.join { text-decoration: none; }
/* ---- the ledger ---- */
.ltools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip { font: 600 13px var(--body); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); }
.ltools .stamp { margin-left: auto; font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 680px; font-size: 14px; }
th { text-align: left; font: 700 11px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); }
td { padding: 9px 16px; border-bottom: 1px solid rgba(183,148,255,.07); font-variant-numeric: tabular-nums; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.pg .pgc { display: flex; gap: 10px; align-items: center; font-weight: 700; }
td.pg img { width: 52px; height: 27px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); flex: none; }
/* phones: the ledger becomes stacked rows (thumb + program + member, amount on the right, time + tx under) */
@media (max-width: 640px) {
.tbl { overflow: visible; }
table { min-width: 0; }
thead { display: none; }
tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid rgba(183,148,255,.1); }
tbody tr:last-child { border-bottom: 0; }
tbody td { padding: 0; border: 0; }
td.pg { grid-column: 1; grid-row: 1; }
td.amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 18px; }
td.who { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; padding-left: 62px; }
td.when, td.tx { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding-left: 62px; }
td.when { grid-row: 3; } td.tx { grid-row: 4; white-space: normal; }
.ltools .stamp { margin-left: 0; width: 100%; }
}
/* phones: the call to action centers and goes full width */
@media (max-width: 880px) {
.cta { flex-direction: column; align-items: stretch; text-align: center; }
.cta .btn { text-align: center; }
.cta .fine { max-width: none; }
.sec-head { flex-direction: column; align-items: flex-start; }
}
td.amt { font: 700 15px var(--display); color: var(--gold); text-align: right; }
th.r { text-align: right; }
td.tx { font: 500 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
td.tx span { color: var(--violet-hi); margin-left: 6px; }
tr.me { background: rgba(255,194,75,.06); }
details.notes { margin-top: 44px; border: 1px dashed rgba(255,194,75,.35); border-radius: 14px; padding: 12px 16px; color: var(--muted); font-size: 13.5px; }
details.notes summary { cursor: pointer; font: 700 14px var(--display); color: var(--gold); }
details.notes .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
details.notes h3 { margin: 0 0 4px; font: 700 13.5px var(--display); color: var(--ink); }
details.notes p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .card, .btn { transition: none; } .card:hover, .btn:hover { transform: none; } }
</style>
<div class="mock"><b>Mockup</b>Example member and example numbers to judge the layout. The live page fills these from the real payout records.</div>
<div class="wrap">
<header class="bar">
<div class="logo"><svg viewBox="0 0 64 64" aria-hidden="true"><path d="M32 4l24 14v28L32 60 8 46V18z" fill="#8247e5"/><path d="M20 28l12-7 12 7v10l-12 7-12-7z" fill="#ffc24b"/></svg>Stack POL</div>
<div class="live"><span class="dot"></span>Ledger refreshed 3 min ago</div>
</header>
<section class="hero">
<div>
<div class="who"><span class="av">M</span><div><b>@martbost</b><span>Stacking POL since September 2026</span></div></div>
<p class="kick">Paid straight to one wallet</p>
<div class="total"><span class="n" id="tot">0</span><span class="u">POL</span></div>
<div class="verify"><svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><path d="M5 12l5 5 9-10"/></svg>From <b id="nprog">7</b>&nbsp;programs, every payment on Polygon</div>
<div class="bar-wrap"><div class="stackbar" id="sbar" aria-label="How the stack splits across programs"></div><div class="keys" id="keys"></div></div>
<div class="cta">
<a class="btn" href="#programs">Start your own stack, free</a>
<span class="fine">Free to join. One member's results, not a promise. What you stack depends on what you do.</span>
</div>
</div>
<aside class="vid">
<div class="frame"><video id="hero" src="{{video}}" poster="{{poster}}" autoplay muted loop playsinline></video><button class="snd" id="snd" type="button">Tap for sound</button></div>
<div class="trust"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#4ade80" stroke-width="2.4"><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/><path d="M8.5 12l2.5 2.5 4.5-5"/></svg><span><b>Nothing typed in by hand.</b> Every amount is a real Polygon transaction to this member's wallet. Check any of them in the ledger below.</span></div>
</aside>
</section>
<div class="sec-head" id="programs"><h2>Where the POL comes from</h2><p>Tap any program to start. Each pays to your own wallet.</p></div>
<div id="feature"></div>
<div class="cards" id="cards"></div>
<div class="sec-head"><h2>Every payment, in one ledger</h2><p>Refreshed every 5 minutes. Each line links to its Polygon transaction.</p></div>
<div class="ltools">
<button class="chip" type="button" aria-pressed="true" data-f="all">Whole network</button>
<button class="chip" type="button" aria-pressed="false" data-f="me">Just @martbost</button>
<span class="stamp"><span class="dot"></span>Next refresh in <span id="nx">2:00</span></span>
</div>
<div class="tbl"><table>
<thead><tr><th>Program</th><th>Paid to</th><th class="r">Amount</th><th>When (CT)</th><th>Transaction</th></tr></thead>
<tbody id="led"></tbody>
</table></div>
<details class="notes"><summary>Mockup notes for Marty (not on the live page)</summary><div class="grid">
<div><h3>Totals</h3><p>A small indexer refreshes every 5 minutes from each game's payout log and from the InstantAdPay and RM Circle contracts. Page loads read the cached copy, never the chain.</p></div>
<div><h3>Join buttons</h3><p>Our programs build the member's link from their InstantAdPay username (?ref=). Outside programs come from their cryptoteambuild.com downline builder entries, falling back to their sponsor's link.</p></div>
<div><h3>Order</h3><p>Cards sort by what the member has earned, so the strongest proof leads. New or seasonal programs (Turkey Drop this month) carry a tag.</p></div>
<div><h3>Opt-in</h3><p>Members switch on "show my stack" in InstantAdPay Promo tools, where they also get the link, QR code and their own view, click and signup stats.</p></div>
</div></details>
</div>
<script>
(() => {
const P = [
{ k: 'iap', n: 'InstantAdPay', c: '#2dd4bf', a: 168.42, p: 37, d: 'Advertise and earn. Every payout splits on-chain the second an ad sells.', img: '{{img:iap}}' },
{ k: 'ls', n: 'LinkSpin', c: '#3b82f6', a: 64.3, p: 21, d: 'Free link tools: spin links, bridge pages and ad zones. Package sales pay the sponsor line in POL in the same transaction.', img: '{{img:ls}}' },
{ k: 'rmc', n: 'RM Circle', c: '#ffc24b', a: 91.5, p: 12, d: 'Premium team build on Polygon. Get your 2, help your 2 get theirs.', img: '{{img:rmc}}' },
{ k: 'ph', n: 'PolHunter', c: '#a3e635', a: 58.21, p: 41, d: 'Visit our sites, find the code, get a drip of POL straight to your wallet.', img: '{{img:ph}}' },
{ k: 'pd', n: 'PassiveDrip', c: '#b794ff', a: 31.06, p: 19, d: 'Faucet, offers and paid views that pay out in POL every day.', img: '{{img:pd}}' },
{ k: 'dr', n: 'Drip Runner', c: '#38bdf8', a: 21.88, p: 26, d: 'Tap-to-hop runner game. First clear of each chapter drips POL.', img: '{{img:dr}}' },
{ k: 'gk', n: 'Gem Kingdom', c: '#f472b6', a: 14.6, p: 6, d: 'Fantasy match-3. First clears and boss wins pay POL.', img: '{{img:gk}}' },
{ k: 'sw', n: 'SpellWheel', c: '#facc15', a: 9.4, p: 11, d: 'Word puzzle. Swipe the letters, fill the grid, and finished chapters pay POL.', img: '{{img:sw}}' },
{ k: 'ch', n: 'ClutterHunt', c: '#34d399', a: 7.85, p: 14, d: 'Hidden-object game with new rooms every season. Found items pay POL.', img: '{{img:ch}}' },
{ k: 'ra', n: 'Road Agent', c: '#f59e0b', a: 6.2, p: 5, d: 'Night-highway shooter. Clear sectors and get paid in POL.', img: '{{img:ra}}' },
{ k: 'pb', n: 'PolyBreak', c: '#60a5fa', a: 4.1, p: 8, d: 'Brick breaker on Polygon. Cleared levels pay POL.', img: '{{img:pb}}' },
{ k: 'pm', n: 'POL Miner', c: '#c084fc', a: 3.05, p: 9, d: 'Dig down through the layers. Ore you bring up pays POL.', img: '{{img:pm}}' },
{ k: 'pw', n: 'PolyWarriors', c: '#22d3ee', a: 2.4, p: 3, d: 'Cyberpunk battle game. Wins and missions pay POL.', img: '{{img:pw}}' },
{ k: 'td', n: 'Turkey Drop', c: '#fb923c', a: 1.6, p: 2, d: 'Catch the falling turkeys. Score milestones pay POL, and the top 3 every week win prizes.', img: '{{img:td}}', tag: 'This season', ends: 'Season runs November 2 to 30.' },
];
const fmt = n => n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
const total = P.reduce((s, x) => s + x.a, 0), earned = P.filter(x => x.a > 0);
document.getElementById('nprog').textContent = earned.length;
document.getElementById('sbar').innerHTML = earned.map(x => '<i style="--c:' + x.c + ';flex:' + x.a + '" title="' + x.n + ': ' + fmt(x.a) + ' POL"></i>').join('');
document.getElementById('keys').innerHTML = earned.map(x => '<span style="--c:' + x.c + '"><i></i>' + x.n + ' <b>' + fmt(x.a) + '</b></span>').join('');
const feat = P.filter(x => x.tag), sorted = P.filter(x => !x.tag).sort((a, b) => b.a - a.a);
document.getElementById('feature').innerHTML = feat.map(x => '<article class="feature"><img src="' + x.img + '" alt="' + x.n + '"><div class="fb"><span class="ftag">' + x.tag + '</span><h3>' + x.n + '</h3><p>' + x.d + '</p><span class="ends">' + x.ends + '</span><a href="#programs">Play ' + x.n + ' free</a></div></article>').join('');
document.getElementById('cards').innerHTML = sorted.map(x => '<article class="card" style="--c:' + x.c + '"><div class="img"><img src="' + x.img + '" alt="' + x.n + '"></div><div class="body"><div class="head"><div class="nm"><i></i>' + x.n + '</div>'
+ '<div class="earned"><b>' + fmt(x.a) + '<small>POL</small></b><span>' + x.p + ' payments</span></div></div><p>' + x.d + '</p><a class="join" href="#programs"><span>Join ' + x.n + ' free</span></a></div></article>').join('');
// count-up on the big number from a visible resting value
const el = document.getElementById('tot'), reduce = matchMedia('(prefers-reduced-motion: reduce)').matches;
if (reduce) el.textContent = fmt(total); else { el.textContent = fmt(total * 0.6); const t0 = performance.now(); const step = t => { const k = Math.min(1, (t - t0) / 1400); el.textContent = fmt(total * (0.6 + 0.4 * (1 - Math.pow(1 - k, 3)))); if (k < 1) requestAnimationFrame(step); }; requestAnimationFrame(step); }
// example ledger rows
const users = ['@martbost', '@mhugh50', '@opgnetwerk', '@clinton', '@harveysilverfox', '@zerohealthcost', '@rcmjosephg', '@gregjerome148'];
let seed = 7; const rnd = () => (seed = (seed * 16807) % 2147483647) / 2147483647;
const hex = () => '0x' + Math.floor(rnd() * 16777215).toString(16).padStart(6, '0') + '…' + Math.floor(rnd() * 65535).toString(16).padStart(4, '0');
const rows = []; let min = 2;
for (let i = 0; i < 14; i++) {
const p = earned[Math.floor(rnd() * earned.length)], u = i % 3 === 0 ? '@martbost' : users[1 + Math.floor(rnd() * 7)];
const amt = p.k === 'iap' ? 2 + rnd() * 9 : p.k === 'rmc' ? 4 + rnd() * 14 : p.k === 'gk' ? (rnd() < .3 ? 5 : 0.25) : 0.25 + rnd() * 0.6;
const h = new Date(Date.now() - min * 60000); min += 3 + Math.floor(rnd() * 14);
rows.push({ p, u, amt, t: h.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', timeZone: 'America/Chicago' }), tx: hex() });
}
const body = document.getElementById('led');
const draw = f => { body.innerHTML = rows.filter(r => f !== 'me' || r.u === '@martbost').map(r => '<tr' + (r.u === '@martbost' ? ' class="me"' : '') + '><td class="pg"><div class="pgc"><img src="' + r.p.img + '" alt="">' + r.p.n + '</div></td><td class="who">' + r.u + '</td><td class="amt">' + fmt(r.amt) + '</td><td class="when">' + r.t + '</td><td class="tx">' + r.tx + '<span>Polygonscan ↗</span></td></tr>').join(''); };
draw('all');
document.querySelectorAll('.chip').forEach(b => b.addEventListener('click', () => { document.querySelectorAll('.chip').forEach(x => x.setAttribute('aria-pressed', String(x === b))); draw(b.dataset.f); }));
let left = 120; const nx = document.getElementById('nx'); setInterval(() => { left = left > 0 ? left - 1 : 300; nx.textContent = Math.floor(left / 60) + ':' + String(left % 60).padStart(2, '0'); }, 1000);
const v = document.getElementById('hero'), sb = document.getElementById('snd');
sb.addEventListener('click', () => { v.muted = !v.muted; sb.textContent = v.muted ? 'Tap for sound' : 'Sound on'; if (!v.muted) { v.currentTime = 0; v.play().catch(() => {}); } });
})();
</script>
+210
View File
@@ -0,0 +1,210 @@
// My Stack POL (Marty approved 2026-11-19: "why is there no login to get to their links and other stuff"). The signed-in member area
// at /my. Sign-in is the network sign-in through the hub (networksso.js, the same file as every rebuilt site): no passwords, no local
// accounts. Public pages, the ledger, totals and the blog never need it.
//
// Session: a signed cookie sp.sid ("v1.<base64url JSON {e, w, n, iat, exp}>.<HMAC-SHA256>", 7 days, HttpOnly, SameSite=Lax) keyed off
// HUB_SECRET, so there is no session table to lose. Sign out ends every Stack POL session of that member: my-signouts.json
// { sha256(email): ms } (a MySQL document through docstore.js) refuses any cookie issued before it. sp.in=1 (not HttpOnly, no data)
// only tells the header to say "My Stack POL" instead of "Sign in" on cached public pages.
// Who the member is here: their IAP username (what stackpol.com/<username> and the ledger use). IAP's own answer when the switch
// interface is on (iapswitch.js), else the wallet their network sign-in carries matched against the indexer's wallet list, else their
// network username.
// What /my shows comes from the last indexer snapshot (IDX.my, see tools/indexer.py): their own payout rows and totals exactly as the
// ledger has them, their page switch, Pro (IAP's rule, mirrored in stack-optin.json pro), and their join links (programs.js, the same
// links their public page uses).
// The switch: iapswitch.js. A switch made here is also remembered in my-switch.json { username: { on, at } } until the next snapshot
// (newer than `at`) carries IAP's answer, so a switch-off hides the public page at once, not 5 minutes later.
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const iapswitch = require('./iapswitch');
let D = null; // { idx(), PROGRAMS, BY_KEY, head, tail, esc, fmt, fmtInt, when, ledgerRows, tableHead, SITE, dataDir, qr }
const AGE = 7 * 86400; // seconds
const NAME_RE = /^[a-z0-9_]{3,30}$/;
const WALLET_RE = /^0x[0-9a-f]{40}$/;
const BOOT_KEY = crypto.randomBytes(32); // local runs without HUB_SECRET: sessions last until a restart
const skey = () => { const h = String(process.env.HUB_SECRET || '').trim(); return h.length >= 32 ? crypto.createHmac('sha256', h).update('stackpol.session.v1').digest() : BOOT_KEY; };
const b64u = buf => Buffer.from(buf).toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
const unb64u = s => Buffer.from(String(s).replace(/-/g, '+').replace(/_/g, '/'), 'base64');
const mac = s => crypto.createHmac('sha256', skey()).update('spsess.v1.' + s).digest();
const ehash = e => crypto.createHash('sha256').update(String(e || '').toLowerCase()).digest('hex');
const isProd = () => /^https:/.test(D ? D.SITE : '');
const ck = (k, v, age, httpOnly) => k + '=' + encodeURIComponent(v) + '; Path=/; SameSite=Lax; Max-Age=' + age + (httpOnly ? '; HttpOnly' : '') + (isProd() ? '; Secure' : '');
function init(deps) { D = deps; }
function cookies(req) {
const out = {};
for (const p of String(req.headers.cookie || '').split(';')) { const i = p.indexOf('='); if (i > 0) { try { out[p.slice(0, i).trim()] = decodeURIComponent(p.slice(i + 1).trim()); } catch (e) {} } }
return out;
}
// ---- documents (MySQL through docstore, files in DATA_DIR locally) ----
const docPath = n => path.join(D.dataDir, n);
function readDoc(n) { try { return JSON.parse(fs.readFileSync(docPath(n), 'utf8')) || {}; } catch (e) { return {}; } }
function writeDoc(n, o) { const f = docPath(n); fs.writeFileSync(f + '.tmp', JSON.stringify(o)); fs.renameSync(f + '.tmp', f); }
// ---- session ----
function mintSession(o) {
const now = Date.now();
const t = { e: String(o.email || '').toLowerCase(), iat: now, exp: now + AGE * 1000 };
if (o.wallet && WALLET_RE.test(String(o.wallet).toLowerCase())) t.w = String(o.wallet).toLowerCase();
if (o.name && /^[A-Za-z0-9_.-]{1,40}$/.test(String(o.name))) t.n = String(o.name);
const body = b64u(JSON.stringify(t));
return ck('sp.sid', 'v1.' + body + '.' + b64u(mac(body)), AGE, true);
}
// -> { email, address, name, iat } or null
function session(req) {
const m = /^v1\.([A-Za-z0-9_-]{10,1500})\.([A-Za-z0-9_-]{43})$/.exec(cookies(req)['sp.sid'] || '');
if (!m) return null;
const want = mac(m[1]), got = unb64u(m[2]);
if (want.length !== got.length || !crypto.timingSafeEqual(want, got)) return null;
let t; try { t = JSON.parse(unb64u(m[1]).toString('utf8')); } catch (e) { return null; }
if (!t || !/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(t.e || '')) || !(Number(t.exp) > Date.now())) return null;
const out = Number(readDoc('my-signouts.json')[ehash(t.e)] || 0);
if (Number(t.iat) <= out) return null; // signed out after this cookie was made
return { email: t.e, address: t.w || null, name: t.n || null, iat: Number(t.iat) };
}
function signOut(email) {
const so = readDoc('my-signouts.json'); so[ehash(email)] = Date.now(); writeDoc('my-signouts.json', so);
}
const clearCookies = () => [ck('sp.sid', '', 0, true), ck('sp.in', '', 0, false)];
// ---- who and what ----
let wIdx = { of: null, map: new Map() };
function walletUser(w) {
const idx = D.idx(); if (!idx || !w) return null;
if (wIdx.of !== idx) { const map = new Map(); for (const [un, m] of Object.entries((idx.my && idx.my.members) || {})) for (const a of m.wallets || []) if (!map.has(a)) map.set(a, un); wIdx = { of: idx, map }; }
return wIdx.map.get(String(w).toLowerCase()) || null;
}
// the switch made on /my that the snapshot has not caught up with yet (null when the snapshot is newer)
function pendingSwitch(un) {
const x = readDoc('my-switch.json')[un]; const idx = D.idx();
if (!x || typeof x.on !== 'boolean') return null;
if (idx && Number(idx.at) > Number(x.at)) return null;
return x;
}
// a public page the member switched off here: hidden before the next snapshot shows it (server.js asks)
const hiddenNow = un => { const x = pendingSwitch(un); return !!(x && x.on === false); };
async function view(s) {
const idx = D.idx() || {}; const my = idx.my || {};
const live = iapswitch.configured() ? await iapswitch.get(s.email) : { ok: false, reason: 'off' };
const byName = s.name && NAME_RE.test(String(s.name).toLowerCase()) ? String(s.name).toLowerCase() : null;
const un = (live.ok && live.username) || walletUser(s.address) || byName;
if (!un) return { un: null, live };
const m = (my.members || {})[un] || null;
const stack = (idx.stacks || {})[un] || null;
const pend = pendingSwitch(un);
const explicit = (my.switch || {})[un];
const on = live.ok ? live.on : pend ? pend.on : explicit !== false;
const pro = live.ok ? live.pro : (my.pro || []).includes(un) || !!(stack && stack.pro);
const pageLive = on && !!stack && !(pend && pend.on === false);
return { un, m, stack, on, pro, pageLive, live, pend, wallets: m && m.wallets && m.wallets.length ? m.wallets : (s.address ? [s.address] : []) };
}
// ---- the page ----
const COPY_JS = '<script>(function(){document.querySelectorAll("[data-copy]").forEach(function(b){b.addEventListener("click",function(){var t=document.getElementById(b.getAttribute("data-copy"));if(!t)return;var v=t.value||t.textContent;var done=function(){var o=b.textContent;b.textContent="Copied";setTimeout(function(){b.textContent=o;},1600);};if(navigator.clipboard&&window.isSecureContext){navigator.clipboard.writeText(v).then(done,function(){t.select&&t.select();document.execCommand("copy");done();});}else{t.select&&t.select();document.execCommand("copy");done();}});});})();</script>';
const copyRow = (id, value, label) => '<div class="cprow">' + (label ? '<label for="' + id + '">' + D.esc(label) + '</label>' : '') + '<div class="cpbox"><input id="' + id + '" type="text" readonly value="' + D.esc(value) + '" spellcheck="false"><button type="button" class="cpb" data-copy="' + id + '">Copy</button></div></div>';
function signedOutPage(q) {
let h = D.head({ title: 'My Stack POL: Sign In | Stack POL', desc: 'Sign in with your network account to see your Stack POL page, your join links and your own payouts.', path: '/my', nav: '/my', noindex: true });
h += '<section class="myhero"><p class="kick">My Stack POL</p><h1>Your page, your links, your payouts</h1>'
+ '<p class="lead">Sign in with the account you already use across the network (InstantAdPay, LinkSpin and the rest). No new password, nothing to set up.</p>';
if (q.out) h += '<p class="mynote ok">You are signed out of Stack POL.</p>';
if (q.signin === 'none') h += '<p class="mynote">This browser is not signed in anywhere in the network yet. Sign in on InstantAdPay and it brings you straight back here.</p>';
h += '<div class="cta"><a class="btn" href="/sso/start?mode=go&amp;to=%2Fmy" rel="nofollow">Sign in with your network account</a>'
+ '<a class="btn sec" href="https://instantadpay.com/my?return=stackpol&amp;to=%2Fmy" rel="nofollow noopener">Sign in on InstantAdPay</a></div>'
+ '<p class="fine" style="max-width:60ch;margin-top:16px">New here? <a href="https://instantadpay.com/join/martbost?src=stackpol" rel="noopener">Join InstantAdPay free</a>. Your Stack POL page lives at stackpol.com/your-username once your first payout lands.</p></section>';
return h + D.tail();
}
function memberPage(s, v, q) {
const { esc, fmt, fmtInt, PROGRAMS, BY_KEY } = D;
let h = D.head({ title: 'My Stack POL | Stack POL', desc: 'Your Stack POL page, join links, share kit and payouts.', path: '/my', nav: '/my', noindex: true });
const un = v.un;
h += '<section class="myhero"><div class="myhead"><div class="who"><span class="av">' + esc((un || s.email)[0].toUpperCase()) + '</span><div><b>' + (un ? '@' + esc(un) : 'Signed in') + '</b><span>Signed in with your network account</span></div></div>'
+ '<form method="post" action="/api/my/signout" class="soform"><button class="btn sec" type="submit">Sign out</button></form></div>';
if (q.sw === 'err') h += '<p class="mynote warn">That switch did not go through. InstantAdPay did not answer; nothing changed. Try again in a minute, or use the switch in InstantAdPay Promo tools.</p>';
if (q.sw === 'ok') h += '<p class="mynote ok">Saved in InstantAdPay. Your page ' + (v.on ? 'is switched on' : 'is switched off') + '.</p>';
h += '</section>';
if (!un) {
h += '<section class="mycard"><h2>Pick a username first</h2><p class="lead">Your Stack POL page lives at stackpol.com/your-username, the username on your InstantAdPay account. This account does not have one we can see yet.</p><div class="cta"><a class="btn" href="https://instantadpay.com/my" rel="noopener">Open InstantAdPay</a></div></section>';
return h + D.tail();
}
const pageUrl = D.SITE + '/' + un;
const m = v.m;
// 1. the page and its switch
h += '<div class="mygrid"><section class="mycard"><div class="mct"><h2>Your Stack POL page</h2><span class="pill ' + (v.on ? 'on' : 'off') + '">' + (v.on ? 'On' : 'Off') + '</span></div>';
h += copyRow('pageurl', pageUrl);
if (v.pageLive) h += '<p class="mysub">Live now. <a href="/' + esc(un) + '" target="_blank" rel="noopener">Open your page</a></p>';
else if (!v.on) h += '<p class="mysub">Switched off: stackpol.com/' + esc(un) + ' shows "not switched on" and the ledger lists your payouts without a link.</p>';
else if (!m) h += '<p class="mysub">Switched on. Your page goes live with your first payout on the ledger.</p>';
else h += '<p class="mysub">Switched on. Your page shows on the next ledger refresh (every 5 minutes).</p>';
if (iapswitch.configured()) {
h += '<form method="post" action="/api/my/switch" class="swform"><input type="hidden" name="on" value="' + (v.on ? '0' : '1') + '"><button class="btn' + (v.on ? ' sec' : '') + '" type="submit">' + (v.on ? 'Switch my page off' : 'Switch my page on') + '</button></form>'
+ '<p class="fine">This is the same switch as InstantAdPay Promo tools &gt; Stack POL. Change it in either place.' + (v.live.ok ? '' : ' (InstantAdPay did not answer just now; the state shown is from the last ledger refresh.)') + '</p>';
} else {
h += '<div class="cta" style="margin-top:12px"><a class="btn sec" href="' + esc(iapswitch.promoUrl()) + '" rel="noopener">Change it in InstantAdPay</a></div><p class="fine">The switch lives in InstantAdPay Promo tools &gt; Stack POL. The state shown is from the last ledger refresh.</p>';
}
h += '</section>';
// 2. Pro
h += '<section class="mycard"><div class="mct"><h2>Stack POL Pro</h2><span class="pill ' + (v.pro ? 'on' : 'off') + '">' + (v.pro ? 'Pro' : 'Not yet') + '</span></div>';
if (v.pro) {
const pr = v.stack && v.stack.pro;
h += '<p class="mysub">Your page shows your own LinkSpin Banner Spins in the ad spots and your spin links, with your QR code. Any page opened with ?ref=' + esc(un) + ' carries your referral.</p>';
if (pr) h += '<p class="mysub">On your page now: ' + fmtInt((pr.spins || []).length) + ' Banner Spin' + ((pr.spins || []).length === 1 ? '' : 's') + ', ' + fmtInt((pr.links || []).length) + ' spin link' + ((pr.links || []).length === 1 ? '' : 's') + '. <a href="https://linkspin.app/my" rel="noopener">Manage them in LinkSpin</a></p>';
if (pr) h += pr.video ? '<p class="mysub">Your videos: the Video Spin "' + esc(pr.video.name) + '" (' + fmtInt(pr.video.count) + ' video' + (pr.video.count === 1 ? '' : 's') + ') shows on your page. <a href="https://linkspin.app/links" rel="noopener">Change it in LinkSpin</a></p>'
: '<p class="mysub">No videos on your page yet. Make a video on Video App Income (the first one is free), then add it to a Video Spin in LinkSpin and it shows here. <a href="https://videoappincome.com/join?ref=' + esc(un) + '" rel="noopener">Make your first video</a></p>';
h += copyRow('refurl', D.SITE + '/?ref=' + un, 'Any Stack POL page with your referral');
} else {
h += '<p class="mysub">Pro unlocks one time with any InstantAdPay ad package of $10 or more: your banners in the ad spots, your links and your QR code on your page.</p><div class="cta" style="margin-top:12px"><a class="btn sec" href="https://instantadpay.com/my#promo?s=stackpol" rel="noopener">See Pro in InstantAdPay</a></div>';
}
h += '</section></div>';
// 3. join links
h += '<div class="sec-head"><h2>Your join links</h2><p>The same links your public page uses. Each one credits you.</p></div><div class="jlinks">'
+ PROGRAMS.map((p, i) => '<div class="jl" style="--c:' + p.c + '"><div class="jn"><i></i><b>' + esc(p.n) + '</b><span>' + esc(p.kind) + '</span></div>' + copyRow('j' + i, p.join(un)) + '</div>').join('') + '</div>';
// 4. share kit
const share = 'Every POL payout I have stacked across the network, each one a Polygon transaction you can check: ' + pageUrl;
h += '<div class="sec-head"><h2>Share kit</h2><p>Your page link, a ready post and the Stack POL images.</p></div><div class="mygrid">';
h += '<section class="mycard">' + copyRow('kurl', pageUrl, 'Your page') + '<div class="cprow"><label for="kpost">A ready post</label><div class="cpbox"><textarea id="kpost" readonly rows="3">' + esc(share) + '</textarea><button type="button" class="cpb" data-copy="kpost">Copy</button></div></div>'
+ copyRow('kembed', '<a href="' + pageUrl + '"><img src="' + D.SITE + '/og-stackpol-1200x630.jpg" width="600" height="315" alt="Stack POL: every POL payout, stacked"></a>', 'Banner code for a site or blog')
+ (v.pro && D.qr ? '<div class="kqr"><img src="/qr/' + esc(un) + '.svg" alt="QR code for your page" width="120" height="120"><span>Your QR code. <a href="/qr/' + esc(un) + '.svg" download="stackpol-' + esc(un) + '-qr.svg">Download</a></span></div>' : '') + '</section>';
h += '<section class="mycard kimgs">' + [['/og-stackpol-1200x630.jpg', 'Share image 1200x630', 'stackpol-share-1200x630.jpg'], ['/stackpol-hero-poster.jpg', 'Coin stack still', 'stackpol-coins.jpg']]
.map(([src, label, fn]) => '<figure><img src="' + src + '" alt="' + esc(label) + '" loading="lazy"><figcaption>' + esc(label) + ' <a href="' + src + '" download="' + fn + '">Download</a></figcaption></figure>').join('') + '</section></div>';
// 5. payouts
h += '<div class="sec-head"><h2>Your payouts</h2><p>From the Stack POL ledger, your wallet' + (v.wallets.length === 1 ? '' : 's') + ' only.' + (D.idx() && D.idx().at ? ' Refreshed ' + D.when(D.idx().at) + '.' : '') + '</p></div>';
if (!m) {
h += '<section class="mycard"><p class="lead" style="margin:0">No payouts on the ledger for @' + esc(un) + ' yet. Payouts from any program in the network show here within 5 minutes of landing in your wallet.</p></section>';
} else {
const ps = PROGRAMS.filter(p => m.byProg[p.k]).sort((a, b) => m.byProg[b.k].pol - m.byProg[a.k].pol);
h += '<section class="mycard"><div class="total"><span class="n">' + fmt(m.total) + '</span><span class="u">POL</span></div><div class="stats"><div><b>' + fmtInt(m.payments) + '</b><span>payments</span></div><div><b>' + fmtInt(ps.length) + '</b><span>programs</span></div>'
+ (m.since ? '<div><b>' + new Date(m.since).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'America/Chicago' }) + '</b><span>first payout</span></div>' : '') + '</div>'
+ '<div class="keys">' + ps.map(p => '<span style="--c:' + p.c + '"><i></i>' + esc(p.n) + ' <b>' + fmt(m.byProg[p.k].pol) + '</b></span>').join('') + '</div>'
+ (v.wallets.length ? '<p class="mysub" style="margin-top:12px">Wallet' + (v.wallets.length === 1 ? '' : 's') + ': ' + v.wallets.map(w => '<a class="mono" href="https://polygonscan.com/address/' + esc(w) + '" target="_blank" rel="noopener">' + esc(w.slice(0, 6) + '…' + w.slice(-4)) + ' ↗</a>').join(' ') + '</p>' : '') + '</section>';
const rows = m.rows || [];
h += D.tableHead(false) + D.ledgerRows(rows, false) + '</tbody></table></div>';
if (rows.length < m.payments) h += '<p class="fine" style="margin-top:8px">Showing your latest ' + fmtInt(rows.length) + ' of ' + fmtInt(m.payments) + ' payments. Every one is on Polygonscan under your wallet.</p>';
}
h += '<div class="myfoot"><form method="post" action="/api/my/signout"><button class="btn sec" type="submit">Sign out</button></form><form method="post" action="/api/my/signout"><input type="hidden" name="everywhere" value="1"><button class="linkbtn" type="submit">Sign out of the whole network</button></form></div>';
return h + D.tail(COPY_JS);
}
async function render(req, q) {
const s = session(req);
if (!s) return { body: signedOutPage(q), set: cookies(req)['sp.in'] ? clearCookies() : [] };
const v = await view(s);
return { body: memberPage(s, v, q), set: cookies(req)['sp.in'] === '1' ? [] : [ck('sp.in', '1', AGE, false)] };
}
// POST /api/my/switch (form: on=1|0). -> { ok, on } or { ok: false, reason }
async function doSwitch(s, on) {
if (!iapswitch.configured()) return { ok: false, reason: 'off' };
const r = await iapswitch.set(s.email, on);
if (!r.ok) return r;
const un = r.username; if (!un) return { ok: false, reason: 'no username' };
const doc = readDoc('my-switch.json'); doc[un] = { on: r.on, at: Date.now() }; writeDoc('my-switch.json', doc);
return { ok: true, on: r.on, username: un };
}
module.exports = { init, session, mintSession, signOut, clearCookies, render, doSwitch, hiddenNow, view, cookies, NAME_RE };
+55
View File
@@ -0,0 +1,55 @@
// Network deals for this site's "Network Weekend" ribbon (Marty 2026-11-17). One source: the hub's public GET /v1/network-deals
// (HUB_URL). Cached 2 minutes, refreshed in the background, never waits on a slow hub (2.5 s timeout); hub down = no ribbon.
// The same file lives in every network site. Never RM Circle, never the games (the hub list never names them).
// The page (/assets/netweekend.js) switches the ribbon on and off by its own clock at startsAt / endsAt, so a cached copy never
// shows early or late. setLocal(fn) lets a site rewrite its own deal line from live data (for example a price read from chain),
// so the ribbon never shows a number the contract does not charge: fn(deal) returns the deal, a changed copy, or null to drop it.
const TTL = 2 * 60 * 1000;
let cache = { at: 0, body: { events: [] } };
let inflight = null;
let local = null;
const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, '');
const safeUrl = u => (/^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(u || '')) ? String(u) : '');
const str = (v, n) => String(v == null ? '' : v).slice(0, n || 300);
function clean(j) {
if (!j || !Array.isArray(j.events)) return null;
return { events: j.events.slice(0, 5).filter(e => e && e.id && !Number.isNaN(Date.parse(e.startsAt)) && !Number.isNaN(Date.parse(e.endsAt))).map(e => ({
id: str(e.id, 60), name: str(e.name, 60), tagline: str(e.tagline, 160), url: safeUrl(e.url), startsAt: e.startsAt, endsAt: e.endsAt,
days: e.days && typeof e.days === 'object' ? Object.fromEntries(Object.entries(e.days).slice(0, 20).map(([k, v]) => [str(k, 10), str(v, 40)])) : {},
deals: (Array.isArray(e.deals) ? e.deals : []).slice(0, 40).map(d => {
const x = { site: str(d.site, 30), name: str(d.name, 80), url: safeUrl(d.url), text: str(d.text), endsAt: Number.isNaN(Date.parse(d.endsAt)) ? e.endsAt : d.endsAt };
if (d.note) x.note = str(d.note, 120);
if (d.byDay && typeof d.byDay === 'object') x.byDay = Object.fromEntries(Object.entries(d.byDay).slice(0, 20).map(([k, v]) => [str(k, 10), str(v)]));
return x;
})
})) };
}
function refresh() {
if (inflight || process.env.NETWORK_DEALS_HUB === '0') return inflight;
const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500);
inflight = fetch(hubUrl() + '/v1/network-deals', { signal: ac.signal })
.then(r => (r.ok ? r.json() : null))
.then(j => { const b = clean(j); if (b) cache = { at: Date.now(), body: b }; else cache.at = Date.now(); })
.catch(() => { cache.at = Date.now() - TTL + 30 * 1000; }) // hub down: try again in 30 s, keep the last good copy
.finally(() => { clearTimeout(t); inflight = null; });
return inflight;
}
function current() { if (Date.now() - cache.at > TTL) refresh(); return cache.body; }
function setLocal(fn) { local = typeof fn === 'function' ? fn : null; }
function withLocal(body, self) {
if (!local) return body;
return { events: body.events.map(e => Object.assign({}, e, { deals: e.deals.map(d => {
if (d.site !== self) return d;
try { const r = local(Object.assign({}, d)); return r === undefined ? d : r; } catch (err) { return d; }
}).filter(Boolean) })) };
}
// GET /api/network-deals: public, short cache, the same answer on every page. self = this site's network id (NETWORK_SITE_ID).
async function handle(req, res, self) {
if (!cache.at) { try { await refresh(); } catch (e) {} } // first ask after a boot waits for the hub once (2.5 s cap)
const me = String(self || process.env.NETWORK_SITE_ID || '').trim().toLowerCase();
const body = Object.assign({ self: me }, withLocal(current(), me));
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=60', 'X-Content-Type-Options': 'nosniff' });
res.end(JSON.stringify(body));
}
module.exports = { current, handle, refresh, setLocal, clean, _set: b => { cache = { at: Date.now(), body: clean(b) || { events: [] } }; } };
+204
View File
@@ -0,0 +1,204 @@
// Shared network knowledge, site side (Marty 2026-11-15: every network site's chatbot answers about the whole network, with its
// own site first). This site publishes its own knowledge-base entries to the network hub and reads the merged set back:
// PUT HUB_URL/v1/kb {name, url, entries} replaces this site's set (the hub skips a set it already holds)
// GET HUB_URL/v1/kb signed over an empty body, If-None-Match: the last version -> 304 when nothing changed
// Signed as HUB_SITE with HUB_SECRET (X-Hub-Site, X-Hub-Ts, X-Hub-Sig = hex HMAC-SHA256(ts + "\n" + raw body)), like hubreport.js.
// The merged set is kept in memory and in DATA_DIR/netkb-cache.json (a MySQL document through docstore where the site has
// DOCSTORE_URL; written only when the version changes), so a hub outage at boot still answers about the other sites.
// Off when HUB_URL or a 32+ character HUB_SECRET is missing, or NETKB=0: the chatbot then answers about this site only.
//
// SEMANTIC MATCHING (Marty 2026-11-16): the hub matches a question by meaning against the whole network KB with the free core2
// embeddings model (POST HUB_URL/v1/kb/match). match() asks it with a strict timeout (NETKB_MATCH_MS, default 1500) and fails
// soft: an error or a timeout answers null and the next MATCH_PAUSE_MS skip the hub, so the chat never waits on a slow model and
// the site's own BM25 retrieval (kb.js) answers as before. route() turns a match into the chatbot's decision:
// - this site's own entry, raw score >= SEM.answer with a clear lead (or the instant-answer pattern agrees): the answer itself
// - the instant-answer pattern hit kept when the match agrees (its entry within SEM.agree of the top), or when the match has
// no idea (top below SEM.unsure); this site's own entries rank first unless another site is named or clearly closer
// - otherwise no instant answer (the regex is overruled by meaning); the entries >= SEM.context feed the AI prompt
// suggest() gives the support desk's new-ticket form the closest help answers (KB entries only) the same way, BM25 as the fallback.
// Off with NETKB_MATCH=0. Thresholds measured on bge-large-en-v1.5 over the network KB (2026-11-16). Tests: qa/netkb-semantic.test.mjs
// The SAME file ships in every network site (InstantAdPay, LinkSpin, ViralAdBlitz, DownlineHydra, 5xYourTeam, VBB, Downline
// Banners, Stack POL). Keep them identical.
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const REFRESH_MS = 10 * 60 * 1000;
let O = null; // { dataDir, site, name, url, netId, entries: async () => [...], linkFor: (url) => link }
let merged = { version: '', sites: {}, entries: [] }, loadedAt = 0, publishedHash = '', pubTimer = null, timer = null;
const stats = { published: 0, publishErrors: 0, reads: 0, notModified: 0, readErrors: 0, lastError: null, lastPublishAt: 0, lastReadAt: 0 };
const hubUrl = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const secret = () => String(process.env.HUB_SECRET || '').trim();
const siteName = () => String(process.env.HUB_SITE || (O && O.site) || '').trim();
const enabled = () => process.env.NETKB !== '0' && !!hubUrl() && secret().length >= 32 && !!siteName();
const cacheFile = () => (O && O.dataDir ? path.join(O.dataDir, 'netkb-cache.json') : null);
async function call(method, route, body, headers, timeoutMs) {
const raw = body === undefined ? '' : JSON.stringify(body); const ts = String(Date.now());
const sig = crypto.createHmac('sha256', secret()).update(ts + '\n' + raw).digest('hex');
const r = await fetch(hubUrl() + route, { method, body: method === 'GET' ? undefined : raw, signal: AbortSignal.timeout(timeoutMs || 15000),
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Hub-Site': siteName(), 'X-Hub-Ts': ts, 'X-Hub-Sig': sig }, headers || {}) });
let j = null; if (r.status !== 304) { try { j = await r.json(); } catch (e) {} }
return { status: r.status, body: j };
}
// the entries this site shares: what the chatbot's knowledge base holds, minus the instant-answer patterns (those stay home)
const shape = e => ({ id: String(e.id), title: e.title, questions: (e.questions || []).slice(0, 15), answer: e.answer, tags: (e.tags || []).slice(0, 15), link: e.link || (O && O.url) || undefined });
async function publish() {
if (!enabled() || !O || typeof O.entries !== 'function') return { skipped: true };
const entries = (await O.entries()).filter(e => e && e.id && e.answer && !e.deleted).map(shape);
const body = { name: O.name, url: O.url, entries };
const h = crypto.createHash('sha1').update(JSON.stringify(body)).digest('hex');
if (h === publishedHash) return { same: true };
try {
const r = await call('PUT', '/v1/kb', body);
if (r.status !== 200) { stats.publishErrors++; stats.lastError = 'publish ' + r.status + ' ' + ((r.body && r.body.error) || ''); return { error: stats.lastError }; }
publishedHash = h; stats.published++; stats.lastPublishAt = Date.now();
return r.body;
} catch (e) { stats.publishErrors++; stats.lastError = 'publish ' + e.message; return { error: e.message }; }
}
// an admin edit: publish a few seconds later (several quick edits go as one)
function publishSoon() { if (pubTimer) return; pubTimer = setTimeout(() => { pubTimer = null; publish().catch(() => {}); }, 5000); if (pubTimer.unref) pubTimer.unref(); }
function readCache() {
const f = cacheFile(); if (!f) return;
try { const d = JSON.parse(fs.readFileSync(f, 'utf8')); if (d && Array.isArray(d.entries)) { merged = d; loadedAt = 0; } } catch (e) {}
}
function writeCache() {
const f = cacheFile(); if (!f) return;
try { fs.writeFileSync(f + '.tmp', JSON.stringify(merged)); fs.renameSync(f + '.tmp', f); } catch (e) { console.error('netkb cache', e.message); }
}
async function refresh() {
if (!enabled()) return { skipped: true };
try {
const r = await call('GET', '/v1/kb', undefined, merged.version ? { 'If-None-Match': '"' + merged.version + '"' } : {});
stats.lastReadAt = Date.now();
if (r.status === 304) { stats.notModified++; loadedAt = Date.now(); return { same: true }; }
if (r.status !== 200 || !r.body || !Array.isArray(r.body.entries)) { stats.readErrors++; stats.lastError = 'read ' + r.status; return { error: stats.lastError }; }
merged = { version: String(r.body.version || ''), sites: r.body.sites || {}, entries: r.body.entries }; loadedAt = Date.now(); stats.reads++;
writeCache();
return { version: merged.version, count: merged.entries.length };
} catch (e) { stats.readErrors++; stats.lastError = 'read ' + e.message; return { error: e.message }; }
}
// other sites' entries, ready for the chatbot's index: id "<site>:<id>", plus where they come from and the link to send people to
function remote() {
const me = siteName(); const out = [];
for (const e of merged.entries || []) {
if (!e || e.site === me) continue;
const s = (merged.sites || {})[e.site] || {};
const url = s.url || e.link || '';
out.push({ id: e.site + ':' + e.id, title: e.title, questions: e.questions || [], answer: e.answer, tags: e.tags || [],
site: e.site, siteName: s.name || e.site, siteUrl: url, go: (O && typeof O.linkFor === 'function' && url ? O.linkFor(url) : '') || url });
}
return out;
}
// the network's sites as the hub knows them (name, link), this one left out
function sites() {
const me = siteName();
return Object.entries(merged.sites || {}).filter(([k]) => k !== me).map(([k, s]) => ({ site: k, name: s.name || k, url: s.url || '', go: (O && typeof O.linkFor === 'function' && s.url ? O.linkFor(s.url) : '') || s.url || '', count: s.count || 0 }));
}
// ---- semantic matching (2026-11-16)
const SEM = { answer: Number(process.env.NETKB_SEM_ANSWER) || 0.84, margin: 0.02, context: Number(process.env.NETKB_SEM_CONTEXT) || 0.68, unsure: 0.70, band: 0.08, away: 0.06, agree: 0.10, floor: 0.60 };
const MATCH_PAUSE_MS = 30000;
let matchDownUntil = 0;
const mstats = { matches: 0, matchErrors: 0, matchSkipped: 0, matchLastMs: 0, matchLastError: null, semAnswer: 0, semAgree: 0, semRegex: 0, semVeto: 0, semContext: 0 };
const matchOn = () => enabled() && process.env.NETKB_MATCH !== '0';
// -> the hub's answer {confidence, margin, hits: [{site, id, title, answer, score, boosted, home}]} or null (off, down, slow)
async function match(q, o) {
o = o || {};
if (!matchOn()) return null;
if (Date.now() < matchDownUntil) { mstats.matchSkipped++; return null; }
const t0 = Date.now();
try {
const body = { q: String(q || '').slice(0, 600), k: o.k || 6 };
if (o.prefer && o.prefer.length) body.prefer = o.prefer;
if (o.only && o.only.length) body.only = o.only;
const r = await call('POST', '/v1/kb/match', body, undefined, o.timeoutMs || Number(process.env.NETKB_MATCH_MS) || 1500);
mstats.matchLastMs = Date.now() - t0;
if (r.status !== 200 || !r.body || !Array.isArray(r.body.hits)) throw new Error('match ' + r.status + ' ' + ((r.body && r.body.error) || ''));
mstats.matches++;
return r.body;
} catch (e) { mstats.matchErrors++; mstats.matchLastError = e.message; matchDownUntil = Date.now() + MATCH_PAUSE_MS; return null; }
}
// msg + { fast: the instant-answer pattern hit (or null), own: this site's entries, prefer: [site ids the question names] }
// -> null (no match: the caller keeps its old path) or { via, hit: own entry to answer with | null, hits: [{entry, score}] for the prompt }
async function route(msg, o) {
o = o || {};
// a question that names another site but asks about "here" is about this site (e.g. "I am on InstantAdPay, does my team carry over here?")
const prefer = (o.prefer || []).length && !/\b(here|this site|this one)\b/i.test(msg) ? o.prefer : [];
const m = await match(msg, { k: 8, prefer });
if (!m) return null;
const me = siteName();
const own = new Map((o.own || []).map(e => [String(e.id), e]));
const rem = new Map(remote().map(e => [e.id, e]));
const all = m.hits.map(h => ({ entry: h.site === me ? own.get(String(h.id)) : rem.get(h.site + ':' + h.id), score: Number(h.score) || 0, home: h.site === me })).filter(h => h.entry);
let hits = all;
const named = prefer.length > 0, fast = o.fast || null;
if (!named) { // home-site first: this site's own entries lead; another site's ride behind them only when clearly closer (a thing only that site has)
const mine = hits.filter(h => h.home && h.score >= SEM.context);
const homeTop = mine.length ? mine[0].score : 0;
hits = mine.concat(hits.filter(h => !h.home && h.score >= homeTop + SEM.away));
}
const top = hits[0];
const ctx = top ? hits.filter(h => h.score >= SEM.context && (h.score >= top.score - SEM.band || !h.home)).map(h => ({ entry: h.entry, score: Math.round(h.score * 1000) / 1000 })) : [];
const out = (via, hit) => { mstats['sem' + via[0].toUpperCase() + via.slice(1)]++; return { via, hit, hits: ctx, confidence: top ? top.score : 0 }; };
if (top && top.home && !named && top.score >= SEM.answer && (Number(m.margin) >= SEM.margin || (fast && String(fast.id) === String(top.entry.id)))) return out('answer', top.entry);
if (fast) {
const best = all.length ? all[0].score : 0;
if (all.some(h => h.home && String(h.entry.id) === String(fast.id) && h.score >= SEM.floor && h.score >= best - SEM.agree)) return out('agree', fast);
if (!top || top.score < SEM.unsure) return out('regex', fast);
return out('veto', null);
}
return out('context', null);
}
// support desk suggestions (2026-11-16): the help answers closest to what a signed-in member is typing into a new ticket.
// Knowledge-base entries only (published answers, including the ones written from past tickets), never anyone's ticket text.
// text + { own: this site's entries, fallback: async q => [{entry}] (BM25) when the hub is slow or down, max }
const SUGGEST_MIN = Number(process.env.NETKB_SUGGEST_MIN) || 0.70;
const NOT_SUGGESTED = /(^|[-:])support$|^c-refund$/; // the "contact support" entry is no help on the support form itself
function suggestItem(e, home, score) {
return { id: String(e.id), title: e.title, answer: String(e.answer || '').slice(0, 900), site: home ? '' : (e.siteName || e.site || ''),
link: home ? (e.link || '') : (e.go || e.siteUrl || ''), fromTicket: !!(home && e.source === 'ticket'), score: score == null ? null : Math.round(score * 1000) / 1000 };
}
async function suggest(text, o) {
o = o || {};
const q = String(text || '').replace(/\s+/g, ' ').trim().slice(0, 600);
if (q.replace(/[^A-Za-z0-9]/g, '').length < 10) return { items: [], via: 'short' };
const me = siteName(); const own = new Map((o.own || []).map(e => [String(e.id), e]));
const keep = (e, home) => e && !(home && e.handoff) && !NOT_SUGGESTED.test(String(e.id));
let items = [], via = 'none';
const m = await match(q, { k: 8, timeoutMs: o.timeoutMs || 2000 });
if (m) {
via = 'semantic'; const top = m.hits.length ? Number(m.hits[0].score) : 0; const rem = new Map(remote().map(e => [e.id, e]));
for (const h of m.hits) {
if (h.score < SUGGEST_MIN || h.score < top - 0.08) continue;
const home = h.site === me; const e = home ? own.get(String(h.id)) : rem.get(h.site + ':' + h.id);
if (keep(e, home)) items.push(suggestItem(e, home, h.score));
}
} else if (typeof o.fallback === 'function') {
via = 'bm25';
try { for (const x of (await o.fallback(q)) || []) { const e = x && x.entry; const home = !!e && !e.site; if (keep(e, home)) items.push(suggestItem(e, home, null)); } } catch (e) {}
}
return { items: items.slice(0, o.max || 3), via };
}
// opts: { dataDir, site (hub site id), name, url, entries: async () => [...], linkFor: url => tracked link }
function init(opts) {
O = opts || {}; readCache();
if (!enabled()) return;
const first = setTimeout(async () => { await publish().catch(() => {}); await refresh().catch(() => {}); }, Math.max(0, Number(process.env.NETKB_FIRST_MS) || 8000));
if (first.unref) first.unref();
timer = setInterval(async () => { await refresh().catch(() => {}); if (!publishedHash) await publish().catch(() => {}); }, Math.max(1000, Number(process.env.NETKB_REFRESH_MS) || REFRESH_MS));
if (timer.unref) timer.unref();
}
function view() { return Object.assign({ enabled: enabled(), site: siteName(), version: merged.version, sites: Object.keys(merged.sites || {}), entries: (merged.entries || []).length, remote: remote().length, loadedAt, semantic: matchOn(), sem: SEM }, stats, mstats); }
function _set(m) { merged = m; } // tests
const version = () => merged.version || '';
function _matchReset() { matchDownUntil = 0; } // tests
module.exports = { init, publish, publishSoon, refresh, remote, sites, view, enabled, version, match, route, suggest, SEM, _set, _matchReset };
+66
View File
@@ -0,0 +1,66 @@
// The network sites list for the footer's "Part of the network" line (Marty 2026-11-14 trust pack).
// One source: the hub's public GET /v1/network-sites (HUB_URL). Cached 10 minutes, refreshed in the background, never waits on a
// slow hub (2.5 s timeout), and falls back to the same built-in list. Never RM Circle, never the games.
// The same file lives in every network site (InstantAdPay, LinkSpin, Downline Banners, VBB, ViralAdBlitz, Stack POL).
const FALLBACK = [
{ id: 'iap', name: 'InstantAdPay', url: 'https://instantadpay.com' },
{ id: 'linkspin', name: 'LinkSpin', url: 'https://linkspin.app' },
{ id: 'dlb', name: 'Downline Banners', url: 'https://downlinebanners.com' },
{ id: 'vbb', name: 'Viral Banner Blitz', url: 'https://viralbannerblitz.com' },
{ id: 'viraladblitz', name: 'ViralAdBlitz', url: 'https://viraladblitz.com' },
{ id: 'viraladsource', name: 'ViralAdSource', url: 'https://viraladsource.com' },
{ id: 'yourprogrambuilder', name: 'YourProgramBuilder', url: 'https://yourprogrambuilder.com' },
{ id: 'videoappincome', name: 'Video App Income', url: 'https://videoappincome.com' },
{ id: 'fivex', name: '5xYourTeam', url: 'https://5xyourteam.com' },
{ id: 'downlinehydra', name: 'DownlineHydra', url: 'https://downlinehydra.com' },
{ id: 'stackpol', name: 'Stack POL', url: 'https://stackpol.com' },
{ id: 'earnerscorner', name: 'Earners Corner', url: 'https://earnerscorner.com' }
];
const TTL = 10 * 60 * 1000;
let cache = { at: 0, list: FALLBACK, from: 'fallback' };
let inflight = null;
const hubUrl = () => String(process.env.HUB_URL || 'https://hub.saasy.top').trim().replace(/\/+$/, '');
function clean(list) {
if (!Array.isArray(list)) return null;
const ok = list.filter(s => s && typeof s.name === 'string' && /^https:\/\/[a-z0-9.-]+(\/[^\s"'<>]*)?$/i.test(String(s.url || '')))
.slice(0, 30).map(s => ({ id: String(s.id || s.name).toLowerCase().replace(/[^a-z0-9]+/g, '').slice(0, 30), name: String(s.name).slice(0, 60), url: String(s.url).replace(/\/+$/, '') }));
return ok.length ? ok : null;
}
function refresh() {
if (inflight || process.env.NETWORK_SITES_HUB === '0') return inflight;
const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 2500);
inflight = fetch(hubUrl() + '/v1/network-sites', { signal: ac.signal })
.then(r => (r.ok ? r.json() : null))
.then(j => { const l = clean(j); if (l) cache = { at: Date.now(), list: l, from: 'hub' }; else cache.at = Date.now(); })
.catch(() => { cache.at = Date.now() - TTL + 60 * 1000; }) // hub down: try again in a minute, keep the last good list
.finally(() => { clearTimeout(t); inflight = null; });
return inflight;
}
function list() { if (Date.now() - cache.at > TTL) refresh(); return cache.list; }
// Tracked links (Marty 2026-11-14: "make sure each of these sites is its own traffic source and link spun so we can track it"): each
// entry also gets go = the LinkSpin network link for that site with ?src=<this site>, so a click shows in LinkSpin Reports under the
// site that sent it (LinkSpin netlinks.js: fixed codes on the admin account). This site = NETWORK_SITE_ID, else the request host.
// No go for this site itself, or when this site cannot be told (a test host): the page then uses the plain url.
const CODES = { iap: 'nwiap', linkspin: 'nwls', dlb: 'nwdlb', vbb: 'nwvbb', viraladblitz: 'nwvab', viraladsource: 'nwvas', yourprogrambuilder: 'nwypb', fivex: 'nw5x', downlinehydra: 'nwdh', stackpol: 'nwsp', earnerscorner: 'nwec' };
const linksBase = () => String(process.env.NETWORK_LINKS_BASE || 'https://linkspin.app').trim().replace(/\/+$/, '');
const hostOf = u => { try { return new URL(u).hostname.toLowerCase().replace(/^www\./, ''); } catch (e) { return ''; } };
function selfId(req, l) {
const env = String(process.env.NETWORK_SITE_ID || '').trim().toLowerCase(); if (env) return env;
const h = String((req && req.headers && (req.headers['x-forwarded-host'] || req.headers.host)) || '').split(',')[0].trim().toLowerCase().replace(/:\d+$/, '').replace(/^www\./, '');
const m = h && (l || list()).find(s => hostOf(s.url) === h); return m ? m.id : '';
}
// the LinkSpin-tracked link to site `id` sent from site `from` (from = id: the site's own promo kit); extra = { s1: member username, s2: one path segment }
function tracked(id, from, extra) {
const code = CODES[id]; if (!code || !from) return '';
const q = new URLSearchParams({ src: from }); for (const [k, v] of Object.entries(extra || {})) if (v) q.set(k, String(v));
return linksBase() + '/r/' + code + '?' + q.toString();
}
function withGo(l, me) { return l.map(s => { const go = me && s.id !== me ? tracked(s.id, me) : ''; return go ? Object.assign({}, s, { go }) : s; }); }
// GET /api/network-sites: public, cacheable, the same answer on every page
function handle(req, res) {
const l = list();
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8', 'Cache-Control': 'public, max-age=300', 'X-Content-Type-Options': 'nosniff' });
res.end(JSON.stringify(withGo(l, selfId(req, l))));
}
module.exports = { list, handle, refresh, tracked, selfId, withGo, CODES, FALLBACK, _state: () => cache };
+452
View File
@@ -0,0 +1,452 @@
// Network sign-in between InstantAdPay and LinkSpin (Marty approved 2026-11-12). The SAME file ships in both repos; each
// server calls init({ self, peer, peerBase, ... hooks }) and hands every request to handle() before its own routes.
//
// One flow, used two ways. R = the site the member is going TO (receiver), P = the site they are signed in on (provider).
// 1. R GET /sso/start?mode=go|check&to=/path R makes a random state, keeps it in a 5-minute HttpOnly cookie (nsso.st),
// sets the loop guard (nsso.tried, 2 minutes) and sends the browser to P.
// 2. P GET /sso/check?st=<state>&to=/path P looks at its OWN member session (never the admin portal). Signed in:
// P mints a token bound to R, the state and the email, and sends the browser
// to R /sso/in?t=<token>. Not signed in: R /sso/in?none=1&to=/path.
// 3. R GET /sso/in?t=<token> R checks signature, audience, expiry (60 s), the state against its cookie
// (so nobody can push their own token into someone else's browser), and spends
// the nonce (a second use is refused). The email must already be a member
// here; then R makes an ordinary session and redirects to the relative path.
// Outbound links: P GET /go/<peer>?to=/path is the hop a signed-in member's cross-site link points at. Signed out (or the
// secret not set), it is a plain redirect to the other site, so it is always safe to link through.
// Silent check: R's sign-in page calls GET /api/sso/status; { check: true } means "bounce once through P". The guard cookie
// stops a second bounce for 2 minutes (30 until 2026-11-15, when it blocked Marty's silent sign-in on LinkSpin), signing out sets nsso.off (12 hours, cleared by the next deliberate cross-site link),
// bots and non-page fetches never bounce.
// Token: "v1.<base64url JSON>.<base64url HMAC-SHA256(NETWORK_SSO_SECRET, 'nsso.v1.' + JSON part)>", JSON = { iss, aud, email,
// st, to, iat, exp, n[, wallet, name] }. The token grants a plain member session and nothing else: no wallet action, payout or purchase rides on it.
//
// Wallet sites (Downline Banners, 2026-11-13, Marty: "sign in once and be logged into all these sites"). Downline Banners has no email
// accounts; its members are wallets. IAP and LinkSpin list it under `wallets: { bannerline: base }` and vouch one way: /go/bannerline
// and /sso/check?r=bannerline mint a token that also carries the member's wallet (the one they signed in with, else the main wallet
// their account linked by signature) and username. Downline Banners runs this file with `from: { iap, linkspin }`, accepts a token from
// either, and makes a session for that wallet. /sso/start?via=<site> picks which site to ask; old copies ignore the new parameters.
//
// THE HUB AS THE PROVIDER (Marty approved 2026-11-15; off unless HUB_SSO=on, with HUB_URL, HUB_SECRET (32+) and HUB_SITE or C.hubSite).
// The network hub keeps one network sign-in per browser in its own cookie (7 days, renewed on use). With it on:
// /sso/start asks the hub (GET <hub>/sso/check?site=<HUB_SITE>&st&to&m) instead of one other site; the hub answers
// /sso/in?h=<token> ("h1." token, HMAC-SHA256 with this site's HUB_SECRET under 'hubsso.v1.', iss 'hub', aud = this site,
// 60 s, single use, bound to the state cookie) or /sso/in?none=1&hub=1, and then the old pairwise path is tried once as the
// fallback (until every site is switched).
// Push: a signed-in member's page load (a real top-level navigation only) with no matching nsso.hp cookie goes once through
// <hub>/sso/set?site&t=<this site's token for the member> and straight back, so signing in on any site signs in the hub.
// Only when the hub answered /health in the last 2 minutes: a hub that is down never takes a page with it.
// Activity (Marty 2026-11-15, DownlineHydra "Wake it", the CRM score): a signed-in member's page load pings POST <hub>/v1/activity
// {email|wallet, kind 'visit'} at most once per member per day, fire and forget (HUB_URL + HUB_SECRET; HUB_ACTIVITY=0 turns it off).
// signOutEverywhere(session): POST <hub>/v1/sso/signout; the hub ends every hub sign-in of that person and tells hooked sites.
//
// ONE SITES LIST + THE WAY BACK (Marty 2026-11-17: "I logged in to Instant Ad Pay from Viral Ad Source, and it never had a return
// path back"). Before, each provider (IAP, LinkSpin) kept its own hand-written `wallets` list; a site missing from it (5xYourTeam
// 11-15, ViralAdSource 11-17) was refused at /sso/check and the member was dropped on the provider's dashboard with no way back.
// Sites list: a provider also knows every site in the hub's public GET <hub>/v1/sso-sites (HUB_SSO_SITES there; the same list the
// hub signs in for). Read at start, every 5 minutes, and once more (2 s at most) when an unknown site asks. Hand-written entries win.
// Return links: any provider page with ?return=<site>&to=/path (a known site only, never an open redirect) remembers the way back
// in nsso.ret (1 day) and reloads without the two parameters. Signed in already: straight back. After the email-code sign-in (and
// after the username step for a new account) the provider's dashboard goes to /sso/resume, which finishes it: /go/<site>?to=/path.
// No wallet yet (a wallet site needs one): with C.walletPath the member goes to the provider's wallet step first (nsso.wait), and
// afterWallet(req) gives the wallet-link answer its next hop, /sso/resume. The same holds for a deliberate tap (nsso.back).
'use strict';
const crypto = require('crypto');
const fs = require('fs');
const path = require('path');
const SECRET = () => String(process.env.NETWORK_SSO_SECRET || '').trim();
const enabled = () => SECRET().length >= 32;
const TTL = 60 * 1000; // token life
const SKEW = 30 * 1000; // clock skew allowed between the two servers
const STATE_AGE = 300; // seconds: the state cookie
const GO_STATE_AGE = 3600; // seconds: the state cookie on a deliberate tap (time to sign in, pick a username and link a wallet on the provider first; 20 minutes until 2026-11-17)
const BACK_AGE = 3600; // seconds: the provider remembers an unfinished deliberate check while the member signs in (20 minutes until 2026-11-17)
const RET_AGE = 86400; // seconds: a ?return=<site> link remembers the way back (2026-11-17)
const TRIED_AGE = 120; // seconds: one silent check per browser per 2 minutes (loop guard only; 30 minutes until 2026-11-15)
const OFF_AGE = 12 * 3600; // seconds: no silent check after a sign-out on this site
const HINT_AGE = 300; // seconds: the email prefill when the member is not here yet
const NAMES = { iap: 'InstantAdPay', linkspin: 'LinkSpin', bannerline: 'Downline Banners', vbb: 'Viral Banner Blitz', viraladblitz: 'ViralAdBlitz', downlinehydra: 'DownlineHydra', fivex: '5xYourTeam' }; // vbb = Viral Banner Blitz, a wallet site like Downline Banners (2026-11-14); viraladblitz = ViralAdBlitz, a wallet site like VBB (2026-11-15); downlinehydra = DownlineHydra (2026-11-15); fivex = 5xYourTeam (2026-11-15)
const WALLET_RE = /^0x[0-9a-f]{40}$/;
const PUSH_AGE = 6 * 86400; // seconds: this browser's member is signed in on the hub (the hub's own sign-in lasts 7 days)
const HUB_BASE = () => String(process.env.HUB_URL || '').trim().replace(/\/+$/, '');
const HUB_KEY = () => String(process.env.HUB_SECRET || '').trim();
const HUB_NAME = () => String(process.env.HUB_SITE || (C && (C.hubSite || C.self)) || '').trim().toLowerCase();
const hubCreds = () => /^https?:\/\/[a-z0-9.:-]+$/i.test(HUB_BASE()) && HUB_KEY().length >= 32 && /^[a-z0-9_-]{1,64}$/.test(HUB_NAME());
const hubOn = () => String(process.env.HUB_SSO || '').trim().toLowerCase() === 'on' && hubCreds();
let hubSeen = 0, hubChecked = 0, hubAsking = null; // last good /health answer, last time we asked
// true when the hub answered /health in the last 2 minutes. Asked at most once a minute; while the answer is unknown (first use, or
// the last good answer is old) the caller waits for that one question (2 s at most), so a hub that is down costs one page 2 s a minute.
async function hubUp() {
const now = Date.now();
if (now - hubChecked >= 60000 && !hubAsking && typeof fetch === 'function') {
hubChecked = now;
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, 2000);
hubAsking = fetch(HUB_BASE() + '/health', { signal: ac ? ac.signal : undefined }).then(r => { if (r.ok) hubSeen = Date.now(); }).catch(() => {}).finally(() => { clearTimeout(tm); hubAsking = null; });
}
if (hubAsking && Date.now() - hubSeen >= 120000) await hubAsking;
return Date.now() - hubSeen < 120000;
}
// the hub's sign-in sites {site: base} (2026-11-17): providers answer every site the hub knows, not only their hand-written list
let hubSites = {}, hubSitesAt = 0, hubSitesAsking = null;
const SITE_RE = /^[a-z0-9_-]{1,64}$/, BASE_RE = /^https?:\/\/[a-z0-9.:-]+$/i;
function loadHubSites() {
if (hubSitesAsking) return hubSitesAsking;
if (!BASE_RE.test(HUB_BASE()) || typeof fetch !== 'function' || String(process.env.NSSO_HUB_SITES || '') === '0') return Promise.resolve();
hubSitesAt = Date.now();
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, 2000);
hubSitesAsking = fetch(HUB_BASE() + '/v1/sso-sites', { signal: ac ? ac.signal : undefined }).then(r => (r.ok ? r.json() : null)).then(j => {
if (!j || !j.sites || typeof j.sites !== 'object') return;
const out = {}; for (const [k, v] of Object.entries(j.sites)) { const b = String(v || '').replace(/\/+$/, ''); if (SITE_RE.test(k) && BASE_RE.test(b)) out[k] = b; }
hubSites = out;
}).catch(() => {}).finally(() => { clearTimeout(tm); hubSitesAsking = null; });
return hubSitesAsking;
}
const freshSites = () => { if (C && C.wallet && Date.now() - hubSitesAt > 5 * 60 * 1000) loadHubSites(); };
let C = null; // { self, peer, peerBase(), isProd, dataDir, db, member(req), accept(email, req, v), signIn(email, req, v), landing(to), signinPath(to), defaultPath,
// wallets?: { site: base() } + wallet(session) -> { address, name }, from?: { site: base() }, walletPath?: the provider's wallet step }
const b64u = buf => Buffer.from(buf).toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
const unb64u = s => Buffer.from(String(s).replace(/-/g, '+').replace(/_/g, '/'), 'base64');
const mac = s => crypto.createHmac('sha256', SECRET()).update('nsso.v1.' + s).digest();
const mask = e => String(e || '').replace(/^(.).*(@.*)$/, '$1***$2');
const log = (what, email, extra) => console.log('network-sso', what, email ? mask(email) : '-', extra || '');
// a same-site relative path, or the default. No scheme, no host, no protocol-relative //x, no backslashes, no control characters.
function safePath(to, dflt) {
const d = dflt == null ? '/' : dflt;
const s = String(to == null ? '' : to);
if (!s || s.length > 600 || s[0] !== '/' || s[1] === '/' || s[1] === '\\' || /[\\\u0000-\u001f\u007f\s]/.test(s)) return d;
try { const x = new URL(s, 'http://x.invalid'); if (x.host !== 'x.invalid' || x.protocol !== 'http:') return d; return x.pathname + x.search + x.hash; } catch (e) { return d; }
}
function mint(o) {
const now = o.now || Date.now();
const t = { iss: o.iss, aud: o.aud, email: String(o.email || '').trim().toLowerCase(), st: o.st, to: safePath(o.to), iat: now, exp: now + TTL, n: crypto.randomBytes(16).toString('hex') };
if (o.wallet) t.wallet = String(o.wallet).toLowerCase();
if (o.name) t.name = String(o.name).slice(0, 40);
const body = b64u(JSON.stringify(t));
return 'v1.' + body + '.' + b64u(mac(body));
}
// -> { ok, email, to, n, exp } or { error: reason }
function verify(tok, o) {
if (!enabled()) return { error: 'off' };
const m = /^v1\.([A-Za-z0-9_-]{20,2000})\.([A-Za-z0-9_-]{43})$/.exec(String(tok || ''));
if (!m) return { error: 'malformed' };
const want = mac(m[1]), got = unb64u(m[2]);
if (want.length !== got.length || !crypto.timingSafeEqual(want, got)) return { error: 'signature' };
let p; try { p = JSON.parse(unb64u(m[1]).toString('utf8')); } catch (e) { return { error: 'malformed' }; }
const now = (o && o.now) || Date.now();
if (!p || p.aud !== o.aud || ![].concat(o.iss).includes(p.iss)) return { error: 'audience' };
if (!(Number(p.exp) > now) || Number(p.iat) > now + SKEW || Number(p.exp) - Number(p.iat) > TTL) return { error: 'expired' };
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(p.email || ''))) return { error: 'email' };
if (!/^[a-f0-9]{32}$/.test(String(p.n || ''))) return { error: 'malformed' };
const st = String((o && o.st) || '');
if (!/^[a-f0-9]{32}$/.test(st) || !/^[a-f0-9]{32}$/.test(String(p.st || '')) || !crypto.timingSafeEqual(Buffer.from(st), Buffer.from(p.st))) return { error: 'state' };
if (p.wallet != null && !WALLET_RE.test(String(p.wallet))) return { error: 'wallet' };
const name = p.name != null && /^[A-Za-z0-9_.-]{1,40}$/.test(String(p.name)) ? String(p.name) : null;
return { ok: true, iss: p.iss, email: String(p.email).toLowerCase(), wallet: p.wallet || null, name, to: safePath(p.to), n: p.n, exp: Number(p.exp) };
}
// hub tokens ("h1.", the hub's format): mint for the hub (push), verify from the hub (sign-in)
const hmacHub = x => crypto.createHmac('sha256', HUB_KEY()).update('hubsso.v1.' + x).digest();
function mintHub(o) {
const now = o.now || Date.now();
const t = { iss: HUB_NAME(), aud: 'hub', to: safePath(o.to), iat: now, exp: now + TTL, n: crypto.randomBytes(16).toString('hex') };
if (o.email) t.email = String(o.email).trim().toLowerCase(); else if (o.wallet) t.wallet = String(o.wallet).toLowerCase();
const body = b64u(JSON.stringify(t));
return 'h1.' + body + '.' + b64u(hmacHub(body));
}
function verifyHub(tok, o) {
if (!hubCreds()) return { error: 'off' };
const m = /^h1\.([A-Za-z0-9_-]{20,2000})\.([A-Za-z0-9_-]{43})$/.exec(String(tok || ''));
if (!m) return { error: 'malformed' };
const want = hmacHub(m[1]), got = unb64u(m[2]);
if (want.length !== got.length || !crypto.timingSafeEqual(want, got)) return { error: 'signature' };
let p; try { p = JSON.parse(unb64u(m[1]).toString('utf8')); } catch (e) { return { error: 'malformed' }; }
const now = (o && o.now) || Date.now();
if (!p || p.iss !== 'hub' || p.aud !== HUB_NAME()) return { error: 'audience' };
if (!(Number(p.exp) > now) || Number(p.iat) > now + SKEW || Number(p.exp) - Number(p.iat) > TTL) return { error: 'expired' };
if (!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(p.email || ''))) return { error: 'email' };
if (!/^[a-f0-9]{32}$/.test(String(p.n || ''))) return { error: 'malformed' };
const st = String((o && o.st) || '');
if (!/^[a-f0-9]{32}$/.test(st) || !/^[a-f0-9]{32}$/.test(String(p.st || '')) || !crypto.timingSafeEqual(Buffer.from(st), Buffer.from(p.st))) return { error: 'state' };
if (p.wallet != null && !WALLET_RE.test(String(p.wallet))) return { error: 'wallet' };
const name = p.name != null && /^[A-Za-z0-9_.-]{1,40}$/.test(String(p.name)) ? String(p.name) : null;
return { ok: true, iss: 'hub', email: String(p.email).toLowerCase(), wallet: p.wallet || null, name, to: safePath(p.to), n: p.n, exp: Number(p.exp) };
}
// a signed /v1 call to the hub (the scheme every site already uses): hex HMAC-SHA256(HUB_SECRET, ts + newline + body)
async function hubCall(route, body, ms) {
const raw = JSON.stringify(body || {}); const ts = String(Date.now());
const ac = typeof AbortController === 'function' ? new AbortController() : null; const tm = setTimeout(() => { if (ac) ac.abort(); }, ms || 5000);
try {
const r = await fetch(HUB_BASE() + route, { method: 'POST', body: raw, signal: ac ? ac.signal : undefined, headers: { 'Content-Type': 'application/json', 'X-Hub-Site': HUB_NAME(), 'X-Hub-Ts': ts, 'X-Hub-Sig': crypto.createHmac('sha256', HUB_KEY()).update(ts + '\n' + raw).digest('hex') } });
let j = null; try { j = await r.json(); } catch (e) {}
return { status: r.status, json: j };
} finally { clearTimeout(tm); }
}
const who = s => (s && s.email ? { email: String(s.email).toLowerCase() } : s && s.address && WALLET_RE.test(String(s.address).toLowerCase()) ? { wallet: String(s.address).toLowerCase() } : null);
const pushTag = w => b64u(crypto.createHmac('sha256', HUB_KEY()).update('push.' + (w.email || w.wallet)).digest()).slice(0, 22);
// once per member per day (memory; a restart may ping once more, the hub counts a visit once per 10 minutes anyway)
const pinged = new Map(); let pingDay = '';
function activity(w) {
if (String(process.env.HUB_ACTIVITY || '') === '0' || !hubCreds() || typeof fetch !== 'function') return;
const day = new Date().toISOString().slice(0, 10); if (day !== pingDay) { pinged.clear(); pingDay = day; }
const k = w.email || w.wallet; if (pinged.has(k)) return; pinged.set(k, 1);
hubCall('/v1/activity', Object.assign({ kind: 'visit' }, w), 5000).then(r => { if (r.status >= 500) pinged.delete(k); }).catch(() => { pinged.delete(k); });
}
// a signed-in request the site already answers (2026-11-16, Marty: "LinkSpin never reports activity"): /api/me, the dashboard
// heartbeat (/api/my/ping) and the admin portal call this, so a Control Room tab kept open for days, a browser that sends no
// Sec-Fetch headers and a wallet-only session still count the day's visit. The page-load ping in page() only sees full navigations.
// s = {email} and/or {address}. Same once-a-day rule as page(). -> true when a ping was due or already sent today.
function seen(s) {
try {
if (!C || !hubCreds()) return false;
const w = who(s && s.email ? s : s && s.address ? { address: s.address } : null); if (!w) return false;
activity(w); return true;
} catch (e) { return false; }
}
// a real top-level page load of a page (never an API call, an asset, a fetch, a bot or one of our own hops)
function pageLoad(req, p) {
if (req.method !== 'GET' || isBot(req)) return false;
if (req.headers['sec-fetch-dest'] !== 'document' || (req.headers['sec-fetch-mode'] && req.headers['sec-fetch-mode'] !== 'navigate')) return false;
if (/^\/(sso|api|go|assets|art|img|fonts|uploads|admin)(\/|$)/.test(p)) return false;
return !/\.[a-z0-9]{1,5}$/i.test(p);
}
async function signOutEverywhere(s) {
const w = who(s); if (!w || !hubCreds()) return { ok: false, reason: !w ? 'signed out' : 'hub off' };
try { const r = await hubCall('/v1/sso/signout', w, 8000); return r.status === 200 ? Object.assign({ ok: true }, r.json || {}) : { ok: false, reason: 'hub ' + r.status }; }
catch (e) { return { ok: false, reason: 'hub unreachable' }; }
}
// single use: true the first time a nonce is spent. MySQL when the site runs on it (two app copies during a deploy share it),
// else memory + a small file in DATA_DIR (survives a restart inside the 60-second window).
const used = new Map(); let fileLoaded = false, tableReady = null;
const FILE = () => C && C.dataDir ? path.join(C.dataDir, 'network-sso-nonces.json') : null;
function prune(now) { for (const [k, exp] of used) if (exp < now) used.delete(k); }
function loadFile() {
if (fileLoaded) return; fileLoaded = true;
try { const o = JSON.parse(fs.readFileSync(FILE(), 'utf8')); for (const k of Object.keys(o)) used.set(k, Number(o[k])); } catch (e) {}
}
function saveFile() { const f = FILE(); if (!f) return; try { fs.writeFileSync(f + '.tmp', JSON.stringify(Object.fromEntries(used))); fs.renameSync(f + '.tmp', f); } catch (e) { console.error('network-sso nonce save', e.message); } }
async function spend(n, exp) {
const now = Date.now(); loadFile(); prune(now);
if (used.has(n)) return false;
used.set(n, Number(exp) + SKEW); saveFile();
const db = C && C.db;
if (db && db.enabled && db.enabled()) {
try {
if (!tableReady) tableReady = db.q('CREATE TABLE IF NOT EXISTS network_sso_nonces (n VARCHAR(40) PRIMARY KEY, exp BIGINT NOT NULL) ENGINE=InnoDB').catch(e => { tableReady = null; throw e; });
await tableReady;
await db.q('INSERT INTO network_sso_nonces (n, exp) VALUES (?, ?)', [n, Number(exp) + SKEW]);
if (Math.random() < 0.05) db.q('DELETE FROM network_sso_nonces WHERE exp < ?', [now]).catch(() => {});
} catch (e) { if (/duplicate/i.test(e.message || '') || e.code === 'ER_DUP_ENTRY') return false; console.error('network-sso nonce db', e.message); return false; } // fail closed
}
return true;
}
// crawlers, link previews and headless browsers never bounce
const BOT_RE = /bot|crawl|spider|slurp|preview|facebookexternalhit|embedly|quora link|whatsapp|telegram|discord|skype|curl|wget|python|httpclient|headless|lighthouse|pingdom|monitor|go-http|java\/|okhttp|axios|node-fetch|undici/i;
const isBot = req => { const ua = String(req.headers['user-agent'] || ''); return !ua || BOT_RE.test(ua); };
// only a real top-level page load may start a bounce (sec-fetch-dest is sent by every current browser)
const notPage = req => { const d = req.headers['sec-fetch-dest']; return !!d && d !== 'document'; };
function cookies(req) {
const out = {};
for (const p of String(req.headers.cookie || '').split(';')) { const i = p.indexOf('='); if (i > 0) { try { out[p.slice(0, i).trim()] = decodeURIComponent(p.slice(i + 1).trim()); } catch (e) {} } }
return out;
}
const ck = (k, v, age, httpOnly) => k + '=' + encodeURIComponent(v) + '; Path=/; SameSite=Lax; Max-Age=' + age + (httpOnly ? '; HttpOnly' : '') + (C && C.isProd ? '; Secure' : '');
const go = (res, loc, set) => { const h = { Location: loc, 'Cache-Control': 'no-store', 'Referrer-Policy': 'no-referrer', 'X-Robots-Tag': 'noindex' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(302, h); res.end(); return true; };
const sendJson = (res, obj, set) => { const h = { 'Content-Type': 'application/json', 'Cache-Control': 'no-store' }; if (set && set.length) h['Set-Cookie'] = set; res.writeHead(200, h); res.end(JSON.stringify(obj)); return true; };
function init(opts) { C = Object.assign({ defaultPath: '/' }, opts); fileLoaded = false; used.clear(); if (hubOn()) { hubSeen = 0; hubChecked = 0; hubUp().catch(() => {}); } hubSites = {}; hubSitesAt = 0; if (C.wallet) loadHubSites(); }
// a site this provider answers for: its own list first, then the hub's (never itself, never the peer, which has its own path)
function siteBase(x) {
if (!C || !C.wallet || !SITE_RE.test(String(x || '')) || x === C.self || x === C.peer) return null;
if (C.wallets && Object.prototype.hasOwnProperty.call(C.wallets, x)) return C.wallets[x];
if (Object.prototype.hasOwnProperty.call(hubSites, x)) { const b = hubSites[x]; return () => b; }
return null;
}
// an unknown site asking: ask the hub once more (at most every 30 s, 2 s at most) before refusing
async function siteBaseFresh(x) { let b = siteBase(x); if (!b && C && C.wallet && SITE_RE.test(String(x || '')) && Date.now() - hubSitesAt > 30000) { await loadHubSites(); b = siteBase(x); } return b; }
const siteName = x => NAMES[x] || ({ viraladsource: 'ViralAdSource', webworthit: 'WebWorthIt', stackpol: 'Stack POL' })[x] || x;
const retOf = req => { const m = /^([a-z0-9_-]{1,64})\|(\/.*)$/.exec(cookies(req)['nsso.ret'] || ''); return m ? { site: m[1], to: safePath(m[2], '/') } : null; };
// signed in here, on the way back to a site: its wallet step first when the site needs a wallet this account does not have yet
async function backHop(s, site, to, set) {
let w = null; try { w = await C.wallet(s); } catch (e) {}
if ((!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) && C.walletPath) { set.push(ck('nsso.wait', '1', BACK_AGE, true)); log('back: wallet step first', s.email, 'for ' + siteName(site)); return C.walletPath; }
return '/go/' + site + '?to=' + encodeURIComponent(to);
}
// the cookie a sign-out adds: no silent check on this site for 12 hours (a deliberate cross-site link still signs in)
const offCookie = () => ck('nsso.off', '1', OFF_AGE, true);
// -> true when the request was one of ours and has been answered
async function handle(req, res, u) {
if (!C || req.method !== 'GET') return false;
const p = u.pathname;
if (C.wallet && u.searchParams.has('return') && !/^\/(sso|api|go)(\/|$)/.test(p)) { // a site's "sign in / join on <provider>" link: remember the way back (2026-11-17)
const site = String(u.searchParams.get('return') || '').toLowerCase(); const to = safePath(u.searchParams.get('to'), '/');
const clean = new URL(u.pathname + u.search, 'http://x.invalid'); clean.searchParams.delete('return'); clean.searchParams.delete('to');
const here = safePath(clean.pathname + clean.search, '/');
const base = isBot(req) ? null : await siteBaseFresh(site);
if (!base) return go(res, here); // unknown site (or a bot): the page itself, nothing remembered
let s = null; try { s = await C.member(req); } catch (e) {}
if (s && s.email) { // signed in here already: straight back (wallet step first when the site needs one)
const set = []; const hop = await backHop(s, site, to, set);
set.push(hop === C.walletPath ? ck('nsso.ret', site + '|' + to, RET_AGE, true) : ck('nsso.ret', '', 0, true));
return go(res, hop, set);
}
log('return link remembered', null, 'for ' + siteName(site));
return go(res, here, [ck('nsso.ret', site + '|' + to, RET_AGE, true), ck('nsso.wait', '', 0, true)]);
}
const peerName = NAMES[C.peer] || C.peer;
const goTo = p.startsWith('/go/') ? p.slice(4) : '';
const walletBase = siteBase; freshSites(); // the hand-written list, then the hub's sign-in sites (2026-11-17)
if (goTo && (goTo === C.peer || walletBase(goTo))) {
const base = goTo === C.peer ? C.peerBase() : walletBase(goTo)();
const to = safePath(u.searchParams.get('to'), '/');
const plain = base + to;
if (!enabled() || isBot(req)) return go(res, plain);
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) return go(res, plain);
if (goTo !== C.peer) { let w = null; try { w = await C.wallet(s); } catch (e) {} if (!w || !w.address) return go(res, plain); } // no wallet to vouch for: a plain link
return go(res, base + '/sso/start?mode=go' + (goTo === C.peer ? '' : '&via=' + C.self) + '&to=' + encodeURIComponent(to));
}
if (p === '/sso/start') {
const to = safePath(u.searchParams.get('to'), C.defaultPath);
const mode = u.searchParams.get('mode') === 'go' ? 'go' : 'check';
const via = String(u.searchParams.get('via') || '');
const from = C.from && Object.prototype.hasOwnProperty.call(C.from, via) ? C.from[via] : null; // a wallet site may ask either provider
const viaHub = hubOn() && !u.searchParams.get('nohub') && (await hubUp());
if (!(enabled() || viaHub) || isBot(req) || notPage(req)) return go(res, to);
let s = null; try { s = await C.member(req); } catch (e) {}
if (s && (s.email || s.address)) return go(res, to); // already signed in here
const c = cookies(req);
if (mode === 'check' && (c['nsso.tried'] || c['nsso.off']) && !u.searchParams.get('nohub')) return go(res, to);
const st = crypto.randomBytes(16).toString('hex');
if (viaHub) { // the hub answers for the whole network; the pairwise provider is the fallback when it has nobody (nsso.via)
const set = [ck('nsso.st', st, mode === 'go' ? GO_STATE_AGE : STATE_AGE, true), ck('nsso.tried', '1', TRIED_AGE, true), ck('nsso.via', via || '-', STATE_AGE, true)];
if (mode === 'go' && c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
return go(res, HUB_BASE() + '/sso/check?site=' + encodeURIComponent(HUB_NAME()) + '&st=' + st + '&to=' + encodeURIComponent(to) + (mode === 'go' ? '&m=go' : ''), set);
}
const set = [ck('nsso.st', st, mode === 'go' ? GO_STATE_AGE : STATE_AGE, true), ck('nsso.tried', '1', TRIED_AGE, true)];
if (mode === 'go' && c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
return go(res, (from ? from() : C.peerBase()) + '/sso/check?st=' + st + (C.from ? '&r=' + C.self : '') + '&to=' + encodeURIComponent(to) + (mode === 'go' ? '&m=go' : ''), set);
}
if (p === '/sso/resume') { // signed in on the provider after a deliberate tap: finish the check it was asked for (2026-11-14)
const q = new URLSearchParams(cookies(req)['nsso.back'] || '');
const clear = [ck('nsso.back', '', 0, true), ck('nsso.wait', '', 0, true)];
if (!/^[a-f0-9]{32}$/.test(q.get('st') || '')) { // no deliberate tap waiting: a ?return=<site> link may be (2026-11-17)
const ret = retOf(req);
if (!ret || !siteBase(ret.site)) return go(res, C.defaultPath, clear.concat(ck('nsso.ret', '', 0, true)));
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) return go(res, C.signinPath(C.defaultPath)); // not signed in yet: keep it for after the sign-in
const set = clear.slice(); const hop = await backHop(s, ret.site, ret.to, set);
set.push(hop === C.walletPath ? ck('nsso.ret', ret.site + '|' + ret.to, RET_AGE, true) : ck('nsso.ret', '', 0, true));
log('back to ' + siteName(ret.site), s.email); return go(res, hop, set);
}
return go(res, '/sso/check?st=' + q.get('st') + (q.get('r') ? '&r=' + encodeURIComponent(q.get('r')) : '') + '&to=' + encodeURIComponent(safePath(q.get('to'), '/')) + '&m=go', clear); // m=go: still a deliberate tap (the wallet step when one is missing)
}
if (p === '/sso/check') {
const st = String(u.searchParams.get('st') || '');
const to = safePath(u.searchParams.get('to'), '/');
const r = String(u.searchParams.get('r') || '');
const wb = r && r !== C.peer ? await siteBaseFresh(r) : null; // a wallet site asking: the token carries the wallet (the hub's sign-in sites too, 2026-11-17)
if (r && r !== C.peer && !wb) { log('check: unknown site asking, nothing sent', null, r.slice(0, 20)); return go(res, C.defaultPath); } // never answer an unknown site as if the peer asked (2026-11-15: 5xYourTeam was sent to LinkSpin)
const base = wb ? wb() : C.peerBase(), aud = wb ? r : C.peer, forName = siteName(aud);
const none = base + '/sso/in?none=1&to=' + encodeURIComponent(to);
if (!enabled() || !/^[a-f0-9]{32}$/.test(st)) return go(res, none);
let s = null; try { s = await C.member(req); } catch (e) {}
if (!s || !s.email) {
if (u.searchParams.get('m') === 'go' && !isBot(req)) { // a deliberate tap: sign in here first, then /sso/resume finishes the trip
log('check: not signed in here, asking to sign in', null, 'for ' + forName);
const back = new URLSearchParams({ st, to }); if (r) back.set('r', r);
return go(res, C.signinPath(C.defaultPath), [ck('nsso.back', back.toString(), BACK_AGE, true)]);
}
log('check: not signed in here', null, 'for ' + forName); return go(res, none);
}
let w = null;
if (wb) { try { w = await C.wallet(s); } catch (e) {} if (!w || !WALLET_RE.test(String(w.address || '').toLowerCase())) {
if (u.searchParams.get('m') === 'go' && C.walletPath && !isBot(req)) { // a deliberate tap: link a wallet here first, then /sso/resume finishes the trip (2026-11-17)
log('check: no wallet on the account, wallet step first', s.email, 'for ' + forName);
const back = new URLSearchParams({ st, to, m: 'go' }); if (r) back.set('r', r);
return go(res, C.walletPath, [ck('nsso.back', back.toString(), BACK_AGE, true), ck('nsso.wait', '1', BACK_AGE, true)]);
}
log('check: no wallet on the account', s.email, 'for ' + forName); return go(res, none); } }
log('token issued', s.email, 'for ' + forName);
return go(res, base + '/sso/in?t=' + mint({ iss: C.self, aud, email: s.email, wallet: w && w.address, name: w && w.name, st, to }));
}
if (p === '/sso/in') {
const c = cookies(req);
const set = [ck('nsso.st', '', 0, true)];
if (u.searchParams.get('none')) {
const nto = safePath(u.searchParams.get('to'), C.defaultPath);
if (u.searchParams.get('hub') && enabled()) { // nobody on the hub: ask the old pairwise provider once (until every site is switched)
const via = String(c['nsso.via'] || ''); set.push(ck('nsso.via', '', 0, true));
log('none on the hub, trying ' + (NAMES[via] || peerName));
return go(res, '/sso/start?nohub=1&mode=' + (u.searchParams.get('m') === 'go' ? 'go' : 'check') + (via && via !== '-' ? '&via=' + encodeURIComponent(via) : '') + '&to=' + encodeURIComponent(nto), set);
}
log('none: not signed in on ' + (u.searchParams.get('hub') ? 'the hub' : peerName)); return go(res, C.signinPath(nto), set);
}
const fromHub = !!u.searchParams.get('h');
const v = fromHub ? verifyHub(u.searchParams.get('h'), { st: c['nsso.st'] }) : verify(u.searchParams.get('t'), { iss: [C.peer].concat(Object.keys(C.from || {})), aud: C.self, st: c['nsso.st'] });
if (v.error) { log('refused: ' + v.error); return go(res, C.signinPath(C.defaultPath), set); }
if (!(await spend(v.n, v.exp))) { log('refused: token already used', v.email); return go(res, C.signinPath(v.to), set); }
let a = null; try { a = await C.accept(v.email, req, v); } catch (e) { a = { fallback: 'error ' + e.message }; }
if (!a || !a.ok) { // not a member here yet (or not allowed to sign in): the normal email-code sign-in, email filled in
log('fallback to email code: ' + ((a && a.fallback) || 'not accepted'), v.email);
set.push(ck('nsso.hint', v.email, HINT_AGE, true));
return go(res, C.signinPath(v.to), set);
}
let cookie = null; try { cookie = await C.signIn(v.email, req, v); } catch (e) { console.error('network-sso sign-in', e.message); }
if (!cookie) { log('fallback to email code: session not made', v.email); return go(res, C.signinPath(v.to), set); }
set.push(cookie); if (c['nsso.off']) set.push(ck('nsso.off', '', 0, true));
if (fromHub) { const w2 = v.wallet && C.from ? { wallet: v.wallet } : { email: v.email }; set.push(ck('nsso.hp', pushTag(w2), PUSH_AGE, true)); } // the hub already has this sign-in
log('signed in from ' + (fromHub ? 'the network hub' : (NAMES[v.iss] || peerName)), v.email);
return go(res, C.landing(v.to === '/' ? C.defaultPath : v.to), set); // no page named: the dashboard, not the public home page (2026-11-13)
}
if (p === '/api/sso/status') {
const c = cookies(req); const set = [];
let s = null; try { s = await C.member(req); } catch (e) {}
const signedIn = !!(s && (s.email || s.address));
const out = { peer: hubOn() ? 'the network' : peerName, check: (enabled() || (hubOn() && (await hubUp()))) && !signedIn && !isBot(req) && !c['nsso.tried'] && !c['nsso.off'] };
if (c['nsso.hint']) { if (!signedIn) out.hint = c['nsso.hint']; set.push(ck('nsso.hint', '', 0, true)); }
return sendJson(res, out, set);
}
return false;
}
// every GET a site serves passes here first (2026-11-15): a signed-in member's real page load pings the hub's activity once a day and,
// with the hub on, tells the hub about this sign-in once (nsso.hp). -> true when it answered (the redirect through the hub).
async function page(req, res, u) {
if (!C || !hubCreds()) return false;
const p = u.pathname;
if (!pageLoad(req, p)) return false;
let s = null; try { s = await C.member(req); } catch (e) {}
const w = who(s); if (!w) return false;
activity(w);
if (hubOn() && cookies(req)['nsso.hp'] !== pushTag(w) && (await hubUp())) {
log('hub: telling the hub about this sign-in', w.email || null);
return go(res, HUB_BASE() + '/sso/set?site=' + encodeURIComponent(HUB_NAME()) + '&t=' + mintHub(Object.assign({ to: p + u.search }, w)), [ck('nsso.hp', pushTag(w), PUSH_AGE, true)]);
}
return false;
}
// true when this browser came here from a deliberate network tap (nsso.back) or a ?return=<site> link (nsso.ret) and still has to
// finish it after signing in. False while it waits on the wallet step (nsso.wait): the dashboard must not bounce it back and forth.
const pendingBack = req => { const c = cookies(req); return !!(c['nsso.back'] || retOf(req)) && !c['nsso.wait']; };
// the wallet was just linked: the next hop when a way back is waiting (2026-11-17), else null
const afterWallet = req => { const c = cookies(req); return c['nsso.back'] || retOf(req) ? '/sso/resume' : null; };
// the name of the site a member is on the way back to, for a line on the provider's dashboard; null when none
function backName(req) {
const c = cookies(req); const ret = retOf(req);
if (ret) return siteName(ret.site);
if (!c['nsso.back']) return null;
const r = new URLSearchParams(c['nsso.back']).get('r'); return siteName(r || (C && C.peer) || '') || null;
}
module.exports = { init, handle, page, seen, enabled, pendingBack, afterWallet, backName, siteBase, mint, verify, spend, safePath, isBot, offCookie, mask, TTL, NAMES, hubOn, hubCreds, signOutEverywhere, mintHub, verifyHub, _hubSeen: t => { hubSeen = t == null ? Date.now() : t; hubChecked = Date.now(); }, _pinged: pinged, _hubSites: o => { if (o) { hubSites = o; hubSitesAt = Date.now(); } return hubSites; } };
+453
View File
@@ -0,0 +1,453 @@
{
"name": "stackpol",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "stackpol",
"version": "1.0.0",
"dependencies": {
"mysql2": "3.24.6",
"qrcode": "1.5.4"
}
},
"node_modules/@types/node": {
"version": "26.6.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
"integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~8.9.0"
}
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"license": "MIT",
"dependencies": {
"color-convert": "^2.0.1"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/aws-ssl-profiles": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz",
"integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==",
"license": "MIT",
"engines": {
"node": ">= 6.0.0"
}
},
"node_modules/camelcase": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
"license": "ISC",
"dependencies": {
"string-width": "^4.2.0",
"strip-ansi": "^6.0.0",
"wrap-ansi": "^6.2.0"
}
},
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"license": "MIT",
"dependencies": {
"color-name": "~1.1.4"
},
"engines": {
"node": ">=7.0.0"
}
},
"node_modules/color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"license": "MIT"
},
"node_modules/decamelize": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/dijkstrajs": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
"license": "MIT"
},
"node_modules/emoji-regex": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"license": "MIT"
},
"node_modules/find-up": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
"license": "MIT",
"dependencies": {
"locate-path": "^5.0.0",
"path-exists": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/generate-function": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz",
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==",
"license": "MIT",
"dependencies": {
"is-property": "^1.0.2"
}
},
"node_modules/get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
"license": "ISC",
"engines": {
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/iconv-lite": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
"integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
"engines": {
"node": ">=0.10.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/is-property": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==",
"license": "MIT"
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
"license": "MIT",
"dependencies": {
"p-locate": "^4.1.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/long": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
"integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
"license": "Apache-2.0"
},
"node_modules/lru.min": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.5.tgz",
"integrity": "sha512-5J9ysMYUpYIg9RF2vJpy9SinEmSviFSe0GyPpCQ4L5QSkLAgeLXlTAOu2ZwWUU5m+0SBl6gUU1R1ZQB3aKypfA==",
"license": "MIT",
"engines": {
"bun": ">=1.0.0",
"deno": ">=1.30.0",
"node": ">=8.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/wellwelwel"
}
},
"node_modules/mysql2": {
"version": "3.24.6",
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.24.6.tgz",
"integrity": "sha512-enu73KhbAua2L3dIxjc6qg6ZJ7H3pt1BImZASWNWY5xSsmJ1ZuUPULTDGXgmJbI61vb+nJAG19IZclIq19UidQ==",
"license": "MIT",
"dependencies": {
"aws-ssl-profiles": "^1.1.2",
"generate-function": "^2.3.1",
"iconv-lite": "^0.7.3",
"long": "^5.3.2",
"lru.min": "^1.1.4",
"named-placeholders": "^1.1.6",
"sql-escaper": "^1.5.1"
},
"engines": {
"node": ">= 8.0"
},
"peerDependencies": {
"@types/node": ">= 8"
}
},
"node_modules/named-placeholders": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.6.tgz",
"integrity": "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==",
"license": "MIT",
"dependencies": {
"lru.min": "^1.1.0"
},
"engines": {
"node": ">=8.0.0"
}
},
"node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
"license": "MIT",
"dependencies": {
"p-try": "^2.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-locate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
"license": "MIT",
"dependencies": {
"p-limit": "^2.2.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/p-try": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/pngjs": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz",
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
"license": "MIT",
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/qrcode": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz",
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
"license": "MIT",
"dependencies": {
"dijkstrajs": "^1.0.1",
"pngjs": "^5.0.0",
"yargs": "^15.3.1"
},
"bin": {
"qrcode": "bin/qrcode"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/require-directory": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/require-main-filename": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
"license": "ISC"
},
"node_modules/safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"license": "MIT"
},
"node_modules/set-blocking": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
"license": "ISC"
},
"node_modules/sql-escaper": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/sql-escaper/-/sql-escaper-1.7.0.tgz",
"integrity": "sha512-ZgP6E9SPnhrhWXxd8+nLKPot3Euzyo3Rpxe6EFAYz2Ffaq9Xg2SH+6d4yJi7vsQDHaQlhzQ1phAopgE6+a1UCQ==",
"license": "MIT",
"engines": {
"bun": ">=1.0.0",
"deno": ">=2.0.0",
"node": ">=12.0.0"
},
"funding": {
"type": "github",
"url": "https://github.com/mysqljs/sql-escaper?sponsor=1"
}
},
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/strip-ansi": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
"license": "MIT",
"dependencies": {
"ansi-regex": "^5.0.1"
},
"engines": {
"node": ">=8"
}
},
"node_modules/undici-types": {
"version": "8.9.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
"integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
"license": "MIT",
"peer": true
},
"node_modules/which-module": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
"license": "ISC"
},
"node_modules/wrap-ansi": {
"version": "6.2.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"license": "ISC"
},
"node_modules/yargs": {
"version": "15.4.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
"license": "MIT",
"dependencies": {
"cliui": "^6.0.0",
"decamelize": "^1.2.0",
"find-up": "^4.1.0",
"get-caller-file": "^2.0.1",
"require-directory": "^2.1.1",
"require-main-filename": "^2.0.0",
"set-blocking": "^2.0.0",
"string-width": "^4.2.0",
"which-module": "^2.0.0",
"y18n": "^4.0.0",
"yargs-parser": "^18.1.2"
},
"engines": {
"node": ">=8"
}
},
"node_modules/yargs-parser": {
"version": "18.1.3",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
"license": "ISC",
"dependencies": {
"camelcase": "^5.0.0",
"decamelize": "^1.2.0"
},
"engines": {
"node": ">=6"
}
}
}
}
+1
View File
@@ -0,0 +1 @@
{"name":"stackpol","version":"1.0.0","private":true,"main":"server.js","scripts":{"start":"node server.js"},"dependencies":{"mysql2":"3.24.6","qrcode":"1.5.4"}}
+82
View File
@@ -0,0 +1,82 @@
// The programs a Stack POL page can show (2026-11-09). Keys match the indexer (tools/indexer.py). Blurbs for the games are
// InstantAdPay's own game descriptions (onchain-ad-membership/site server.js GAMES), so this site never invents how a game pays.
// guides (2026-11-17): the program's own evergreen Guides section, linked from its page and the blog index.
// join(u): the member's own referral link; the network pages use the site owner's (martbost).
'use strict';
const { tracked } = require('./netsites');
const g = slug => u => 'https://instantadpay.com/g/' + slug + '?ref=' + encodeURIComponent(u);
const PROGRAMS = [
{ k: 'iap', slug: 'instantadpay', n: 'InstantAdPay', c: '#2dd4bf', kind: 'Ad platform', site: 'https://instantadpay.com', join: u => 'https://instantadpay.com/join/' + encodeURIComponent(u),
d: 'The advertising platform at the center of the network. Ad packages buy delivery across the network, and each package pays the sponsor line on Polygon in the same transaction.',
how: 'Payouts here are the referral payments the InstantAdPay smart contract sends up the sponsor line when an ad package sells. Nothing is held by the company: the contract pays in the same transaction as the purchase.' },
{ k: 'ls', slug: 'linkspin', n: 'LinkSpin', c: '#3b82f6', kind: 'Link tools', site: 'https://linkspin.app', join: u => 'https://linkspin.app/join/' + encodeURIComponent(u),
d: 'Free link tools: spin links that rotate your traffic, bridge pages built from any offer link, banner spins and ad zones. Package sales pay the sponsor line in POL in the same transaction.',
how: 'Payouts here are the referral payments the LinkSpin smart contract sends up the sponsor line when a package sells, in the same transaction as the purchase.' },
{ k: 'dlb', guides: 'https://downlinebanners.com/guides', slug: 'downline-banners', n: 'Downline Banners', c: '#c6f432', kind: 'Banner board', verb: 'Join', app: true, site: 'https://downlinebanners.com', join: u => 'https://downlinebanners.com/?ref=' + encodeURIComponent(u),
d: 'The network banner board on Polygon. A $5 spot buys 300 guaranteed views on the board and a place in one line; when later spots sell, the contract pays the 10 spots above them and the buyer\'s sponsor in the same transaction. Nothing is promised.',
how: 'Payouts here are the payments the Downline Banners smart contract sends to the buyer\'s sponsor and to the 10 spots above each new spot, in the same transaction as the sale. Company and momentum-fund shares are not counted.' },
// Viral Banner Blitz (live 2026-11-14): join through the LinkSpin network link (nwvbb, src=stackpol) so LinkSpin Reports show Stack POL as
// the source; it lands on viralbannerblitz.com/?ref=<username>. Facts from the VBB app (how.html, config.js) and the VBBShop contract.
{ k: 'vbb', guides: 'https://viralbannerblitz.com/guides', slug: 'viral-banner-blitz', n: 'Viral Banner Blitz', c: '#ff2d87', kind: 'Banner loop', verb: 'Join', app: true, site: 'https://viralbannerblitz.com', join: u => tracked('vbb', 'stackpol', { s1: u }),
d: 'A shared loop of 125x125 banners that real visitors move. Network members post one banner free every day they sign in; every 10 verified visitors shift the loop one place, and a banner that rides out has cycled and earns 150 network ad views (advertising, not cash). Weekly leaderboards share a prize pot in POL. Credit packs ($3 for 10, $10 for 40) and a $2 banner look are one-time purchases with SafePal or any other crypto wallet, never a subscription. Nothing is promised.',
how: 'Payouts here are the 30% sponsor share the Viral Banner Blitz smart contract pays to the buyer\'s sponsor in the same transaction as each purchase, plus the weekly leaderboard prizes sent in POL from the prize wallet to the winners\' wallets. The prize-wallet and company shares are not counted.' },
// ViralAdBlitz (live 2026-11-15): join through the LinkSpin network link (nwvab, src=stackpol), landing on viraladblitz.com/?ref=<username>.
// Facts from the VAB app (README, how page) and the VABShop contract 0xb584...2905 only.
{ k: 'vab', guides: 'https://viraladblitz.com/guides', slug: 'viraladblitz', n: 'ViralAdBlitz', c: '#0a2fa8', kind: 'Viral text ads', verb: 'Join', app: true, site: 'https://viraladblitz.com', join: u => tracked('viraladblitz', 'stackpol', { s1: u }),
d: 'The network\'s home for text ads. Network members post one text ad free; your member page shows your ad and the ads of the five people above you, so every person you bring in shows your ad on their page, five levels deep. A $5 Boost is a one-time purchase of 500 guaranteed network views, paid with SafePal or any other crypto wallet, never a subscription. The contract pays 10% of each Boost to each of five levels up the buyer\'s line in the same transaction. Nothing is promised.',
how: 'Payouts here are the level shares the ViralAdBlitz smart contract pays to five people up the buyer\'s line (10% each, to people who have bought a Boost themselves) in the same transaction as each Boost. The company share is not counted.' },
// ViralAdSource (live 2026-11-17): join through the LinkSpin network link (nwvas, src=stackpol), landing on viraladsource.com/?ref=<username>.
// Facts from the VAS app (approved launch numbers) and the VASShop contract 0x7EFe...4f24 only.
{ k: 'vas', guides: 'https://viraladsource.com/guides', slug: 'viraladsource', n: 'ViralAdSource', c: '#c4371b', kind: 'Reshared text ads', verb: 'Join', app: true, site: 'https://viraladsource.com', join: u => tracked('viraladsource', 'stackpol', { s1: u }),
d: 'Free text ads that travel by reshares. Network members post a text ad free; anyone can reshare it with their own link, and every reshare shows as a branch on the ad\'s family tree. A $5 Boost is a one-time purchase that puts an ad on top of the reshare board for 7 days, paid with SafePal or any other crypto wallet, never a subscription. The contract splits each Boost in the same transaction: 20% to the resharer whose link it came through, 10% to each of five levels up the buyer\'s line and 10% to a capped reward pot. No Boost is needed to receive a share. Nothing is promised.',
how: 'Payouts here are what the ViralAdSource smart contract pays members in the same transaction as each Boost (the 20% resharer cut and the 10% level shares, five levels up the buyer\'s line), plus the small new-member rewards paid from its reward pot. The company share is not counted.' },
// YourProgramBuilder (live 2026-11-17): join through the LinkSpin network link (nwypb, src=stackpol), landing on yourprogrambuilder.com/?ref=<username>.
// Facts from the YPB app (decision pack answers 2026-11-17) and the YPBShop contract 0x44A0...3E2a only.
{ k: 'ypb', guides: 'https://yourprogrambuilder.com/guides', slug: 'yourprogrambuilder', n: 'YourProgramBuilder', c: '#22844a', kind: 'Program directory', verb: 'Join', app: true, site: 'https://yourprogrambuilder.com', join: u => tracked('yourprogrambuilder', 'stackpol', { s1: u }),
d: 'An open program directory the network grows. Plant a program you already use, free: your link with your ID, checked every day. Network members save their own IDs in it, and a visitor who comes through a member sees the link of the member they came through first. At 10 saved IDs a program goes to review for the Crypto Team Build Network builder. A $10 Spotlight is a one-time purchase of 1,000 views, paid with SafePal or any other crypto wallet, never a subscription. Nothing is promised.',
how: 'Payouts here are the shares the YPBShop smart contract pays up the line of the buyer in the same transaction as each Spotlight: 20% to the direct sponsor and 5% to each of the next four levels. No Spotlight is needed to receive a share. The company share is not counted.' },
// Video App Income (live 2026-11-20): direct join link carrying the network username (videoappincome.com/join?ref=<username>; the site
// resolves the username through the hub). Facts from the VAI app (site.js, server.js) and the VideoAppIncome contract 0x0cfF...C201 only.
{ k: 'vai', slug: 'video-app-income', n: 'Video App Income', c: '#8b5cf6', kind: 'Video maker', verb: 'Join', app: true, site: 'https://videoappincome.com', join: u => 'https://videoappincome.com/join?ref=' + encodeURIComponent(u),
d: 'Make short vertical promo videos from your phone for any website, offer or niche. Paste a link and the app reads the page, writes the script and adds the voice, captions, footage of the site and music in about a minute and a half, no camera needed. Every video gets a tracked share page with a button to your link, so you can see who opened it, how much they watched and who tapped. Sign in with SafePal or any other crypto wallet, or with your network account. The first video is free; after that a video is 10 credits, and a $10 pack is 100 credits, a one-time purchase in POL, never a subscription. Nothing is promised.',
how: 'Payouts here are the shares the Video App Income smart contract pays members in the same transaction as each credit purchase: 30% to the buyer\'s sponsor and 8% to each of the five positions above the buyer in a 3-wide matrix, to people who have bought credits themselves. The company shares are not counted.' },
// 5xYourTeam The Draft (live 2026-11-15): join through the LinkSpin network link (nw5x, src=stackpol), landing on 5xyourteam.com/?ref=<username>.
// Facts from the 5x app (README, config) and the DraftPosition contract 0x83Bb...bc74 only.
{ k: 'fx', guides: 'https://5xyourteam.com/guides', slug: '5xyourteam', n: '5xYourTeam', c: '#ffc93c', kind: 'Team draft', verb: 'Join', app: true, site: 'https://5xyourteam.com', join: u => tracked('fivex', 'stackpol', { s1: u }),
d: 'A weekly sports-style draft of people waiting in the network holding tank. A $10 position is a one-time purchase with SafePal or any other crypto wallet, never a subscription: it gives 5 picks right away and a spot in every Monday draft, where coaches pick people to sponsor and help. Draft order is earned by how many of last week\'s picks got started. Nothing is promised.',
how: 'Payouts here are the shares the DraftPosition smart contract pays up the buyer\'s line in the same transaction as each position: 25% to the sponsor and 5% to each of four more levels (to people who hold a position themselves). The weekly Best Coach pot and the company share are not counted.' },
// DownlineHydra (live 2026-11-15): join through the LinkSpin network link (nwdh, src=stackpol), landing on downlinehydra.com/?ref=<username>.
// Facts from the DH app (terms, /pro, config) and the HydraPro contract 0xEd07...4e90 only.
{ k: 'dh', guides: 'https://downlinehydra.com/guides', slug: 'downlinehydra', n: 'DownlineHydra', c: '#b4471f', kind: 'Downline builder', verb: 'Join', app: true, site: 'https://downlinehydra.com', join: u => tracked('downlinehydra', 'stackpol', { s1: u }),
d: 'The network\'s front door: join once and you are a member of every network site, with one sponsor line through all of them. Save your referral ID for each program in the builder and the people who join through you see your link first; free members show one program of their own to their team, five levels deep. Pro is $30, a one-time purchase with SafePal or any other crypto wallet, never a subscription, and shows four. Nothing is promised.',
how: 'Payouts here are the shares the HydraPro smart contract pays up the buyer\'s line in the same transaction as each Pro upgrade: 20% to the direct sponsor (free or Pro) and 10% to each of the next four Pro members above them. The company share is not counted.' },
{ k: 'ph', guides: 'https://polhunter.com/guides', slug: 'polhunter', n: 'PolHunter', c: '#a3e635', kind: 'Scavenger hunt', site: 'https://polhunter.com', join: g('polhunter'),
d: 'Hunt hidden codes on sites across the network. Every find drips POL straight to your wallet.' },
{ k: 'ec', slug: 'earners-corner', n: 'Earners Corner', c: '#a78bfa', kind: 'Community forum', site: 'https://earnerscorner.com', join: u => 'https://instantadpay.com/forum/join/' + encodeURIComponent(u),
d: 'The network\'s forum for people who earn online. Activated InstantAdPay members get a one-time 1 POL welcome for introducing themselves.',
how: 'Payouts here are the one-time 1 POL welcome rewards the forum sends to activated InstantAdPay members (wallet linked, payouts switched on) who introduce themselves in the Introductions category, straight to the payout wallet on their account.' },
{ k: 'pd', slug: 'passivedrip', n: 'PassiveDrip', c: '#22c55e', kind: 'Earning site', site: 'https://passivedrip.com', join: g('passivedrip'),
d: 'Claim the faucet, view paid-to-click ads, complete offers and roll the daily bonus for coins. At 2,000 coins ($1) the balance is paid out automatically in POL to your Polygon wallet.',
how: 'Payouts here are PassiveDrip balances paid out automatically in POL on Polygon once they reach 2,000 coins ($1), straight to the wallet on the member\'s account. What anyone earns depends on what they do there; nothing is guaranteed.' },
{ k: 'gk', slug: 'gem-kingdom', n: 'Gem Kingdom', c: '#f472b6', kind: 'Fantasy match-3', site: 'https://gemkingdom.app', join: g('gemkingdom'),
d: 'Match gems to battle monsters with three heroes, earn stars and rebuild your village. First clears and boss wins pay POL.' },
{ k: 'sw', slug: 'spellwheel', n: 'SpellWheel', c: '#facc15', kind: 'Word game', site: 'https://spellwheel.com', join: g('spellwheel'),
d: 'Swipe the letter wheel to fill the crossword, travel through six cozy places, and solve a new daily puzzle with everyone. Clear levels and chapters to earn POL.' },
{ k: 'ch', slug: 'clutterhunt', n: 'ClutterHunt', c: '#34d399', kind: 'Hidden objects', site: 'https://clutterhunt.com', join: g('clutterhunt'),
d: 'Search cozy, cluttered rooms for hidden objects. New rooms every season, starting with the Haunted Manor.' },
{ k: 'pw', slug: 'polywarriors', n: 'PolyWarriors', c: '#22d3ee', kind: 'Cyberpunk fighting', site: 'https://polywarriors.com', join: g('polywarriors'),
d: 'Turn-based fights with collectible low-poly warriors. Recruit fighters born with rare traits, climb the arena and challenge other members.' },
{ k: 'pm', slug: 'pol-miner', n: 'POL Miner', c: '#c084fc', kind: 'Mining adventure', site: 'https://polminer.com', join: g('polminer'),
d: 'Dig down through the layers, haul ore to sell, upgrade your pick, lamp and cart, and beat a drill boss every 30 m. Rare pink Polygon crystals pay POL.' },
{ k: 'dr', slug: 'drip-runner', n: 'Drip Runner', c: '#38bdf8', kind: 'Arcade runner', site: 'https://driprunner.app', join: g('driprunner'),
d: 'Hop the network, dodge the bots, clear chapters. Each first clear drips POL into your game balance.' },
{ k: 'td', slug: 'turkey-drop', n: 'Turkey Drop', c: '#fb923c', kind: 'Thanksgiving, Nov 2 to 30', site: 'https://turkeydropgame.com', join: g('turkeydrop'), season: { ends: '2026-11-30', label: 'Season runs November 2 to 30.' },
d: 'The WFWL 98.7 helicopter is dropping turkeys over the mall. Catch them before they splat. Score milestones pay POL the first time you reach them, and the weekly top 3 win a POL prize.' },
{ k: 'ra', slug: 'road-agent', n: 'Road Agent', c: '#f59e0b', kind: 'Night highway shooter', site: 'https://roadagent.app', join: g('roadagent'),
d: 'Drive the night highway, shoot the hostiles that hunt you, spare the civilians. Every sector you clear for the first time pays POL.' },
{ k: 'pb', slug: 'polybreak', n: 'PolyBreak', c: '#60a5fa', kind: 'Brick breaker', site: 'https://polybreak.app', join: g('polybreak'),
d: 'Break walls of glass jewel bricks with the classic arcade capsules and catch the purple Polygon gem when it falls. First clears of each round pay POL.' },
];
const BY_KEY = Object.fromEntries(PROGRAMS.map(p => [p.k, p]));
const BY_SLUG = Object.fromEntries(PROGRAMS.map(p => [p.slug, p]));
module.exports = { PROGRAMS, BY_KEY, BY_SLUG };
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+37
View File
@@ -0,0 +1,37 @@
/* Site assistant widget, Stack POL look (layout.js): deep violet night, gold for the stack, Sora headings, Manrope body.
Fallbacks match the layout's tokens. */
#scChat{--sc-bg:var(--panel,#130c24);--sc-bg2:var(--panel-2,#1b1232);--sc-ink:var(--ink,#f3efff);--sc-sub:var(--muted,#a8a0c6);--sc-line:var(--line,rgba(183,148,255,.18));
--sc-violet:var(--violet,#8247e5);--sc-violet-hi:var(--violet-hi,#b794ff);--sc-gold:var(--gold,#ffc24b);--sc-gold-d:var(--gold-d,#b9781a);
--sc-disp:var(--display,"Sora","Segoe UI",system-ui,sans-serif);--sc-font:var(--body,"Manrope",system-ui,sans-serif);
position:fixed;right:18px;bottom:18px;z-index:80;font-family:var(--sc-font)}
#scBtn{width:58px;height:58px;border-radius:18px;border:0;cursor:pointer;background:var(--sc-gold);color:#160b02;display:flex;align-items:center;justify-content:center;box-shadow:0 5px 0 var(--sc-gold-d),0 14px 30px rgba(255,194,75,.2)}
#scBtn:focus-visible{outline:2px solid var(--sc-violet-hi);outline-offset:4px}
#scChat.open #scBtn{background:var(--sc-violet);color:#fff;box-shadow:0 5px 0 #4b2394}
/* the panel sets display:flex, which would beat the hidden attribute: closing must win */
#scPanel[hidden]{display:none}
#scPanel{position:absolute;right:0;bottom:76px;width:370px;max-width:calc(100vw - 32px);height:540px;max-height:calc(100vh - 110px);display:flex;flex-direction:column;
background:var(--sc-bg);color:var(--sc-ink);border:1px solid var(--sc-line);border-radius:18px;box-shadow:0 24px 60px rgba(0,0,0,.55);overflow:hidden}
.sc-head{display:flex;align-items:flex-start;gap:10px;padding:14px 16px;background:linear-gradient(135deg,rgba(130,71,229,.35),rgba(19,12,36,0) 75%),var(--sc-bg2);border-bottom:1px solid var(--sc-line)}
.sc-head>div{flex:1;min-width:0}
.sc-title{display:block;font:800 19px var(--sc-disp);letter-spacing:-.01em}
.sc-sub{display:block;font-size:12.5px;color:var(--sc-sub)}
#scClose{background:transparent;border:0;color:var(--sc-sub);font-size:26px;line-height:1;cursor:pointer;padding:0 2px}
.sc-msgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:9px}
.sc-m{max-width:88%;padding:9px 12px;font-size:14.5px;line-height:1.5;border-radius:14px;overflow-wrap:anywhere}
.sc-m.bot{align-self:flex-start;background:var(--sc-bg2);border:1px solid var(--sc-line);border-bottom-left-radius:4px}
.sc-m.me{align-self:flex-end;background:var(--sc-violet);color:#fff;border-bottom-right-radius:4px}
.sc-m a{color:var(--sc-gold);text-decoration:underline}
.sc-m.me a{color:#fff}
.sc-m.wait{opacity:.6}
.sc-cta{display:inline-block;background:var(--sc-gold);color:#160b02!important;text-decoration:none!important;font:800 14px var(--sc-disp);padding:8px 14px;border-radius:12px;box-shadow:0 4px 0 var(--sc-gold-d)}
.sc-handoff{background:transparent!important;border:0!important;padding:0!important}
.sc-topics{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 8px}
.sc-topics button{background:transparent;color:var(--sc-violet-hi);border:1px solid var(--sc-line);border-radius:999px;font:600 12.5px var(--sc-font);padding:5px 11px;cursor:pointer}
.sc-topics button:hover{border-color:var(--sc-violet-hi)}
.sc-input{display:flex;gap:8px;padding:10px 12px;border-top:1px solid var(--sc-line)}
.sc-input input{flex:1;min-width:0;border:1px solid var(--sc-line);border-radius:12px;padding:10px 12px;font:15px var(--sc-font);color:var(--sc-ink);background:var(--ground,#0a0715)}
.sc-input input::placeholder{color:var(--sc-sub)}
.sc-input input:focus{outline:2px solid var(--sc-violet-hi);outline-offset:-1px}
.sc-input button{background:var(--sc-gold);color:#160b02;border:0;border-radius:12px;font:800 14px var(--sc-disp);padding:0 16px;cursor:pointer}
.sc-human{display:block;text-align:center;font-size:12.5px;color:var(--sc-sub);padding:0 0 10px}
@media (max-width:600px){#scChat{right:12px;bottom:12px}#scBtn{width:52px;height:52px}#scPanel{bottom:68px;height:calc(100vh - 100px)}}
+72
View File
@@ -0,0 +1,72 @@
// Site assistant widget (2026-11-15): a round button bottom right, a panel that asks /api/chat. The look is this site's own,
// in /assets/chat.css (colors and fonts from the site's stylesheet). When an answer cannot help, or the visitor asks for a
// person, it offers "Open network support": InstantAdPay's support desk, which already knows the question and the site.
// The SAME file ships in ViralAdBlitz, DownlineHydra, 5xYourTeam, Viral Banner Blitz, Downline Banners and Stack POL.
(function () {
if (window.__siteChat || /^\/admin/.test(location.pathname)) return;
window.__siteChat = 1;
var css = document.createElement('link'); css.rel = 'stylesheet'; css.href = '/assets/chat.css?v=20261115e'; document.head.appendChild(css);
var NAME = 'this site', TOPICS = [];
var root = document.createElement('div'); root.id = 'scChat';
root.innerHTML = '<button id="scBtn" type="button" aria-label="Ask a question" aria-expanded="false">'
+ '<svg viewBox="0 0 24 24" width="26" height="26" aria-hidden="true"><path fill="currentColor" d="M4 4h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 4v-4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm3 6.5a1.5 1.5 0 1 0 0 .01zm5 0a1.5 1.5 0 1 0 0 .01zm5 0a1.5 1.5 0 1 0 0 .01z"/></svg></button>'
+ '<div id="scPanel" role="dialog" aria-label="Questions" hidden>'
+ '<div class="sc-head"><div><b class="sc-title" id="scTitle">Ask a question</b><span class="sc-sub">Straight answers about this site and the network</span></div>'
+ '<button id="scClose" type="button" aria-label="Close">&times;</button></div>'
+ '<div class="sc-msgs" id="scMsgs" aria-live="polite"></div>'
+ '<div class="sc-topics" id="scTopics"></div>'
+ '<form class="sc-input" id="scForm"><input id="scIn" autocomplete="off" maxlength="600" placeholder="Type your question" aria-label="Your question">'
+ '<button type="submit" id="scSend">Send</button></form>'
+ '<a class="sc-human" id="scHuman" href="https://instantadpay.com/support" target="_blank" rel="noopener">Need a person? Open network support</a>'
+ '</div>';
document.body.appendChild(root);
var $ = function (id) { return document.getElementById(id); };
var msgs = $('scMsgs'), input = $('scIn'), panel = $('scPanel'), btn = $('scBtn');
var history = [], greeted = false, support = 'https://instantadpay.com/support';
fetch('/api/chat/config').then(function (r) { return r.json(); }).then(function (c) {
if (c.name) { NAME = c.name; $('scTitle').textContent = 'Ask ' + c.name; }
if (c.support) { support = c.support; $('scHuman').href = c.support; }
TOPICS = c.topics || [];
}).catch(function () {});
function esc(s) { return String(s).replace(/[&<>"]/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]; }); }
function add(text, who) {
var d = document.createElement('div'); d.className = 'sc-m ' + who;
d.innerHTML = esc(text).replace(/(https?:\/\/[^\s<]+[^\s<.,;:!?)])/g, '<a href="$1" target="_blank" rel="noopener">$1</a>');
msgs.appendChild(d); msgs.scrollTop = msgs.scrollHeight; return d;
}
function offer(link) {
var old = msgs.querySelector('.sc-handoff'); if (old) old.remove();
var d = document.createElement('div'); d.className = 'sc-m bot sc-handoff';
var a = document.createElement('a'); a.className = 'sc-cta'; a.href = link || support; a.target = '_blank'; a.rel = 'noopener'; a.textContent = 'Open network support';
d.appendChild(a); msgs.appendChild(d); msgs.scrollTop = msgs.scrollHeight;
}
function open() {
panel.hidden = false; btn.setAttribute('aria-expanded', 'true'); root.className = 'open';
if (!greeted) {
greeted = true;
add('Hi. Ask me how ' + NAME + ' works, what it costs, how payouts work, or about any other site in the network. Straight answers, no income hype.', 'bot');
var t = $('scTopics'); TOPICS.slice(0, 4).forEach(function (q) {
var b = document.createElement('button'); b.type = 'button'; b.textContent = q; b.addEventListener('click', function () { input.value = q; send(); }); t.appendChild(b);
});
}
setTimeout(function () { input.focus(); }, 50);
}
function close() { panel.hidden = true; btn.setAttribute('aria-expanded', 'false'); root.className = ''; }
btn.addEventListener('click', function () { panel.hidden ? open() : close(); });
$('scClose').addEventListener('click', close);
document.addEventListener('keydown', function (e) { if (e.key === 'Escape' && !panel.hidden) close(); });
async function send() {
var q = input.value.trim(); if (!q) return;
input.value = ''; $('scTopics').innerHTML = '';
add(q, 'me'); var wait = add('...', 'bot wait');
try {
var r = await (await fetch('/api/chat', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: q, history: history.slice(-6) }) })).json();
wait.remove();
add(r.reply || r.error || 'Something went wrong. Try again in a moment.', 'bot');
history.push(q, r.reply || '');
if (r.handoff) offer(r.support);
} catch (e) { wait.remove(); add('I could not reach the assistant just now. Try again in a moment, or open network support.', 'bot'); offer(); }
}
$('scForm').addEventListener('submit', function (e) { e.preventDefault(); send(); });
})();
+67
View File
@@ -0,0 +1,67 @@
// "Network Weekend" ribbon (Marty 2026-11-17): a thin bar at the top of every network site page while a network event is live.
// Data: /api/network-deals (netdeals.js, from the hub). Switches on and off by this page's own clock at the event's exact
// startsAt / endsAt (US Central midnights), so a cached feed never shows it early or late, and it takes itself down at endsAt on
// a page left open. Shows this site's own deal for today (byDay, Central date) and links to the full deals page.
// The same file lives in every network site. Never RM Circle, never the games. No inline styles (CSP): styles go through CSSOM.
// Test clock: window.__NW_NOW (ms) before this script runs; nothing else.
(function () {
if (window.__nwRibbon) return; window.__nwRibbon = 1;
var tag = document.currentScript;
var meAttr = (tag && tag.getAttribute('data-site')) || '';
function now() { return typeof window.__NW_NOW === 'number' ? window.__NW_NOW : Date.now(); }
// late November is CST (UTC-6) for every date this ribbon covers
function ctDay(ms) { return new Date(ms - 6 * 3600 * 1000).toISOString().slice(0, 10); }
function closedKey(id, day) { return 'nw.closed.' + id + '.' + day; }
function isClosed(id, day) { try { return window.localStorage.getItem(closedKey(id, day)) === '1'; } catch (e) { return false; } }
function setClosed(id, day) { try { window.localStorage.setItem(closedKey(id, day), '1'); } catch (e) {} }
var bar = null;
function remove() { if (bar && bar.parentNode) bar.parentNode.removeChild(bar); bar = null; }
function paint(body) {
var me = meAttr || (body && body.self) || '';
var t = now();
var ev = ((body && body.events) || []).filter(function (e) { return t >= Date.parse(e.startsAt) && t < Date.parse(e.endsAt); })[0];
if (!ev) { remove(); return false; }
var day = ctDay(t);
if (isClosed(ev.id, day)) { remove(); return true; }
var mine = (ev.deals || []).filter(function (d) { return d.site === me && t < Date.parse(d.endsAt || ev.endsAt); })[0];
var line = mine ? ((mine.byDay && mine.byDay[day]) || mine.text) : '';
var label = (ev.days && ev.days[day]) || '';
var onDealsPage = !!ev.url && (function () { try { var u = new URL(ev.url); return location.pathname === u.pathname && (location.hostname === u.hostname || me === 'iap'); } catch (e) { return false; } })();
remove();
bar = document.createElement('div');
bar.className = 'nw-ribbon'; bar.setAttribute('role', 'region'); bar.setAttribute('aria-label', ev.name);
bar.style.cssText = 'position:relative;z-index:50;display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;justify-content:center;padding:8px 40px 8px 16px;'
+ 'background:#14161b;color:#f4f1e8;font:600 13.5px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;text-align:center;border-bottom:2px solid #f2c94c';
// built node by node with CSSOM styles: no style attributes, so a strict CSP (style-src 'self') has nothing to block
function el(tagName, css, text) { var n = document.createElement(tagName); if (css) n.style.cssText = css; if (text) n.textContent = text; return n; }
var head = el('span'); head.appendChild(el('b', 'color:#f2c94c', ev.name)); if (label) head.appendChild(document.createTextNode(' · ' + label));
bar.appendChild(head);
var body2 = el('span', 'font-weight:500', line || ev.tagline);
if (line && mine && mine.note) { body2.appendChild(document.createTextNode(' ')); body2.appendChild(el('span', 'opacity:.75', mine.note)); }
bar.appendChild(body2);
if (ev.url && !onDealsPage) { var a = el('a', 'color:#f2c94c;text-decoration:underline', 'See every deal'); a.href = ev.url; a.target = '_blank'; a.rel = 'noopener'; bar.appendChild(a); }
var x = el('button', 'position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:0;color:#f4f1e8;font-size:18px;line-height:1;cursor:pointer;padding:4px 8px', '×');
x.type = 'button'; x.setAttribute('aria-label', 'Hide for today'); bar.appendChild(x);
bar.querySelector('button').addEventListener('click', function () { setClosed(ev.id, day); remove(); });
document.body.insertBefore(bar, document.body.firstChild);
return true;
}
var feed = null, timer = null;
function schedule() {
clearTimeout(timer); if (!feed) return;
// wake at the next switch moment (start, end, a deal ending, the next Central midnight), at least once a minute
var t = now(), next = t + 60 * 1000;
(feed.events || []).forEach(function (e) {
[e.startsAt, e.endsAt].concat((e.deals || []).map(function (d) { return d.endsAt; })).forEach(function (s) { var x = Date.parse(s); if (x > t && x < next) next = x; });
});
timer = setTimeout(function () { if (typeof window.__NW_NOW === 'number') window.__NW_NOW += next - t; paint(feed); schedule(); }, Math.max(250, next - t));
}
function run() {
fetch('/api/network-deals', { credentials: 'omit' }).then(function (r) { return r.ok ? r.json() : null; }).then(function (b) {
if (!b || !Array.isArray(b.events) || !b.events.length) return;
feed = b; paint(b); schedule();
}).catch(function () {});
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();
window.__nwPaint = function (b) { feed = b; return paint(b); }; // tests
})();
+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M32 4l24 14v28L32 60 8 46V18z" fill="#8247e5"/><path d="M20 28l12-7 12 7v10l-12 7-12-7z" fill="#ffc24b"/></svg>

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

-78
View File
@@ -1,78 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<title>Stack POL · coming soon</title>
<meta name="description" content="Your bag of POL from across the network, in one place to show off and share. Coming soon.">
<meta property="og:title" content="Stack POL · coming soon">
<meta property="og:description" content="Your bag of POL from across the network, in one place to show off and share.">
<meta property="og:image" content="https://stackpol.com/stackpol-hero-poster.jpg">
<meta property="og:video" content="https://stackpol.com/stackpol-hero.mp4">
<meta name="twitter:card" content="summary_large_image">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M32 4l24 14v28L32 60 8 46V18z' fill='%238247e5'/%3E%3C/svg%3E">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;800&family=Manrope:wght@400;600&display=swap">
<style>
:root{color-scheme:dark;--ground:#0b0716;--ink:#f1edff;--muted:#a79fc4;--violet:#8247e5;--violet-hi:#b794ff;--gold:#ffc24b;--line:rgba(183,148,255,.22)}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;align-items:center;padding:24px 16px 40px;background:var(--ground);color:var(--ink);font:16px/1.6 Manrope,system-ui,sans-serif;
background-image:radial-gradient(ellipse 60% 45% at 50% 20%,rgba(130,71,229,.28),transparent 65%),radial-gradient(ellipse 40% 35% at 80% 90%,rgba(255,194,75,.10),transparent 60%)}
main{width:100%;max-width:960px;text-align:center}
.stage{position:relative;width:100%;aspect-ratio:16/9;border-radius:20px;overflow:hidden;background:#000;border:1px solid var(--line);box-shadow:0 40px 90px -30px rgba(0,0,0,.9),0 0 80px -20px rgba(130,71,229,.45);margin:8px 0 26px}
.stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.sound{position:absolute;right:14px;bottom:14px;z-index:2;display:flex;align-items:center;gap:8px;padding:9px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.25);background:rgba(11,7,22,.7);color:#fff;font:600 13px Sora,sans-serif;cursor:pointer;backdrop-filter:blur(6px)}
.sound:hover{border-color:var(--violet-hi)}
h1{font:800 clamp(34px,7vw,52px)/1.05 Sora,sans-serif;letter-spacing:-.01em;margin:0 0 12px}
h1 span{background:linear-gradient(90deg,var(--violet-hi),var(--gold));-webkit-background-clip:text;background-clip:text;color:transparent}
p{color:var(--muted);margin:0 auto 14px;max-width:52ch}
.pill{display:inline-block;margin-bottom:14px;padding:4px 12px;border:1px solid var(--line);border-radius:999px;font:600 12px Sora,sans-serif;letter-spacing:.14em;text-transform:uppercase;color:var(--violet-hi)}
.links{margin-top:22px;display:flex;flex-wrap:wrap;gap:10px;justify-content:center}
.links a{color:var(--ink);text-decoration:none;padding:10px 16px;border-radius:12px;border:1px solid var(--line);background:rgba(130,71,229,.12);font-weight:600}
.links a:hover{border-color:var(--violet-hi)}
.fine{font-size:12px;color:#7d7699;margin-top:28px}
.spot{margin:26px auto 0;width:100%;max-width:728px;min-height:90px;display:flex;justify-content:center;align-items:center}
</style>
</head>
<body>
<main>
<div class="stage">
<video id="hero" src="/stackpol-hero.mp4" poster="/stackpol-hero-poster.jpg" autoplay muted loop playsinline preload="auto"></video>
<button class="sound" id="sound" type="button" aria-pressed="false">🔇 Tap for sound</button>
</div>
<span class="pill">Coming soon</span>
<h1>Stack <span>POL</span></h1>
<p>Every site in the network that pays you POL, stacked into one bag you can show off and share.</p>
<p>It is being built now. Until then, these are the places that fill it:</p>
<div class="links">
<a href="https://instantadpay.com/">InstantAdPay</a>
<a href="https://polhunter.com/">PolHunter</a>
<a href="https://driprunner.app/">Drip Runner</a>
</div>
<p class="fine">The amounts in the video are an illustration, not a promise of what anyone will earn.</p>
<!-- LinkSpin network ad zone (728x90), Marty's first zone test 2026-10-08 -->
<div class="spot"><script async src="https://linkspin.app/z.js" data-zone="ls-9c2a52"></script></div>
</main>
<script>
(function () {
var v = document.getElementById('hero'), b = document.getElementById('sound'), touched = false;
function label() { b.textContent = v.muted ? '🔇 Tap for sound' : '🔊 Sound on'; b.setAttribute('aria-pressed', String(!v.muted)); }
// browsers only allow sound after the visitor interacts, so: try with sound, fall back to muted,
// and the first tap or key anywhere on the page turns the sound on and restarts the clip
v.muted = false;
v.play().then(label).catch(function () { v.muted = true; label(); v.play().catch(function () {}); });
function firstTouch(e) {
if (touched) return; touched = true;
document.removeEventListener('pointerdown', firstTouch, true); document.removeEventListener('keydown', firstTouch, true);
if (e && e.target === b) return; // the button handles itself
if (v.muted) { v.muted = false; v.currentTime = 0; v.play().catch(function () {}); label(); }
}
document.addEventListener('pointerdown', firstTouch, true); document.addEventListener('keydown', firstTouch, true);
b.addEventListener('click', function () {
v.muted = !v.muted;
if (!v.muted) { v.currentTime = 0; v.play().catch(function () {}); }
label();
});
})();
</script>
</body>
</html>
+675
View File
@@ -0,0 +1,675 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
<meta name="description" content="A one-page guide to the Crypto Team Build Network: one account across every site, everything on Polygon, where your ad shows up, and how payments split on the spot.">
<link rel="canonical" href="https://stackpol.com/network">
<meta property="og:title" content="How the Crypto Team Build Network Works"><meta property="og:description" content="One account, every site, all on Polygon. See how visitors travel, where ads show up and how every payment splits on the spot.">
<meta property="og:url" content="https://stackpol.com/network"><meta property="og:image" content="https://stackpol.com/og-stackpol-1200x630.jpg"><meta name="twitter:card" content="summary_large_image">
<link rel="icon" href="/favicon.svg">
<style>:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}body{margin:0;font:14px system-ui,sans-serif}img{max-width:100%}[hidden]{display:none!important}</style>
</head><body>
<title>How the Crypto Team Build Network Works</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700;800&family=Atkinson+Hyperlegible:wght@400;700&display=swap">
<style>
/* Layout: a transit map over violet POL glass. Colored "lines" (traffic, sites, money, trust) run down one long page; each section is a numbered stop; glass panels and coins carry the Polygon thread. */
:root{
--bg:#F3F2FB; --surface:#FFFFFF; --ink:#1B1E38; --muted:#4E5478; --rule:#DCDCEE;
--violet:#7B3FE4; --violet-2:#A77BFF; --violet-soft:#ECE3FF;
--glass:rgba(255,255,255,.62); --glass-edge:rgba(123,63,228,.28); --glass-shine:rgba(255,255,255,.9);
--orb-a:rgba(140,82,255,.30); --orb-b:rgba(80,160,255,.22);
--traffic:#EA6324; --sites:#2A7FD4; --money:#C98F00; --trust:#C9356A; --go:#1F9D6A;
--sites-soft:#DCEAFA; --trust-soft:#F8DDE7; --go-soft:#D9F2E7; --money-soft:#FBF0CF;
--on-color:#FFFFFF; --bar-ink:#1B1E38;
--display:"Plus Jakarta Sans","Segoe UI","Segoe UI",system-ui,sans-serif;
--body:"Atkinson Hyperlegible","Segoe UI",system-ui,sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
--bg:#110F24; --surface:#1C1A36; --ink:#F0EEFB; --muted:#B0ACD0; --rule:#322E5A;
--violet:#A47BFF; --violet-2:#C9AEFF; --violet-soft:#2A2152;
--glass:rgba(40,32,82,.55); --glass-edge:rgba(180,150,255,.30); --glass-shine:rgba(255,255,255,.18);
--orb-a:rgba(140,82,255,.35); --orb-b:rgba(60,120,255,.22);
--traffic:#FF8A52; --sites:#5AA6F0; --money:#F2C14A; --trust:#EE6A98; --go:#45C792;
--sites-soft:#17304D; --trust-soft:#3D1C2B; --go-soft:#123828; --money-soft:#3A3014;
--on-color:#11102A; --bar-ink:#11102A;
color-scheme:dark}}
:root[data-theme="dark"]{
--bg:#110F24; --surface:#1C1A36; --ink:#F0EEFB; --muted:#B0ACD0; --rule:#322E5A;
--violet:#A47BFF; --violet-2:#C9AEFF; --violet-soft:#2A2152;
--glass:rgba(40,32,82,.55); --glass-edge:rgba(180,150,255,.30); --glass-shine:rgba(255,255,255,.18);
--orb-a:rgba(140,82,255,.35); --orb-b:rgba(60,120,255,.22);
--traffic:#FF8A52; --sites:#5AA6F0; --money:#F2C14A; --trust:#EE6A98; --go:#45C792;
--sites-soft:#17304D; --trust-soft:#3D1C2B; --go-soft:#123828; --money-soft:#3A3014;
--on-color:#11102A; --bar-ink:#11102A;
color-scheme:dark}
body{background:var(--bg);color:var(--ink);font-family:var(--body);font-size:1.125rem;line-height:1.6;
background-image:radial-gradient(40rem 28rem at 85% -5%,var(--orb-a),transparent 70%),radial-gradient(34rem 26rem at -10% 30%,var(--orb-b),transparent 70%),radial-gradient(36rem 30rem at 110% 62%,var(--orb-a),transparent 70%);background-repeat:no-repeat}
.wrap{max-width:1080px;margin:0 auto;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-block:32px 48px;display:flex;flex-direction:column;gap:60px}
h1,h2,h3{font-family:var(--display);line-height:1.15;text-wrap:balance;margin:0}
h1{font-size:clamp(2.1rem,5.5vw,3.5rem);font-weight:800;letter-spacing:-.02em}
h2{font-size:clamp(1.6rem,3.6vw,2.3rem);font-weight:800;letter-spacing:-.01em}
h3{font-size:1.3rem;font-weight:600}
p{margin:0}
.glass{background:var(--glass);border:1.5px solid var(--glass-edge);-webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);box-shadow:inset 0 1px 0 var(--glass-shine),0 10px 30px -18px var(--violet)}
.lede{font-size:1.3rem;color:var(--muted);max-width:44ch}
.sec{display:flex;flex-direction:column;gap:20px}
.sec-head{display:flex;align-items:center;gap:14px}
.stop{flex:none;width:52px;height:52px;border-radius:50%;display:grid;place-items:center;font-family:var(--display);font-weight:700;font-size:1.5rem;color:var(--on-color);background:var(--c);border:5px solid var(--bg);box-shadow:0 0 0 4px var(--c)}
.intro{max-width:62ch;color:var(--muted)}
.hero{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:24px;align-items:center}
@media (max-width:760px){.hero{grid-template-columns:1fr}.coins{max-width:280px}}
.hero-text{display:flex;flex-direction:column;gap:18px;min-width:0}
.coins{width:100%;height:auto;display:block}
.tag{font-family:var(--display);font-weight:600;letter-spacing:.06em;text-transform:uppercase;font-size:.9rem;color:var(--violet)}
.lines{display:flex;flex-wrap:wrap;gap:10px}
.line-chip{display:inline-flex;align-items:center;gap:8px;font-family:var(--display);font-weight:600;font-size:1rem;padding:6px 14px;border-radius:999px;background:var(--surface);border:2px solid var(--c)}
.line-chip i{width:12px;height:12px;border-radius:50%;background:var(--c)}
figure{margin:0}
.diagram{border-radius:22px;padding:16px;overflow-x:auto}
.diagram svg{display:block;width:100%;height:auto}
figcaption{margin-top:10px;color:var(--muted);font-size:1rem;max-width:70ch}
.wide{display:block}.tall{display:none}
@media (max-width:700px){.wide{display:none}.tall{display:block}.tall svg{max-width:400px;margin:0 auto}}
.ico{width:36px;height:36px;flex:none}
.cols3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
@media (max-width:820px){.cols3{grid-template-columns:1fr}}
.acard{border-radius:18px;padding:18px;display:flex;gap:14px;align-items:flex-start;min-width:0}
.acard p{font-size:1.05rem}
.acard b{font-family:var(--display);font-weight:600;font-size:1.2rem;display:block;margin-bottom:2px}
.soft-sites{background:var(--sites-soft)}
.chain{border-radius:26px;padding:24px;display:grid;grid-template-columns:auto 1fr;gap:24px;align-items:center}
@media (max-width:700px){.chain{grid-template-columns:1fr}}
.chain .coin1{width:120px;height:120px}
.chain ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:14px 24px}
@media (max-width:560px){.chain ul{grid-template-columns:1fr}}
.chain li{display:flex;gap:12px;align-items:flex-start;min-width:0}
.chain li i{flex:none;width:30px;height:30px;border-radius:50%;background:linear-gradient(145deg,var(--violet-2),var(--violet));display:grid;place-items:center;color:#fff;font-style:normal;font-family:var(--display);font-weight:700;font-size:.95rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.55)}
.chain b{font-family:var(--display);font-weight:600;font-size:1.15rem;display:block}
.chain span{color:var(--muted);font-size:1.02rem;line-height:1.45}
.groups{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
@media (max-width:760px){.groups{grid-template-columns:1fr}}
.group{background:var(--surface);border-radius:20px;padding:18px 18px 8px;border-top:8px solid var(--c);min-width:0}
.group h3{margin-bottom:6px}
.site{display:flex;gap:12px;align-items:flex-start;padding:10px 0;border-top:1px solid var(--rule)}
.site:first-of-type{border-top:0}
.site .dot{flex:none;width:14px;height:14px;margin-top:7px;border-radius:50%;background:var(--c)}
.site b{font-family:var(--display);font-weight:600;font-size:1.15rem}
.site span{display:block;color:var(--muted);font-size:1.02rem;line-height:1.45}
.site .soon{display:inline-block;font-family:var(--display);font-size:.8rem;font-weight:600;letter-spacing:.05em;text-transform:uppercase;padding:2px 8px;border-radius:999px;background:var(--violet-soft);color:var(--ink);margin-left:6px;vertical-align:2px}
.steps{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,1fr);gap:14px;counter-reset:s}
@media (max-width:900px){.steps{grid-template-columns:1fr}}
.steps li{background:var(--surface);border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:8px;min-width:0;counter-increment:s}
.steps li::before{content:counter(s);font-family:var(--display);font-weight:700;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--traffic);color:var(--on-color)}
.steps b{font-family:var(--display);font-weight:600;font-size:1.15rem;line-height:1.25}
.steps span{font-size:1rem;color:var(--muted);line-height:1.45}
.walls{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
@media (max-width:900px){.walls{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.walls{grid-template-columns:1fr}}
.wall{background:var(--surface);border-radius:16px;padding:14px 16px;display:flex;flex-direction:column;gap:4px;min-width:0;border-left:6px solid var(--violet)}
.wall b{font-family:var(--display);font-weight:600;font-size:1.12rem}
.wall span{font-size:1rem;color:var(--muted);line-height:1.4}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:620px){.stats{grid-template-columns:1fr}}
.stat{border-radius:20px;padding:18px 20px;display:flex;flex-direction:column;gap:4px;min-width:0}
.stat .num{font-family:var(--display);font-weight:700;font-size:2.4rem;line-height:1.05;color:var(--violet);font-variant-numeric:tabular-nums}
.stat span{color:var(--muted);font-size:1rem}
.example{background:var(--surface);border-radius:20px;padding:20px;display:flex;flex-direction:column;gap:16px}
.example-top{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:baseline}
.big{font-family:var(--display);font-weight:700;font-size:2.6rem;line-height:1}
.bar{display:flex;height:64px;border-radius:14px;overflow:hidden;font-family:var(--display);font-weight:700;font-size:1.15rem}
.bar div{display:grid;place-items:center;color:var(--bar-ink);min-width:0}
.legend{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
@media (max-width:760px){.legend{grid-template-columns:1fr 1fr}}
.legend li{display:flex;gap:10px;align-items:flex-start;font-size:1rem;line-height:1.4;min-width:0}
.legend i{flex:none;width:18px;height:18px;border-radius:5px;margin-top:3px}
.legend b{display:block;font-family:var(--display);font-weight:600;font-size:1.15rem;font-variant-numeric:tabular-nums}
.note{font-size:1rem;color:var(--muted);max-width:70ch}
.earn{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
@media (max-width:900px){.earn{grid-template-columns:1fr 1fr}}
@media (max-width:560px){.earn{grid-template-columns:1fr}}
.ecard{border-radius:18px;padding:16px 18px;display:flex;flex-direction:column;gap:6px;min-width:0}
.ecard .site-name{font-family:var(--display);font-weight:600;font-size:.9rem;letter-spacing:.05em;text-transform:uppercase;color:var(--violet)}
.ecard b{font-family:var(--display);font-weight:600;font-size:1.18rem;line-height:1.25}
.ecard p{font-size:1rem;color:var(--muted);line-height:1.45}
.ecard.credits{border-style:dashed}
.nowd{border-radius:24px;padding:22px 24px;display:grid;grid-template-columns:auto 1fr;gap:20px;align-items:start}
@media (max-width:620px){.nowd{grid-template-columns:1fr}}
.nowd svg{width:72px;height:72px}
.nowd h3{font-size:clamp(1.4rem,3vw,1.8rem);font-weight:800;margin-bottom:6px}
.nowd .lead{font-size:1.15rem;margin-bottom:14px}
.nowd ul{list-style:none;margin:0 0 12px;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:12px 20px}
@media (max-width:760px){.nowd ul{grid-template-columns:1fr}}
.nowd li b{display:block;font-family:var(--display);font-weight:700;font-size:1.1rem}
.nowd li span{color:var(--muted);font-size:1rem;line-height:1.45}
.nowd small{display:block;color:var(--muted);font-size:.9rem;line-height:1.45}
.promise{border-radius:18px;padding:16px 20px;background:var(--trust-soft);font-family:var(--display);font-weight:600;font-size:1.25rem;line-height:1.35}
.promise span{display:block;font-family:var(--body);font-weight:400;font-size:1rem;color:var(--muted);margin-top:4px}
.trust{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media (max-width:900px){.trust{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.trust{grid-template-columns:1fr}}
.tcard{background:var(--trust-soft);border-radius:18px;padding:18px;display:flex;flex-direction:column;gap:8px;min-width:0}
.tcard b{font-family:var(--display);font-weight:600;font-size:1.2rem}
.tcard p{font-size:1.02rem;line-height:1.45}
.start{background:var(--go-soft);border:3px solid var(--go);border-radius:24px;padding:24px;display:flex;flex-direction:column;gap:18px}
.start ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:16px;counter-reset:g}
@media (max-width:760px){.start ol{grid-template-columns:1fr}}
.start li{counter-increment:g;display:flex;gap:12px;align-items:flex-start;min-width:0}
.start li::before{content:counter(g);flex:none;font-family:var(--display);font-weight:700;font-size:1.3rem;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:var(--go);color:var(--on-color)}
.start b{font-family:var(--display);font-weight:600;font-size:1.25rem;display:block}
.fine{border-top:2px solid var(--rule);padding-top:20px;display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:1rem}
.fine strong{color:var(--ink)}
svg text{font-family:var(--display)}
h1,h2,h3,b,svg text,.tag,.line-chip,.site-name,.num,.big,.bar,.stop{font-feature-settings:"calt" 0;font-variant-ligatures:no-contextual}
</style>
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
<defs>
<symbol id="i-key" viewBox="0 0 24 24"><circle cx="8" cy="12" r="4.5" fill="none" stroke="currentColor" stroke-width="2.2"/><path d="M12.5 12H21M18 12v3.5M21 12v2.5" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></symbol>
<symbol id="i-person" viewBox="0 0 24 24"><circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2.2"/><path d="M4 21c1.2-4.2 4.3-6 8-6s6.8 1.8 8 6" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></symbol>
<symbol id="i-team" viewBox="0 0 24 24"><circle cx="8" cy="9" r="3.2" fill="none" stroke="currentColor" stroke-width="2"/><circle cx="16.5" cy="9" r="3.2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M2.5 20c.8-3.4 3-5 5.5-5s4.7 1.6 5.5 5M11 20c.8-3.4 3-5 5.5-5s4.7 1.6 5.5 5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></symbol>
<linearGradient id="g-coin" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#C9A8FF"/><stop offset=".55" stop-color="#8247E5"/><stop offset="1" stop-color="#4B1FA8"/></linearGradient>
<linearGradient id="g-shine" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#FFFFFF" stop-opacity=".75"/><stop offset="1" stop-color="#FFFFFF" stop-opacity="0"/></linearGradient>
<symbol id="coin" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="46" fill="url(#g-coin)" opacity=".92"/>
<circle cx="50" cy="50" r="46" fill="none" stroke="#FFFFFF" stroke-opacity=".55" stroke-width="2"/>
<circle cx="50" cy="50" r="34" fill="none" stroke="#FFFFFF" stroke-opacity=".45" stroke-width="2"/>
<path d="M20 34C30 14 70 14 80 34C64 26 36 26 20 34z" fill="url(#g-shine)"/>
<text x="50" y="58" text-anchor="middle" font-family="Plus Jakarta Sans,Segoe UI,sans-serif" font-weight="800" font-size="22" fill="#FFFFFF">POL</text>
</symbol>
</defs>
</svg>
<main class="wrap">
<header class="hero">
<div class="hero-text">
<p class="tag">A one-page guide for new members</p>
<h1>How the Crypto Team Build Network Works</h1>
<p class="lede">It is a group of websites that work as one team. People share links, visitors see ads, and when someone buys ads, the payment is split on the spot.</p>
<div class="lines" aria-label="The parts of this page">
<span class="line-chip" style="--c:var(--sites)"><i></i>One account</span>
<span class="line-chip" style="--c:var(--violet)"><i></i>Polygon</span>
<span class="line-chip" style="--c:var(--traffic)"><i></i>Traffic</span>
<span class="line-chip" style="--c:var(--money)"><i></i>Money</span>
<span class="line-chip" style="--c:var(--trust)"><i></i>Trust</span>
</div>
</div>
<svg class="coins" viewBox="0 0 300 260" role="img" aria-label="Three violet glass POL coins">
<use href="#coin" x="120" y="10" width="160" height="160"/>
<use href="#coin" x="20" y="96" width="120" height="120"/>
<use href="#coin" x="160" y="160" width="90" height="90"/>
</svg>
</header>
<section class="sec" aria-labelledby="big">
<h2 id="big">The whole network in one picture</h2>
<figure>
<div class="diagram glass wide">
<svg viewBox="0 60 1040 300" role="img" aria-label="A shared link is clicked, LinkSpin counts the click and sends the visitor to a network site, the visitor sees ads and may buy ads in POL, and a public contract splits that payment between the sponsor line and the company.">
<defs>
<marker id="aw" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="13" markerHeight="13" orient="auto-start-reverse"><path d="M0 0L10 5L0 10z" fill="var(--violet)"/></marker>
<marker id="aws" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="13" markerHeight="13" orient="auto"><path d="M0 0L10 5L0 10z" fill="var(--sites)"/></marker>
</defs>
<g fill="none" stroke-width="10" stroke-linecap="round">
<path d="M70 145H270" stroke="var(--traffic)"/>
<path d="M270 145H470" stroke="var(--sites)"/>
<path d="M470 145H840" stroke="var(--violet)"/>
</g>
<g font-size="15" fill="var(--muted)" text-anchor="middle" font-weight="600">
<text x="170" y="104">click</text>
<text x="370" y="82">sends to</text><text x="370" y="104">the right page</text>
<text x="570" y="82">buys ads</text><text x="570" y="104">in POL</text>
<text x="755" y="82">split in</text><text x="755" y="104">one payment</text>
</g>
<g stroke-width="6">
<circle cx="70" cy="145" r="30" fill="var(--surface)" stroke="var(--traffic)"/>
<circle cx="270" cy="145" r="30" fill="var(--surface)" stroke="var(--traffic)"/>
<circle cx="470" cy="145" r="30" fill="var(--surface)" stroke="var(--sites)"/>
<circle cx="670" cy="145" r="30" fill="var(--surface)" stroke="var(--violet)"/>
</g>
<use href="#coin" x="802" y="107" width="76" height="76"/>
<g font-size="24" font-weight="700" text-anchor="middle" fill="var(--ink)">
<text x="70" y="153">1</text><text x="270" y="153">2</text><text x="470" y="153">3</text><text x="670" y="153">4</text>
</g>
<g font-size="19" font-weight="700" text-anchor="middle" fill="var(--ink)">
<text x="70" y="212">You share</text>
<text x="270" y="212">LinkSpin</text>
<text x="470" y="212">Network site</text>
<text x="670" y="212">A buyer</text>
<text x="840" y="212">Smart contract</text>
</g>
<g font-size="15" text-anchor="middle" fill="var(--muted)">
<text x="70" y="236">your tracked link</text>
<text x="270" y="236">counts every click</text>
<text x="470" y="236">sees ads, joins free</text>
<text x="670" y="236">package, Boost,</text><text x="670" y="255">spot or upgrade</text>
<text x="840" y="236">public, on Polygon</text>
</g>
<g fill="none" stroke="var(--violet)" stroke-width="4" color="var(--violet)">
<path d="M840 252V340"/>
<path d="M840 296H868" marker-end="url(#aw)"/>
<path d="M840 340H868" marker-end="url(#aw)"/>
</g>
<g font-size="15" font-weight="700" fill="var(--ink)">
<text x="876" y="301">Sponsor line</text>
<text x="876" y="345">Company</text>
</g>
<g fill="none" stroke="var(--sites)" stroke-width="3" stroke-dasharray="7 7" color="var(--sites)">
<path d="M660 272C640 318 500 318 480 274" marker-end="url(#aws)"/>
</g>
<text x="570" y="338" font-size="15" text-anchor="middle" fill="var(--muted)" font-weight="600">their ads show to visitors</text>
</svg>
</div>
<div class="diagram glass tall">
<svg viewBox="0 0 360 720" role="img" aria-label="A shared link is clicked, LinkSpin counts the click and sends the visitor to a network site, the visitor sees ads and may buy ads in POL, and a public contract splits that payment between the sponsor line and the company.">
<defs>
<marker id="aw2" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="13" markerHeight="13" orient="auto"><path d="M0 0L10 5L0 10z" fill="var(--violet)"/></marker>
</defs>
<g fill="none" stroke-width="10" stroke-linecap="round">
<path d="M60 50V190" stroke="var(--traffic)"/>
<path d="M60 190V330" stroke="var(--sites)"/>
<path d="M60 330V610" stroke="var(--violet)"/>
</g>
<g font-size="13" fill="var(--muted)" font-weight="600">
<text x="80" y="125">click</text>
<text x="80" y="265">sends to the right page</text>
<text x="80" y="405">buys ads in POL</text>
<text x="80" y="545">split in one payment</text>
</g>
<g stroke-width="6">
<circle cx="60" cy="50" r="28" fill="var(--surface)" stroke="var(--traffic)"/>
<circle cx="60" cy="190" r="28" fill="var(--surface)" stroke="var(--traffic)"/>
<circle cx="60" cy="330" r="28" fill="var(--surface)" stroke="var(--sites)"/>
<circle cx="60" cy="470" r="28" fill="var(--surface)" stroke="var(--violet)"/>
</g>
<use href="#coin" x="30" y="580" width="60" height="60"/>
<g font-size="22" font-weight="700" text-anchor="middle" fill="var(--ink)">
<text x="60" y="58">1</text><text x="60" y="198">2</text><text x="60" y="338">3</text><text x="60" y="478">4</text>
</g>
<g font-size="18" font-weight="700" fill="var(--ink)">
<text x="104" y="46">You share</text>
<text x="104" y="186">LinkSpin</text>
<text x="104" y="326">Network site</text>
<text x="104" y="466">A buyer</text>
<text x="104" y="606">Smart contract</text>
</g>
<g font-size="14" fill="var(--muted)">
<text x="104" y="68">your tracked link</text>
<text x="104" y="208">counts every click</text>
<text x="104" y="348">visitor sees ads, joins free</text>
<text x="104" y="488">package, Boost, spot, upgrade</text>
<text x="104" y="628">public, on Polygon</text>
</g>
<g stroke="var(--violet)" stroke-width="4" fill="none" color="var(--violet)">
<path d="M60 642V672H104" marker-end="url(#aw2)"/>
<path d="M60 672V700H104" marker-end="url(#aw2)"/>
</g>
<g font-size="15" font-weight="700" fill="var(--ink)">
<text x="112" y="677">Sponsor line wallets</text>
<text x="112" y="705">Company</text>
</g>
</svg>
</div>
<figcaption>Follow the colors. Orange is traffic, blue is the sites, purple is money on Polygon. A visit can turn into a sign-up, and a sign-up can turn into an ad purchase that pays the people who helped.</figcaption>
</figure>
</section>
<section class="sec" aria-labelledby="s1" style="--c:var(--sites)">
<div class="sec-head"><span class="stop">1</span><h2 id="s1">One account, many sites</h2></div>
<p class="intro">You do not need a new account for every site. Think of it like one library card that works at every branch.</p>
<div class="cols3">
<div class="acard soft-sites"><svg class="ico" style="color:var(--sites)"><use href="#i-key"/></svg><p><b>Sign in once</b>Use your InstantAdPay or LinkSpin account. The other network sites let you in with it.</p></div>
<div class="acard soft-sites"><svg class="ico" style="color:var(--sites)"><use href="#i-person"/></svg><p><b>It is free</b>Joining costs nothing. You only pay if you choose to buy ads.</p></div>
<div class="acard soft-sites"><svg class="ico" style="color:var(--sites)"><use href="#i-team"/></svg><p><b>Your sponsor follows you</b>The person who invited you stays your sponsor on every site. Your team does too.</p></div>
</div>
</section>
<section class="sec" aria-labelledby="s2" style="--c:var(--violet)">
<div class="sec-head"><span class="stop">2</span><h2 id="s2">Everything runs on Polygon</h2></div>
<p class="intro">Polygon is a blockchain: a public record book that thousands of computers keep together. Its coin is called POL. Every network site uses the same one.</p>
<div class="chain glass">
<svg class="coin1" viewBox="0 0 100 100" role="img" aria-label="A POL coin"><use href="#coin" width="100" height="100"/></svg>
<ul>
<li><i>1</i><div><b>One wallet works everywhere</b><span>Link the same wallet once. Every site pays to it.</span></div></li>
<li><i>2</i><div><b>Every site pays in POL</b><span>Same coin, same chain, on every site.</span></div></li>
<li><i>3</i><div><b>Fast with tiny fees</b><span>A payment settles in seconds, and the network fee is very small.</span></div></li>
<li><i>4</i><div><b>You can check every payment</b><span>Look any payment up on Polygonscan, the public search page for Polygon.</span></div></li>
</ul>
</div>
</section>
<section class="sec" aria-labelledby="s3" style="--c:var(--sites)">
<div class="sec-head"><span class="stop">3</span><h2 id="s3">The sites on the map</h2></div>
<p class="intro">Each site does one job. Together they bring in visitors, show ads and help people build a team.</p>
<div class="groups">
<div class="group" style="--c:var(--sites)">
<h3>Start here</h3>
<div class="site"><i class="dot"></i><div><b>InstantAdPay</b><span>Buy ad packages. When people on your team buy, you can earn a share.</span></div></div>
<div class="site"><i class="dot"></i><div><b>LinkSpin</b><span>A free link that rotates your pages, counts real clicks and blocks bots. Free pages and ad zones too.</span></div></div>
<div class="site"><i class="dot"></i><div><b>DownlineHydra</b><span>Join once and you are in the whole network, with one sponsor line through every site.</span></div></div>
</div>
<div class="group" style="--c:var(--traffic)">
<h3>Ads that spread</h3>
<div class="site"><i class="dot" style="background:var(--traffic)"></i><div><b>Downline Banners</b><span>Buy a banner spot in one long line. Your banner shows on the pages in your line.</span></div></div>
<div class="site"><i class="dot" style="background:var(--traffic)"></i><div><b>Viral Banner Blitz</b><span>Small banners in a shared loop. Every real visitor moves the loop forward.</span></div></div>
<div class="site"><i class="dot" style="background:var(--traffic)"></i><div><b>ViralAdBlitz</b><span>A free text ad that shows on your team's pages, five levels down.</span></div></div>
<div class="site"><i class="dot" style="background:var(--traffic)"></i><div><b>ViralAdSource</b><span>Post a free text ad. Others reshare it, and you watch how far it travels.</span></div></div>
</div>
<div class="group" style="--c:var(--go)">
<h3>Team builders</h3>
<div class="site"><i class="dot" style="background:var(--go)"></i><div><b>5xYourTeam</b><span>A weekly draft. Coaches pick new members who joined without a sponsor and help them start.</span></div></div>
<div class="site"><i class="dot" style="background:var(--go)"></i><div><b>YourProgramBuilder</b><i class="soon">New</i><span>The Seed Bed: plant a program, members save their IDs, and the best ones join the Crypto Team Build Network builder.</span></div></div>
<div class="site"><i class="dot" style="background:var(--go)"></i><div><b>CryptoTeamBuild</b><i class="soon">Coming Dec 15</i><span>The network's team builder, rebuilt on the same rails.</span></div></div>
</div>
<div class="group" style="--c:var(--violet)">
<h3>See, talk and play</h3>
<div class="site"><i class="dot" style="background:var(--violet)"></i><div><b>Stack POL</b><span>Shows payouts across the network, each one you can check yourself.</span></div></div>
<div class="site"><i class="dot" style="background:var(--violet)"></i><div><b>Earners Corner</b><span>A friendly forum to ask questions and talk with other members.</span></div></div>
<div class="site"><i class="dot" style="background:var(--violet)"></i><div><b>PolHunter</b><span>Missions: visit a site, find the code, get a small drip of POL to your wallet.</span></div></div>
<div class="site"><i class="dot" style="background:var(--violet)"></i><div><b>The games</b><span>Free games you sign in to with your InstantAdPay account.</span></div></div>
</div>
</div>
</section>
<section class="sec" aria-labelledby="s4" style="--c:var(--traffic)">
<div class="sec-head"><span class="stop">4</span><h2 id="s4">How visitors travel</h2></div>
<p class="intro">Traffic means people visiting a website. Here is the path a visitor takes.</p>
<ol class="steps">
<li><b>Members share links</b><span>In mailers, safelists, traffic exchanges, social sites, Telegram and Massifly.</span></li>
<li><b>LinkSpin counts the click</b><span>Every click is counted, bots are dropped, and the visitor goes to the right page.</span></li>
<li><b>Visitors land on a network site</b><span>They look around and can join free. Whoever shared the link becomes their sponsor.</span></li>
<li><b>They hop to other sites</b><span>PolHunter missions and the links between sites send people from one site to the next.</span></li>
<li><b>Ads get seen</b><span>Network pages carry ad spots, so each visit puts ads in front of real people.</span></li>
</ol>
</section>
<section class="sec" aria-labelledby="s5" style="--c:var(--traffic)">
<div class="sec-head"><span class="stop">5</span><h2 id="s5">Where your ad shows up</h2></div>
<p class="intro">Your ad is like a poster. These are all the walls it can hang on. When you buy ads on InstantAdPay, they can run on the network's own sites and also go out to partner places.</p>
<figure>
<div class="diagram glass wide">
<svg viewBox="0 0 1000 380" role="img" aria-label="An ad bought on InstantAdPay is sent out to the network sites, Network Ad Space, DripOffers, AdRevLinks, LinkSpin ad zones, the EnjoyBestGames arcade, and pages that PolHunter missions send hunters to.">
<defs>
<marker id="aw3" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="13" markerHeight="13" orient="auto"><path d="M0 0L10 5L0 10z" fill="var(--violet)"/></marker>
</defs>
<rect x="40" y="130" width="230" height="120" rx="18" fill="var(--violet-soft)" stroke="var(--violet)" stroke-width="3"/>
<rect x="64" y="150" width="56" height="78" rx="6" fill="var(--surface)" stroke="var(--violet)" stroke-width="2.5"/>
<path d="M74 166h36M74 178h36M74 190h24" stroke="var(--violet)" stroke-width="3" stroke-linecap="round"/>
<text x="136" y="182" font-size="21" font-weight="700" fill="var(--ink)">Your ad</text>
<text x="136" y="206" font-size="14" fill="var(--muted)">bought on</text>
<text x="136" y="224" font-size="14" fill="var(--muted)">InstantAdPay</text>
<g fill="none" stroke="var(--violet)" stroke-width="3" color="var(--violet)">
<path d="M270 190C330 190 330 40 452 40" marker-end="url(#aw3)"/>
<path d="M270 190C340 190 340 115 452 115" marker-end="url(#aw3)"/>
<path d="M270 190H452" marker-end="url(#aw3)"/>
<path d="M270 190C340 190 340 265 452 265" marker-end="url(#aw3)"/>
<path d="M270 190C330 190 330 340 452 340" marker-end="url(#aw3)"/>
</g>
<g font-size="18" font-weight="700" fill="var(--ink)">
<text x="462" y="38">Network sites</text>
<text x="462" y="113">Network Ad Space</text>
<text x="462" y="188">DripOffers</text>
<text x="462" y="263">AdRevLinks</text>
<text x="462" y="338">LinkSpin ad zones</text>
</g>
<g font-size="14" fill="var(--muted)">
<text x="462" y="58">shown to members across the network</text>
<text x="462" y="133">banner spots on many network and partner sites</text>
<text x="462" y="208">offer walls inside other people's paid-to-click sites</text>
<text x="462" y="283">people shorten links, visitors see ads on the way</text>
<text x="462" y="358">ad spaces members put on their own pages</text>
</g>
<g font-size="13" font-weight="700" fill="var(--violet)" text-anchor="end">
<text x="985" y="113">counts views</text>
<text x="985" y="188">counts clicks</text>
<text x="985" y="263">counts views</text>
</g>
</svg>
</div>
<div class="diagram glass tall">
<svg viewBox="0 0 360 560" role="img" aria-label="An ad bought on InstantAdPay is sent out to the network sites, Network Ad Space, DripOffers, AdRevLinks and LinkSpin ad zones.">
<defs>
<marker id="aw4" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="13" markerHeight="13" orient="auto"><path d="M0 0L10 5L0 10z" fill="var(--violet)"/></marker>
</defs>
<rect x="10" y="10" width="340" height="80" rx="16" fill="var(--violet-soft)" stroke="var(--violet)" stroke-width="3"/>
<rect x="26" y="22" width="40" height="56" rx="5" fill="var(--surface)" stroke="var(--violet)" stroke-width="2.5"/>
<path d="M33 34h26M33 44h26M33 54h17" stroke="var(--violet)" stroke-width="3" stroke-linecap="round"/>
<text x="80" y="46" font-size="20" font-weight="700" fill="var(--ink)">Your ad</text>
<text x="80" y="68" font-size="14" fill="var(--muted)">bought on InstantAdPay</text>
<path d="M40 90V510" stroke="var(--violet)" stroke-width="4" fill="none"/>
<g stroke="var(--violet)" stroke-width="3" fill="none" color="var(--violet)">
<path d="M40 140H70" marker-end="url(#aw4)"/>
<path d="M40 230H70" marker-end="url(#aw4)"/>
<path d="M40 320H70" marker-end="url(#aw4)"/>
<path d="M40 410H70" marker-end="url(#aw4)"/>
<path d="M40 500H70" marker-end="url(#aw4)"/>
</g>
<g font-size="17" font-weight="700" fill="var(--ink)">
<text x="80" y="140">Network sites</text>
<text x="80" y="230">Network Ad Space</text>
<text x="80" y="320">DripOffers</text>
<text x="80" y="410">AdRevLinks</text>
<text x="80" y="500">LinkSpin ad zones</text>
</g>
<g font-size="13" fill="var(--muted)">
<text x="80" y="160">shown to members</text>
<text x="80" y="250">banner spots on many sites</text>
<text x="80" y="340">offer walls on paid-to-click sites</text>
<text x="80" y="430">ads seen while links open</text>
<text x="80" y="520">ad spaces on member pages</text>
</g>
</svg>
</div>
<figcaption>Each wall counts what really happened, a real view or a real click, before your credits are used.</figcaption>
</figure>
<h3>More walls where people see the network</h3>
<div class="walls">
<div class="wall"><b>PolHunter missions</b><span>Hunters visit sites to find a code, so they look at the pages, ads included.</span></div>
<div class="wall"><b>EnjoyBestGames</b><span>A free game arcade with a network ad spot and links to our games.</span></div>
<div class="wall"><b>MyLnks and Mail Splat</b><span>A link shortener and a temporary email site, both PolHunter mission stops.</span></div>
<div class="wall"><b>Where members share</b><span>Traffic exchanges, mailers, safelists, social sites and Telegram.</span></div>
</div>
<div class="stats">
<div class="stat glass"><span class="num">About 2 million</span><span>ad views shown by Network Ad Space in one month (August 2026)</span></div>
<div class="stat glass"><span class="num">About 32,000</span><span>people on the network's member lists, counted November 12, 2026</span></div>
</div>
</section>
<section class="sec" aria-labelledby="s6" style="--c:var(--money)">
<div class="sec-head"><span class="stop">6</span><h2 id="s6">How the money moves</h2></div>
<p class="intro">Money comes in when someone buys advertising: an ad package, a Boost, a banner spot or an upgrade. They pay in POL. A public smart contract (a program on the blockchain that anyone can read) splits the payment right away. The shares go straight to wallets in that same payment.</p>
<div class="example">
<div class="example-top"><span class="big">$20</span><h3>Example: one InstantAdPay package</h3></div>
<p class="note">The buyer gets 2,000 ad credits. Here is where their $20 of POL goes, in the same payment.</p>
<div class="bar" role="img" aria-label="$10 to the direct sponsor, $4 to level 2, $2 to level 3, $4 to the company">
<div style="flex:50;background:var(--money)">$10</div>
<div style="flex:20;background:var(--traffic)">$4</div>
<div style="flex:10;background:var(--sites)">$2</div>
<div style="flex:20;background:var(--violet-2)">$4</div>
</div>
<ul class="legend">
<li><i style="background:var(--money)"></i><div><b>$10 · 50%</b>The direct sponsor, the person who invited the buyer.</div></li>
<li><i style="background:var(--traffic)"></i><div><b>$4 · 20%</b>Level 2, the sponsor's sponsor.</div></li>
<li><i style="background:var(--sites)"></i><div><b>$2 · 10%</b>Level 3, one more step up.</div></li>
<li><i style="background:var(--violet-2)"></i><div><b>$4 · 20%</b>The company, in two wallets of $2.</div></li>
</ul>
<p class="note">Levels 2 and 3 are unlocked by inviting people who buy. If someone has not unlocked a level yet, that share moves up the line to the next person who has. These rules are written into the contract, and no one can change them.</p>
</div>
<p class="note">Other sites have their own split, shown on each site's "Is it legit?" guide. The idea is the same everywhere: money in, money out, in one payment.</p>
</section>
<section class="sec" aria-labelledby="s7" style="--c:var(--violet)">
<div class="sec-head"><span class="stop">7</span><h2 id="s7">Ways you can earn</h2></div>
<p class="intro">There is more than one way to earn in the network. Most of them pay when someone you brought in buys something. Each one has its own rules on its site.</p>
<figure>
<div class="diagram glass wide">
<svg viewBox="0 0 1040 540" role="img" aria-label="Eleven network sites each send their own kind of payment, such as sponsor shares, level shares, resharer cuts, hunt rewards and prizes, into one member wallet on Polygon.">
<defs>
<marker id="awm" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><path d="M0 0L10 5L0 10z" fill="var(--violet)"/></marker>
</defs>
<g fill="none" stroke="var(--violet)" stroke-width="2.5" stroke-opacity=".75">
<path d="M470 40C640 40 640 270 770 270"/>
<path d="M470 86C640 86 640 270 770 270"/>
<path d="M470 132C640 132 640 270 770 270"/>
<path d="M470 178C640 178 640 270 770 270"/>
<path d="M470 224C640 224 640 270 770 270"/>
<path d="M470 270C640 270 640 270 770 270"/>
<path d="M470 316C640 316 640 270 770 270"/>
<path d="M470 362C640 362 640 270 770 270"/>
<path d="M470 408C640 408 640 270 770 270"/>
<path d="M470 454C640 454 640 270 770 270"/>
<path d="M470 500C640 500 640 270 770 270"/>
</g>
<path d="M770 270H806" stroke="var(--violet)" stroke-width="5" fill="none" marker-end="url(#awm)"/>
<rect x="200" y="26" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="72" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="118" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="164" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="210" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="256" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="302" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="348" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="394" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="440" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<rect x="200" y="486" width="270" height="28" rx="14" fill="var(--violet-soft)"/>
<g font-size="16" font-weight="700" fill="var(--ink)">
<text x="20" y="46">InstantAdPay</text>
<text x="20" y="92">LinkSpin</text>
<text x="20" y="138">Downline Banners</text>
<text x="20" y="184">Viral Banner Blitz</text>
<text x="20" y="230">ViralAdBlitz</text>
<text x="20" y="276">ViralAdSource</text>
<text x="20" y="322">DownlineHydra</text>
<text x="20" y="368">5xYourTeam</text>
<text x="20" y="414">YourProgramBuilder</text>
<text x="20" y="460">PolHunter</text>
<text x="20" y="506">The games</text>
</g>
<g font-size="13" font-weight="600" fill="var(--ink)" text-anchor="middle">
<text x="335" y="45">sponsor + level shares</text>
<text x="335" y="91">sponsor + level shares</text>
<text x="335" y="137">sponsor share + spot shares</text>
<text x="335" y="183">sponsor share + weekly prizes</text>
<text x="335" y="229">level shares</text>
<text x="335" y="275">resharer cut + level shares</text>
<text x="335" y="321">sponsor + level shares</text>
<text x="335" y="367">level shares + Best Coach prize</text>
<text x="335" y="413">sponsor + level shares</text>
<text x="335" y="459">hunt rewards + prizes</text>
<text x="335" y="505">game rewards</text>
</g>
<rect x="816" y="170" width="200" height="200" rx="28" fill="var(--violet-soft)" stroke="var(--violet)" stroke-width="3"/>
<rect x="816" y="170" width="200" height="56" rx="28" fill="var(--violet)" fill-opacity=".14"/>
<use href="#coin" x="866" y="200" width="100" height="100"/>
<text x="916" y="330" font-size="19" font-weight="800" text-anchor="middle" fill="var(--ink)">Your wallet</text>
<text x="916" y="352" font-size="13" text-anchor="middle" fill="var(--muted)">one wallet on Polygon</text>
</svg>
</div>
<div class="diagram glass tall">
<svg viewBox="0 0 360 750" role="img" aria-label="Eleven network sites each send their own kind of payment into one member wallet on Polygon.">
<defs>
<marker id="awm2" viewBox="0 0 10 10" refX="8" refY="5" markerUnits="userSpaceOnUse" markerWidth="14" markerHeight="14" orient="auto"><path d="M0 0L10 5L0 10z" fill="var(--violet)"/></marker>
</defs>
<g fill="none" stroke="var(--violet)" stroke-width="2.5" stroke-opacity=".75">
<path d="M224 33H330" stroke-dasharray="4 5"/>
<path d="M224 81H330" stroke-dasharray="4 5"/>
<path d="M224 129H330" stroke-dasharray="4 5"/>
<path d="M224 177H330" stroke-dasharray="4 5"/>
<path d="M224 225H330" stroke-dasharray="4 5"/>
<path d="M224 273H330" stroke-dasharray="4 5"/>
<path d="M224 321H330" stroke-dasharray="4 5"/>
<path d="M224 369H330" stroke-dasharray="4 5"/>
<path d="M224 417H330" stroke-dasharray="4 5"/>
<path d="M224 465H330" stroke-dasharray="4 5"/>
<path d="M224 513H330" stroke-dasharray="4 5"/>
</g>
<path d="M330 30V586H262" stroke="var(--violet)" stroke-width="4" fill="none" stroke-linejoin="round" marker-end="url(#awm2)"/>
<g font-size="15" font-weight="700" fill="var(--ink)">
<text x="16" y="35">InstantAdPay</text>
<text x="16" y="83">LinkSpin</text>
<text x="16" y="131">Downline Banners</text>
<text x="16" y="179">Viral Banner Blitz</text>
<text x="16" y="227">ViralAdBlitz</text>
<text x="16" y="275">ViralAdSource</text>
<text x="16" y="323">DownlineHydra</text>
<text x="16" y="371">5xYourTeam</text>
<text x="16" y="419">YourProgramBuilder</text>
<text x="16" y="467">PolHunter</text>
<text x="16" y="515">The games</text>
</g>
<g font-size="12.5" fill="var(--muted)">
<text x="16" y="53">sponsor + level shares</text>
<text x="16" y="101">sponsor + level shares</text>
<text x="16" y="149">sponsor share + spot shares</text>
<text x="16" y="197">sponsor share + weekly prizes</text>
<text x="16" y="245">level shares</text>
<text x="16" y="293">resharer cut + level shares</text>
<text x="16" y="341">sponsor + level shares</text>
<text x="16" y="389">level shares + Best Coach prize</text>
<text x="16" y="437">sponsor + level shares</text>
<text x="16" y="485">hunt rewards + prizes</text>
<text x="16" y="533">game rewards</text>
</g>
<rect x="60" y="560" width="190" height="170" rx="26" fill="var(--violet-soft)" stroke="var(--violet)" stroke-width="3"/>
<use href="#coin" x="115" y="574" width="80" height="80"/>
<text x="155" y="686" font-size="18" font-weight="800" text-anchor="middle" fill="var(--ink)">Your wallet</text>
<text x="155" y="707" font-size="12.5" text-anchor="middle" fill="var(--muted)">one wallet on Polygon</text>
</svg>
</div>
<figcaption>Every arrow is a separate on-chain payment you can check on Polygonscan. This is an example of the kinds of payments, not a promise of any. Ad credits stay on your account and are not shown here.</figcaption>
</figure>
<div class="nowd glass">
<svg viewBox="0 0 100 100" role="img" aria-label="A POL coin"><use href="#coin" width="100" height="100"/></svg>
<div>
<h3>No withdrawal requests. Ever.</h3>
<p class="lead">You never ask anyone to pay you. When you earn, the POL goes to your wallet by itself.</p>
<ul>
<li><b>Shares from sales</b><span>InstantAdPay, LinkSpin, Downline Banners, Viral Banner Blitz, ViralAdBlitz, ViralAdSource, DownlineHydra, 5xYourTeam and YourProgramBuilder: the smart contract pays your share in the same payment as the purchase, the moment it happens.</span></li>
<li><b>Hunt and game rewards</b><span>PolHunter and the games send rewards to your wallet automatically, usually within minutes. No request needed.</span></li>
</ul>
<small>Small print: if a transfer can't be delivered to your wallet, on most of these sites it waits safely in the contract for you to collect. On InstantAdPay and LinkSpin that share moves up the line instead, and on Downline Banners it goes to the momentum fund.</small>
</div>
</div>
<div class="promise">Nothing is promised. Crypto involves risk.<span>You only earn a share when a real purchase happens. Results depend on what you and your team do.</span></div>
<div class="earn">
<div class="ecard glass"><span class="site-name">InstantAdPay</span><b>Sponsor shares on ad packages</b><p>50% to the sponsor, plus level 2 and level 3 shares once you unlock them.</p></div>
<div class="ecard glass"><span class="site-name">LinkSpin</span><b>Sponsor shares on LinkSpin packages</b><p>The same split as InstantAdPay, on its own contract.</p></div>
<div class="ecard glass"><span class="site-name">Downline Banners</span><b>Spot sales</b><p>30% to the buyer's sponsor, and the spots bought just before a new one share in it.</p></div>
<div class="ecard glass"><span class="site-name">Viral Banner Blitz</span><b>Banner packs and weekly prizes</b><p>30% to the member who introduced the buyer. 10% goes to weekly leaderboard prizes.</p></div>
<div class="ecard glass"><span class="site-name">ViralAdBlitz</span><b>Boost shares, five levels</b><p>10% each to five people up the line who have bought a Boost themselves.</p></div>
<div class="ecard glass"><span class="site-name">ViralAdSource</span><b>Reshare and level shares</b><p>20% to the resharer whose link sold a Boost, plus 10% to each of five sponsor levels.</p></div>
<div class="ecard glass"><span class="site-name">DownlineHydra</span><b>Pro upgrade shares</b><p>20% to the direct sponsor, free or Pro. Levels 2 to 5 get 10% each, for Pro members.</p></div>
<div class="ecard glass"><span class="site-name">5xYourTeam</span><b>Position shares and Best Coach</b><p>25% to the sponsor, 5% each to levels 2 to 5, and 10% to a weekly Best Coach prize.</p></div>
<div class="ecard glass"><span class="site-name">YourProgramBuilder</span><b>Spotlight shares</b><p>A share when someone in your line buys a $10 Spotlight: 20% to the sponsor, 5% each to levels 2 to 5.</p></div>
<div class="ecard glass"><span class="site-name">PolHunter</span><b>Hunts and weekly prizes</b><p>A small random drip of POL for finds on sites new to you. Game Pass holders can win weekly prizes.</p></div>
<div class="ecard glass"><span class="site-name">The games</span><b>Game rewards</b><p>Some network games pay small POL rewards for playing.</p></div>
<div class="ecard glass credits"><span class="site-name">ViralAdSource and PolHunter</span><b>Ad credits</b><p>Reshares and PolHunter tour stops can earn ad credits. Ad credits buy advertising, not income.</p></div>
</div>
</section>
<section class="sec" aria-labelledby="s8" style="--c:var(--trust)">
<div class="sec-head"><span class="stop">8</span><h2 id="s8">Why you can check it</h2></div>
<div class="trust">
<div class="tcard"><b>Verified contracts</b><p>The code that splits payments is public. Anyone can read it on Polygonscan.</p></div>
<div class="tcard"><b>Public ledger</b><p>Every payment is recorded on the blockchain. Stack POL puts them in one place.</p></div>
<div class="tcard"><b>No monthly charges</b><p>Every purchase is one time. Nothing bills you again.</p></div>
<div class="tcard"><b>Free to join</b><p>You can look around, use the free tools and learn before you spend anything.</p></div>
</div>
</section>
<section class="start" aria-labelledby="go">
<h2 id="go">Start here</h2>
<ol>
<li><div><b>Join free</b>Make one account on InstantAdPay or LinkSpin.</div></li>
<li><div><b>Link a wallet</b>SafePal or any other crypto wallet.</div></li>
<li><div><b>Share your link</b>Use your tracked LinkSpin link wherever you promote.</div></li>
</ol>
</section>
<footer class="fine">
<p><strong>Ad credits buy advertising, not income.</strong></p>
<p><strong>Nothing is promised. Crypto involves risk.</strong> Payments in POL are final. Results depend on what you and your team do.</p>
<p>© 2026 TrustClickz</p>
</footer>
</main>
</body></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

+1
View File
@@ -0,0 +1 @@
{"name":"Stack POL","short_name":"Stack POL","start_url":"/","display":"standalone","background_color":"#0a0715","theme_color":"#0a0715","icons":[{"src":"/apple-touch-icon.png","sizes":"180x180","type":"image/png"},{"src":"/icon-512.png","sizes":"512x512","type":"image/png"}]}

Some files were not shown because too many files have changed in this diff Show More