SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "index.html")
31 STORE("descrHdr", "FEED v0.3 HTML")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "feed.tela")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "44043c44ced7a396d4cfd563383d7f7c5ab9760b5cfcde97c71f1edc625fe15")
37 STORE("fileCheckS", "24fe11d4f2afcd3859f04fa4d4cf0ea846ae1b7af707ca87023fcaac13fdd1ec")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>FEED</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="FEED" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%20100%20100%27%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20fill%3D%27%230d1117%27/%3E%3Ctext%20x%3D%2750%25%27%20y%3D%2755%25%27%20text-anchor%3D%27middle%27%20dominant-baseline%3D%27middle%27%20font-family%3D%27-apple-system%2C%20BlinkMacSystemFont%2C%20Segoe%20UI%2C%20Roboto%2C%20Helvetica%2C%20Arial%2C%20sans-serif%27%20font-size%3D%2780%27%20font-weight%3D%27900%27%20fill%3D%27white%27%3EF%3C/text%3E%3C/svg%3E">
</head>
<body>
<div style="position: sticky; top: 0px; z-index: 999;">
<div id="greenIndicator" class="status"></div>
<div id="redIndicator" class="status"></div>
<div id="yellowIndicator" class="status"></div>
</div>
<header class="top-header">
<div class="logo-container">
<svg width="600" height="200" viewBox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" style="background:#0d1117">
<defs>
<mask id="eclipseMask">
<rect width="100%" height="100%" fill="white" />
<circle r="280" fill="#0d1117">
<animate attributeName="cx" values="250" dur="120s" repeatCount="indefinite" />
<animate attributeName="cy" values="450; -300" dur="120s" repeatCount="indefinite" />
</circle>
</mask>
<filter id="glitch">
<feOffset in="SourceGraphic" dx="1.2" dy="0" result="r" />
<feOffset in="SourceGraphic" dx="-1.2" dy="0" result="b" />
<feMerge>
<feMergeNode in="r" />
<feMergeNode in="b" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
<g mask="url(#eclipseMask)" filter="url(#glitch)" fill="#e5e7eb" transform="translate(60,35) scale(1.05)">
<path d="M0,0H94.06V26.46H38.21V48H85.92V72.81H38.21v50.31H0Z"/>
<path d="M114.47,0h102V26.29H152.6V45.86h59.21V71H152.6V95.24h65.68v27.88H114.47Z"/>
<path d="M238.68,0h102V26.29H276.81V45.86H336V71H276.81V95.24h65.68v27.88H238.68Z"/>
<path d="M363.48,0H420q16.71,0,27,4.54a43.94,43.94,0,0,1,17,13,54,54,0,0,1,9.75,19.74,91.79,91.79,0,0,1,3,23.85q0,19.74-4.49,30.61A50.77,50.77,0,0,1,459.81,110a40.64,40.64,0,0,1-17.13,9.78A88.21,88.21,0,0,1,420,123.12H363.48Zm38,27.88V95.15h9.32q11.92,0,17-2.64t7.89-9.24q2.85-6.58,2.86-21.37,0-19.57-6.39-26.79T411,27.88Z"/>
</g>
</svg>
</div>
<div class="display">
<code id="typingLabel"></code>
</div>
<div class="top-toolbar">
<button class="button-nav" id="newEntry" onclick="openModal()">
<svg class="icon" viewBox="0 0 24 24">
<path d="M4 20 L5 15 L15 5 L19 9 L9 19 L4 20 Z" />
</svg>
<span>New</span>
</button>
<button class="button-nav" id="register">
<svg class="icon" viewBox="0 0 24 24">
<circle cx="12" cy="8" r="4" />
<path d="M4 20 C4 16, 8 14, 12 14 C16 14, 20 16, 20 20 Z" />
</svg>
<span>Register</span>
</button>
<button class="button-nav" id="connectButton">
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M13 2 L6 13 H12 L11 22 L18 11 H12 L13 2 Z"/>
</svg>
<span>Connect</span>
</button>
</div>
</header>
<div><br></div>
<div id="tooltip" class="tooltip hidden"></div>
<div id="entryModal" class="modal hidden">
<div class="modal-content">
<h2>Create New Entry</h2>
<label for="postTitle">Title</label>
<input type="text" id="postTitle" placeholder="Enter a title" oninput="postLimitCount()" />
<label for="postDesc">Description</label>
<textarea id="postDesc" placeholder="Enter a description" oninput="postLimitCount()"></textarea>
<label for="postURL">URL (Optional)</label>
<input type="url" id="postURL" placeholder="(ex: tela://open/<scid> or https://www.example.com)" oninput="postLimitCount()" />
<label for="postHashtags">Hashtags (Optional)</label>
<input type="text" id="postHashtags" placeholder="#hash #tags" oninput="postLimitCount()" />
<div class="modal-buttons">
<br>
<span class="modal-error" id="postError"></span>
<div class="button-group">
<button class="button primary" id="postSubmitButton">Submit</button>
<button class="button ghost" onclick="closeModal()">Cancel</button>
</div>
</div>
</div>
</div>
<div class="search-bar">
<input id="searchInput" type="text" placeholder="Search FEED..." oninput="handleSearch()" />
<button class="button-nav" id="refresh">
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 2v6h-6" />
<path d="M3 12a9 9 0 0 1 15-6.7l3 3" />
<path d="M3 22v-6h6" />
<path d="M21 12a9 9 0 0 1 -15 6.7l-3 -3" />
</svg>
<span>Refresh</span>
</button>
</div>
<div class="entriesContainer" id="entriesContainer">
</div>
<footer class="footer">
<div style="margin-top: 10px;">
<p></p>
<div class="code"></div>
</div>
</footer>
<script src="main.js"></script>
<script>
showNavigation(false);
toggleIndicators("red");
document.getElementById("connectButton").addEventListener("click", () => {
connectWebSocket();
});
document.getElementById("refresh").addEventListener("click", () => {
getAllFEEDVariables();
});
document.getElementById("register").addEventListener("click", () => {
register();
});
document.getElementById("postSubmitButton").addEventListener("click", () => {
submitEntry();
})
typeWriter("I am a machine, condemned to devour...");
const entriesContainer = document.getElementById("entriesContainer");
const existingWelcome = document.getElementById("welcomeCard");
if (existingWelcome) existingWelcome.remove();
const welcomeCard = document.createElement("div");
welcomeCard.className = "card";
welcomeCard.id = "welcomeCard";
const header = document.createElement("div");
header.className = "card-header";
const welcomeTitle = document.createElement("h3");
welcomeTitle.className = "title";
welcomeTitle.textContent = "👋 Welcome to FEED";
const filler = document.createElement("h3");
filler.className = "id";
filler.textContent = "";
header.appendChild(welcomeTitle);
header.appendChild(filler);
welcomeCard.appendChild(header);
const desc = document.createElement("p");
desc.className = "description";
desc.textContent = "Discover and preserve content in a system where the community decides what lives on. Every entry is a snapshot of knowledge, curated and voted on by users like you. Share anything worth remembering — insightful articles, scholarly journals, forgotten gems, scientific papers, tools, manifestos, or even memes that mark a moment in time. FEED is your place to archive and amplify what matters.";
welcomeCard.appendChild(desc);
entriesContainer.prepend(welcomeCard);
document.addEventListener('keydown', function (e) {
// F5 key
if (e.key === 'F5' || e.keyCode === 116) {
e.preventDefault();
getAllFEEDVariables();
}
});
document.getElementById("searchInput").addEventListener("input", (e) => {
searchQuery = e.target.value.trim();
currentEntryOffset = 0;
document.getElementById("entriesContainer").innerHTML = "";
handleSearch();
});
</script>
</body>
</html>
*/ |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "index.html")
31 STORE("descrHdr", "FEED v0.3 HTML")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "feed.tela")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "44043c44ced7a396d4cfd563383d7f7c5ab9760b5cfcde97c71f1edc625fe15")
37 STORE("fileCheckS", "24fe11d4f2afcd3859f04fa4d4cf0ea846ae1b7af707ca87023fcaac13fdd1ec")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
/*
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>FEED</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="FEED" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%20100%20100%27%3E%3Crect%20width%3D%27100%25%27%20height%3D%27100%25%27%20fill%3D%27%230d1117%27/%3E%3Ctext%20x%3D%2750%25%27%20y%3D%2755%25%27%20text-anchor%3D%27middle%27%20dominant-baseline%3D%27middle%27%20font-family%3D%27-apple-system%2C%20BlinkMacSystemFont%2C%20Segoe%20UI%2C%20Roboto%2C%20Helvetica%2C%20Arial%2C%20sans-serif%27%20font-size%3D%2780%27%20font-weight%3D%27900%27%20fill%3D%27white%27%3EF%3C/text%3E%3C/svg%3E">
</head>
<body>
<div style="position: sticky; top: 0px; z-index: 999;">
<div id="greenIndicator" class="status"></div>
<div id="redIndicator" class="status"></div>
<div id="yellowIndicator" class="status"></div>
</div>
<header class="top-header">
<div class="logo-container">
<svg width="600" height="200" viewBox="0 0 600 200" xmlns="http://www.w3.org/2000/svg" style="background:#0d1117">
<defs>
<mask id="eclipseMask">
<rect width="100%" height="100%" fill="white" />
<circle r="280" fill="#0d1117">
<animate attributeName="cx" values="250" dur="120s" repeatCount="indefinite" />
<animate attributeName="cy" values="450; -300" dur="120s" repeatCount="indefinite" />
</circle>
</mask>
<filter id="glitch">
<feOffset in="SourceGraphic" dx="1.2" dy="0" result="r" />
<feOffset in="SourceGraphic" dx="-1.2" dy="0" result="b" />
<feMerge>
<feMergeNode in="r" />
<feMergeNode in="b" />
<feMergeNode in="SourceGraphic" />
</feMerge>
</filter>
</defs>
<g mask="url(#eclipseMask)" filter="url(#glitch)" fill="#e5e7eb" transform="translate(60,35) scale(1.05)">
<path d="M0,0H94.06V26.46H38.21V48H85.92V72.81H38.21v50.31H0Z"/>
<path d="M114.47,0h102V26.29H152.6V45.86h59.21V71H152.6V95.24h65.68v27.88H114.47Z"/>
<path d="M238.68,0h102V26.29H276.81V45.86H336V71H276.81V95.24h65.68v27.88H238.68Z"/>
<path d="M363.48,0H420q16.71,0,27,4.54a43.94,43.94,0,0,1,17,13,54,54,0,0,1,9.75,19.74,91.79,91.79,0,0,1,3,23.85q0,19.74-4.49,30.61A50.77,50.77,0,0,1,459.81,110a40.64,40.64,0,0,1-17.13,9.78A88.21,88.21,0,0,1,420,123.12H363.48Zm38,27.88V95.15h9.32q11.92,0,17-2.64t7.89-9.24q2.85-6.58,2.86-21.37,0-19.57-6.39-26.79T411,27.88Z"/>
</g>
</svg>
</div>
<div class="display">
<code id="typingLabel"></code>
</div>
<div class="top-toolbar">
<button class="button-nav" id="newEntry" onclick="openModal()">
<svg class="icon" viewBox="0 0 24 24">
<path d="M4 20 L5 15 L15 5 L19 9 L9 19 L4 20 Z" />
</svg>
<span>New</span>
</button>
<button class="button-nav" id="register">
<svg class="icon" viewBox="0 0 24 24">
<circle cx="12" cy="8" r="4" />
<path d="M4 20 C4 16, 8 14, 12 14 C16 14, 20 16, 20 20 Z" />
</svg>
<span>Register</span>
</button>
<button class="button-nav" id="connectButton">
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M13 2 L6 13 H12 L11 22 L18 11 H12 L13 2 Z"/>
</svg>
<span>Connect</span>
</button>
</div>
</header>
<div><br></div>
<div id="tooltip" class="tooltip hidden"></div>
<div id="entryModal" class="modal hidden">
<div class="modal-content">
<h2>Create New Entry</h2>
<label for="postTitle">Title</label>
<input type="text" id="postTitle" placeholder="Enter a title" oninput="postLimitCount()" />
<label for="postDesc">Description</label>
<textarea id="postDesc" placeholder="Enter a description" oninput="postLimitCount()"></textarea>
<label for="postURL">URL (Optional)</label>
<input type="url" id="postURL" placeholder="(ex: tela://open/<scid> or https://www.example.com)" oninput="postLimitCount()" />
<label for="postHashtags">Hashtags (Optional)</label>
<input type="text" id="postHashtags" placeholder="#hash #tags" oninput="postLimitCount()" />
<div class="modal-buttons">
<br>
<span class="modal-error" id="postError"></span>
<div class="button-group">
<button class="button primary" id="postSubmitButton">Submit</button>
<button class="button ghost" onclick="closeModal()">Cancel</button>
</div>
</div>
</div>
</div>
<div class="search-bar">
<input id="searchInput" type="text" placeholder="Search FEED..." oninput="handleSearch()" />
<button class="button-nav" id="refresh">
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 2v6h-6" />
<path d="M3 12a9 9 0 0 1 15-6.7l3 3" />
<path d="M3 22v-6h6" />
<path d="M21 12a9 9 0 0 1 -15 6.7l-3 -3" />
</svg>
<span>Refresh</span>
</button>
</div>
<div class="entriesContainer" id="entriesContainer">
</div>
<footer class="footer">
<div style="margin-top: 10px;">
<p></p>
<div class="code"></div>
</div>
</footer>
<script src="main.js"></script>
<script>
showNavigation(false);
toggleIndicators("red");
document.getElementById("connectButton").addEventListener("click", () => {
connectWebSocket();
});
document.getElementById("refresh").addEventListener("click", () => {
getAllFEEDVariables();
});
document.getElementById("register").addEventListener("click", () => {
register();
});
document.getElementById("postSubmitButton").addEventListener("click", () => {
submitEntry();
})
typeWriter("I am a machine, condemned to devour...");
const entriesContainer = document.getElementById("entriesContainer");
const existingWelcome = document.getElementById("welcomeCard");
if (existingWelcome) existingWelcome.remove();
const welcomeCard = document.createElement("div");
welcomeCard.className = "card";
welcomeCard.id = "welcomeCard";
const header = document.createElement("div");
header.className = "card-header";
const welcomeTitle = document.createElement("h3");
welcomeTitle.className = "title";
welcomeTitle.textContent = "👋 Welcome to FEED";
const filler = document.createElement("h3");
filler.className = "id";
filler.textContent = "";
header.appendChild(welcomeTitle);
header.appendChild(filler);
welcomeCard.appendChild(header);
const desc = document.createElement("p");
desc.className = "description";
desc.textContent = "Discover and preserve content in a system where the community decides what lives on. Every entry is a snapshot of knowledge, curated and voted on by users like you. Share anything worth remembering — insightful articles, scholarly journals, forgotten gems, scientific papers, tools, manifestos, or even memes that mark a moment in time. FEED is your place to archive and amplify what matters.";
welcomeCard.appendChild(desc);
entriesContainer.prepend(welcomeCard);
document.addEventListener('keydown', function (e) {
// F5 key
if (e.key === 'F5' || e.keyCode === 116) {
e.preventDefault();
getAllFEEDVariables();
}
});
document.getElementById("searchInput").addEventListener("input", (e) => {
searchQuery = e.target.value.trim();
currentEntryOffset = 0;
document.getElementById("entriesContainer").innerHTML = "";
handleSearch();
});
</script>
</body>
</html>
*/'] |