document.addEventListener("DOMContentLoaded", function() { const CACHE_KEY = 'geo_state_cache'; const CACHE_DURATION = 24 * 60 * 60 * 1000; // 24 hours (1 day) const allowedStates = ["CO","IA","IL","IN","KS","MI","MN","MO","ND","NE","NY","OH","PA","SD","WI"]; const stateMap = { 'Colorado': 'CO', 'Iowa': 'IA', 'Illinois': 'IL', 'Indiana': 'IN', 'Kansas': 'KS', 'Michigan': 'MI', 'Minnesota': 'MN', 'Missouri': 'MO', 'North Dakota': 'ND', 'Nebraska': 'NE', 'New York': 'NY', 'Ohio': 'OH', 'Pennsylvania': 'PA', 'South Dakota': 'SD', 'Wisconsin': 'WI' }; const SHEETS_WEBHOOK_URL = 'https://script.google.com/macros/s/AKfycby7po461m4RiHNPH62Ea4MaG5guQ5MKEYpWhTRpfMlOaXH62pLzgAOLdFcl38auGqCO1w/exec'; function getCachedState() { const cache = localStorage.getItem(CACHE_KEY); if (!cache) return null; try { const parsed = JSON.parse(cache); if (Date.now() - parsed.timestamp > CACHE_DURATION) { localStorage.removeItem(CACHE_KEY); return null; } return parsed.stateCode; } catch (e) { localStorage.removeItem(CACHE_KEY); return null; } } function setCachedState(stateCode) { localStorage.setItem(CACHE_KEY, JSON.stringify({ stateCode, timestamp: Date.now() })); } function logStateToServer(stateCode) { fetch(SHEETS_WEBHOOK_URL, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ state: stateCode }) }).catch(() => {}); } function showAdIfAllowed(stateCode, adDivId, adHtml) { const banner = document.getElementById(adDivId); if (!banner) return; if (allowedStates.includes(stateCode)) { banner.innerHTML = adHtml; } else { banner.innerHTML = ''; } } // Ad HTML for each size/location (with your real placement codes) const adHtml728x90 = ` `; const adHtml300x600 = ` `; const adHtml300x250 = ` `; function updateAllAds(stateCode) { showAdIfAllowed(stateCode, "banner-ad-728x90", adHtml728x90); showAdIfAllowed(stateCode, "banner-ad-300x600", adHtml300x600); showAdIfAllowed(stateCode, "banner-ad-300x250", adHtml300x250); } // Main logic const cachedState = getCachedState(); if (cachedState) { updateAllAds(cachedState); } else if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { const lat = position.coords.latitude; const lon = position.coords.longitude; fetch(`https://api.openweathermap.org/geo/1.0/reverse?lat=${lat}&lon=${lon}&limit=1&appid=d6bd072896114a3cfdebcbe098657019`) .then(res => res.json()) .then(data => { if (data && data.length > 0 && data[0].state) { const abbr = stateMap[data[0].state] || ''; setCachedState(abbr); logStateToServer(abbr); updateAllAds(abbr); } else { updateAllAds(""); } }) .catch(() => { updateAllAds(""); }); }, function() { updateAllAds(""); }); } else { updateAllAds(""); } });

Thursday, August 7th, 2025 Podcast

8725-mt-new-youtube-thumbnail-1

We saw grains and cattle find some supportive price action on Thursday with moderate gains in corn, wheat and soybeans while the cattle complex continues its impressive run to the upside. Are we possibly turning a corner in these markets? Is it time for a summer rally in the grain markets? Bryan Doherty with Total Farm Marketing joins us for analysis and conversation on today’s program. You can learn more and contact Bryan by visiting https://www.totalfarmmarketing.com.

Plus, as this cattle market continues its run higher in the futures complex, we get a breakdown of this fascinating bull market on a new episode of Cattle Chatter. Susan Littlefield is joined again this week by Brad Kooima from KKV Trading to discuss.

Recommended Posts

Loading...