PageSourceSearch

https://rainfactory.ai/assets/Blog-DQOs4I6E.js

js rainfactory.ai collected 2026-10-05 14:39:09 UTC 7,687 bytes, 2 lines download raw bytes

1import{a as c,j as e}from"./ui-vendor-Pu0cN9S7.js";import{h as W,C as x,b as g,r as _,s as z,q as C,v as G}from"./index-DVqYXXq7.js";import{g as E}from"./slug-utils-DU6uXJgO.js";function Y(){const[s,A]=c.useState([]),[T,h]=c.useState(!0),[u,I]=c.useState(null),U=s.length>0?s.flatMap(t=>t.categories||[]).join(", "):"AI, marketing, automation, insights, trends";W({title:"Blog - AI Social Media Marketing & Content Generation Insights",description:"Expert insights on AI social media marketing automation, AI content generation, and automated content strategy. Learn how to create high-performing social media content at scale with AI.",keywords:U||"ai marketing, ai content creation, social media marketing automation, ai social media content generator, ai in marketing, brand voice AI",url:`${window.location.origin}/blog`,type:"website",image:s.length>0&&s[0].imageUrl?s[0].imageUrl:"https://rainfactory.ai/og-image.png",breadcrumbs:[{name:"Home",url:`${window.location.origin}/`},{name:"Blog",url:`${window.location.origin}/blog`}]}),c.useEffect(()=>{async function t(){try{const r="0f11ef4f-30f8-4ebe-a096-07b12c9a0b6c";console.log("Fetching blog posts for brand ID:",r);const $=`https://worker.rainfactory.ai/api/blog-rss/${r}`,d=await fetch($);if(!d.ok)throw new Error(`Failed to fetch RSS feed: ${d.statusText}`);const D=await d.text(),M=new DOMParser().parseFromString(D,"text/xml").querySelectorAll("item"),f=[];M.forEach(a=>{var j,v,N,w,S,k;const B=((j=a.querySelector("title"))==null?void 0:j.textContent)||"Untitled",L=((v=a.querySelector("description"))==null?void 0:v.textContent)||"",R=((N=a.querySelector("link"))==null?void 0:N.textContent)||"#",F=((w=a.querySelector("pubDate"))==null?void 0:w.textContent)||"",P=((S=a.querySelector("guid"))==null?void 0:S.textContent)||Math.random().toString(),H=a.querySelectorAll("category"),p=[];H.forEach(l=>{const i=l.textContent;i&&p.push(i)});const m=a.querySelector("enclosure"),O=(m==null?void 0:m.getAttribute("url"))||"";let b="",y="";const n=((k=a.querySelector("content\\:encoded"))==null?void 0:k.textContent)||"";if(n){const l=n.match(/Author:\s*([^<\n]+)/i)||n.match(/<div class="author">Author:\s*([^<]+)<\/div>/i);l&&(b=l[1].trim());const i=n.match(/Reading time:\s*([^<\n]+)/i)||n.match(/(\d+\s*min\s*read)/i)||n.match(/<div class="reading-time">Reading time:\s*([^<]+)<\/div>/i);i&&(y=i[1].trim())}f.push({title:B,description:L,link:R,pubDate:F,guid:P,categories:p,imageUrl:O,author:b,readingTime:y})}),A(f),h(!1)}catch(r){console.error("Error fetching blog posts:",r),I(r instanceof Error?r.message:"An unknown error occurred"),h(!1)}}t()},[]);const q=t=>{if(!t)return"";try{return new Date(t).toLocaleString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0})}catch{return t}};return e.jsxs("div",{className:"min-h-screen",children:[e.jsxs("section",{className:"relative overflow-hidden bg-gradient-to-br from-white via-blue-50/30 to-indigo-50/40 border-b border-blue-200/50 shadow-sm",children:[e.jsx("div",{className:"absolute inset-0 bg-grid-pattern opacity-5"}),e.jsx("div",{className:"absolute top-0 right-0 w-40 h-40 bg-gradient-to-br from-blue-200/20 to-transparent rounded-full -translate-y-20 translate-x-20"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-gradient-to-tr from-indigo-100/40 to-transparent rounded-full translate-y-16 -translate-x-16"}),e.jsx("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16 sm:py-20",children:e.jsxs("div",{className:"text-center space-y-8",children:[e.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold bg-gradient-to-r from-blue-700 via-indigo-700 to-purple-700 bg-clip-text text-transparent leading-tight pb-2",children:"Rainfactory AI Blog"}),e.jsx("p",{className:"text-gray-600 max-w-3xl mx-auto text-lg md:text-xl leading-relaxed",children:"Stay up to date with the latest news and insights"})]})})]}),e.jsx("div",{className:"py-12",children:e.jsx("div",{className:"container mx-auto max-w-4xl px-4",children:T?e.jsx("div",{className:"flex justify-center items-center py-16",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):u?e.jsx(x,{className:"mb-12",children:e.jsx(g,{className:"pt-6",children:e.jsxs("p",{className:"text-red-500 text-base leading-relaxed",children:["Error loading blog posts: ",u]})})}):s.length===0?e.jsx(x,{className:"mb-12",children:e.jsx(g,{className:"pt-6",children:e.jsx("p",{className:"text-muted-foreground text-base leading-relaxed",children:"No blog posts found."})})}):e.jsx("div",{className:"space-y-8",children:s.map(t=>e.jsxs(x,{className:"overflow-hidden hover:shadow-lg transition-all duration-300 hover:border-primary/20 group",children:[t.imageUrl?e.jsx("div",{className:"aspect-video overflow-hidden bg-gradient-to-br from-muted/50 to-muted/30",children:e.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",width:800,height:450,loading:"lazy",onError:r=>{const o=r.target;o.style.display="none"}})}):e.jsx("div",{className:"aspect-video bg-gradient-to-br from-primary/10 via-primary/5 to-transparent flex items-center justify-center",children:e.jsxs("div",{className:"text-center p-6",children:[e.jsx("div",{className:"w-16 h-16 mx-auto mb-3 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-2xl",children:"📝"})}),e.jsx("h3",{className:"text-lg font-medium text-primary/80 line-clamp-2",children:t.title})]})}),e.jsx(_,{children:e.jsxs("div",{className:"space-y-3",children:[t.categories&&t.categories.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.categories.slice(0,3).map((r,o)=>e.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-primary/10 text-primary hover:bg-primary/20 transition-colors",children:r},o)),t.categories.length>3&&e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground",children:["+",t.categories.length-3," more"]})]}),e.jsx(z,{className:"text-xl md:text-2xl text-public-title leading-tight font-bold",children:e.jsx(C,{to:`/blog/${t.guid}/${E(t.title)}`,className:"hover:text-primary transition-colors group-hover:text-primary/90",children:t.title})})]})}),e.jsx(g,{className:"pb-4",children:e.jsx("div",{className:"text-muted-foreground text-base leading-relaxed line-clamp-3",style:{display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},dangerouslySetInnerHTML:{__html:t.description}})}),e.jsx(G,{className:"pt-4",children:e.jsxs("div",{className:"flex flex-col gap-3 w-full",children:[(t.author||t.readingTime)&&e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[t.author&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium",children:"By"}),e.jsx("span",{children:t.author})]}),t.readingTime&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"📖"}),e.jsx("span",{children:t.readingTime})]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:q(t.pubDate)}),e.jsxs(C,{to:`/blog/${t.guid}/${E(t.title)}`,className:"inline-flex items-center text-primary hover:text-primary/80 transition-colors text-sm font-medium group",children:["Read more",e.jsx("span",{className:"ml-1 group-hover:translate-x-0.5 transition-transform",children:"→"})]})]})]})})]},t.guid))})})})]})}export{Y as default};
2//# sourceMappingURL=Blog-DQOs4I6E.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.