untitled-8327main.ts1 match
1// Learn more: https://docs.val.town/vals/http/
2export default function (req: Request): Promise<Response> {
3const [, statusCode] = "/200".match(/\/([0-9]*)/);
4
1export default async function handler(req: Request) {
2if (req.method !== "GET") {
3return new Response("Method Not Allowed", { status: 405 });
eventsCalendartmp.ts1 match
3import { marked } from "npm:marked";
45export default async function (req: Request) {
6const vt = new ValTown();
7const val_id = "4cbcd1ae-8b94-11f0-b01a-0224a6c84d84";
eventsCalendarserver.ts4 matches
2Use with bookmarklet:
34javascript: (function () {
5var HOST = "https://extract-event-data.val.run";
6var TOKEN = "<REPLACE>";
209});
210211function update(stream: SSEStreamingApi, payload: any) {
212return stream.writeSSE({
213event: "update",
219}
220221function complete(
222stream: SSEStreamingApi,
223state: "success" | "error",
232}
233234function fail(
235stream: SSEStreamingApi,
236message?: string,
TopTenVideosmember-site-integration.html13 matches
130131// Load free version
132document.getElementById('loadFreeVersion').addEventListener('click', function() {
133nicheIframe.src = 'free-input-iframe.html';
134toolContainer.classList.remove('hidden');
138139// Load premium version
140document.getElementById('loadPremiumVersion').addEventListener('click', function() {
141nicheIframe.src = 'premium-input-iframe.html';
142toolContainer.classList.remove('hidden');
146147// Clear tool
148document.getElementById('clearTool').addEventListener('click', function() {
149toolContainer.classList.add('hidden');
150outputContainer.classList.add('hidden');
156157// Listen for messages from iframe
158window.addEventListener('message', function(event) {
159// Security check - in production, verify event.origin
160
175176// Generate output page
177function generateOutputPage(data) {
178try {
179currentOutputData = data;
200201// Download HTML file
202document.getElementById('downloadPage').addEventListener('click', function() {
203if (!currentOutputHTML) {
204alert('No page generated yet!');
225226// Preview page
227document.getElementById('previewPage').addEventListener('click', function() {
228if (!currentOutputHTML) {
229alert('No page generated yet!');
242243// Copy HTML code
244document.getElementById('copyCode').addEventListener('click', function() {
245if (!currentOutputHTML) {
246alert('No page generated yet!');
248}
249
250navigator.clipboard.writeText(currentOutputHTML).then(function() {
251updateStatus('📋 HTML code copied to clipboard!');
252
263btn.classList.add('bg-purple-600');
264}, 2000);
265}).catch(function(err) {
266console.error('Failed to copy: ', err);
267updateStatus('❌ Failed to copy to clipboard');
270271// Close preview modal
272document.getElementById('closePreview').addEventListener('click', function() {
273previewModal.classList.add('hidden');
274previewFrame.src = '';
276277// Close modal on background click
278previewModal.addEventListener('click', function(e) {
279if (e.target === previewModal) {
280previewModal.classList.add('hidden');
284285// Update status message
286function updateStatus(message) {
287document.getElementById('outputStatus').textContent = message;
288console.log('Status:', message);
TopTenVideosoutput-generator.js7 matches
261262// Show video details
263function showVideoDetails(videoId) {
264const video = videos.find(v => v.id === videoId);
265if (!video) return;
305306// Track ad clicks
307function trackAdClick(adId, url) {
308analytics.clicks[adId] = (analytics.clicks[adId] || 0) + 1;
309updateAnalytics();
312313// Track ad impressions
314function trackAdImpression(adId) {
315analytics.impressions[adId] = (analytics.impressions[adId] || 0) + 1;
316updateAnalytics();
319320// Update analytics display
321function updateAnalytics() {
322const totalImpressions = Object.values(analytics.impressions).reduce((a, b) => a + b, 0);
323const totalClicks = Object.values(analytics.clicks).reduce((a, b) => a + b, 0);
358js += `
359// Initialize page
360document.addEventListener('DOMContentLoaded', function() {
361// Auto-select first video
362if (videos.length > 0) {
390391// Display single ad
392function displayAd(ad) {
393const content = document.getElementById('advertisementContent');
394if (!content) return;
431432// Start ad rotation
433function startAdRotation() {
434if (weightedAds.length === 0) return;
435
TopTenVideospremium-input-iframe.html10 matches
234}
235236function getNextWeekReset() {
237const now = new Date();
238const nextWeek = new Date(now);
242}
243244function updateDashboard() {
245const resetDate = new Date(premiumData.weeklyReset);
246const now = new Date();
293294// Handle main niche selection
295nicheSelect.addEventListener('change', function() {
296const selectedValue = this.value;
297
319320// Ad slot management
321document.getElementById('addAdSlot').addEventListener('click', function() {
322if (adSlotCounter >= 5) {
323alert('Maximum 5 ad slots allowed');
332});
333334function createAdSlot(slotNumber) {
335const slotDiv = document.createElement('div');
336slotDiv.className = 'ad-slot mb-4 p-3 border border-gray-200 rounded-lg';
364`;
365
366// Add remove functionality
367slotDiv.querySelector('.remove-ad-slot').addEventListener('click', function() {
368slotDiv.remove();
369updateRemoveButtons();
374}
375376function updateRemoveButtons() {
377const slots = document.querySelectorAll('.ad-slot');
378slots.forEach(slot => {
383384// Handle form submission
385form.addEventListener('submit', function(e) {
386e.preventDefault();
387
460461// Auto-resize iframe
462function resizeIframe() {
463const height = document.body.scrollHeight;
464parent.postMessage({
TopTenVideosfree-input-iframe.html3 matches
194195// Handle main niche selection
196nicheSelect.addEventListener('change', function() {
197const selectedValue = this.value;
198
218219// Handle form submission
220form.addEventListener('submit', function(e) {
221e.preventDefault();
222
271272// Auto-resize iframe
273function resizeIframe() {
274const height = document.body.scrollHeight;
275parent.postMessage({
TopTenVideosVERSION-COMPARISON.md2 matches
92### **Free Version:**
93- **Lead Generation** - Capture interested users
94- **Feature Demonstration** - Show core functionality
95- **Upgrade Conversion** - Clear premium benefits
96- **Viral Sharing** - Easy to share and try
107108### **Free-to-Premium Funnel:**
1091. **Free users** experience core functionality
1102. **Upgrade prompts** highlight premium benefits
1113. **Weekly limits** create urgency for premium
TopTenVideosfree-version.html6 matches
298299// Handle main niche selection
300nicheSelect.addEventListener('change', function() {
301const selectedValue = this.value;
302
324325// Handle form submission
326form.addEventListener('submit', function(e) {
327e.preventDefault();
328
365366// Show video results (simplified version)
367function showVideoResults(niche, subNiche, adConfig) {
368const videoResults = document.getElementById('videoResults');
369const nicheDisplay = document.getElementById('nicheDisplay');
496// Add click handlers
497document.querySelectorAll('.video-item').forEach(item => {
498item.addEventListener('click', function() {
499const videoId = this.dataset.videoId;
500const video = sampleVideos.find(v => v.id == videoId);
513514// Show video description
515function showVideoDescription(video) {
516const descriptionPanel = document.getElementById('descriptionPanel');
517
549550// Show basic advertisement
551function showBasicAdvertisement(adConfig) {
552const advertisementSection = document.getElementById('advertisementSection');
553const advertisementContent = document.getElementById('advertisementContent');