top of page

Muscular Dystrophy Media

By the community, for the community — stories that Uplift.

Check out some of the media made by the Muscular Dystrophy community. From documentaries to art galleries, hear from the voices within our cause.

bottom of page
// backend/events.jsw import { fetch } from 'wix-fetch'; import { getSecret } from 'wix-secrets-backend'; // if you need API keys /** * Fetch upcoming events from multiple sources. * Swap out the example URLs with real API endpoints or RSS feeds. */ export async function getCommunityEvents() { const events = []; // --- Example: Eventbrite (requires API key) --- // const EB_KEY = await getSecret("eventbriteApiKey"); // let resp = await fetch("https://www.eventbriteapi.com/v3/organizations/YOUR_ORG_ID/events/", { // headers: { Authorization: `Bearer ${EB_KEY}` } // }); // let data = await resp.json(); // data.events.forEach(e => { // events.push({ // title: e.name.text, // date: e.start.local, // link: e.url // }); // }); // --- Example: A site with JSON endpoint --- try { let resp2 = await fetch("https://example.org/api/upcoming-events"); if (resp2.ok) { let list = await resp2.json(); // assume [{title, date, url}, …] list.forEach(e => { events.push({ title: e.title, date: e.date, link: e.url }); }); } } catch (err) { console.error("Error fetching from example.org", err); } // --- Example: RSS feed parsing (XML) --- try { let resp3 = await fetch("https://another.org/events/rss.xml"); if (resp3.ok) { let xml = await resp3.text(); // simple regex-based parsing – for production, use a proper XML parser const itemRegex = /[\s\S]*?<\/item>/g; let items = xml.match(itemRegex)||[]; items.forEach(item => { let titleMatch = item.match(/<!\[CDATA\[(.*?)\]\]><\/title>/); let linkMatch = item.match(/<link>(.*?)<\/link>/); let dateMatch = item.match(/<pubDate>(.*?)<\/pubDate>/); if (titleMatch && linkMatch && dateMatch) { events.push({ title: titleMatch[1], date: new Date(dateMatch[1]).toISOString(), link: linkMatch[1] }); } }); } } catch (err) { console.error("Error parsing RSS feed", err); } // Sort by date events.sort((a, b) => new Date(a.date) - new Date(b.date)); return events; } <script type="wix/htmlEmbeds" id="pageHtmlEmbeds.bodyEnd end"></script> <!--pageHtmlEmbeds.bodyEnd end--> <!-- domStoreHtml --> <svg data-dom-store style="display:none"><defs id="dom-store-defs"></defs></svg> <!-- warmup data start --> <script type="application/json" id="wix-warmup-data">{"platform":{"ssrPropsUpdates":[],"ssrStyleUpdates":[],"ssrStructureUpdates":[]},"pages":{"compIdToTypeMap":{"CONTROLLER_COMP_CUSTOM_ID":"AppController","comp-mdd9i52v1":"LoginSocialBar","comp-met05fpt":"WPhoto","comp-mcxugj5t4":"SiteButton","comp-mcxugj6b8":"WRichText","comp-me8ri557":"LinkBar","comp-mcxugj6l1":"WRichText","comp-mcxugj5z2":"HamburgerOpenButton","comp-mcxugj6c10":"WRichText","comp-mcxugj6d5":"WRichText","comp-mcxugj652":"HamburgerCloseButton","comp-mcxugj661":"ExpandableMenu","masterPage":"MasterPage","PAGES_CONTAINER":"PagesContainer","SITE_HEADER":"HeaderContainer","SITE_FOOTER":"FooterContainer","SITE_PAGES":"PageGroup","comp-mcxugj4z3":"StripColumnsContainer","comp-mdd9i526":"AppWidget","comp-mcxugj6a2":"StripColumnsContainer","comp-mcxugj5a":"Column","comp-mcxugj5s1":"Column","comp-mcxugj5t":"Column","comp-mcxugj5x9":"Column","comp-mcxugj6b4":"Column","comp-mcxugj6k15":"Column","comp-mcxugj5y3":"HamburgerMenuRoot","comp-mcxugj6c7":"Container","comp-mcxugj62":"HamburgerOverlay","comp-mcxugj63":"StripColumnsContainer","comp-mcxugj633":"Column","comp-mcxugj644":"HamburgerMenuContainer","BACKGROUND_GROUP":"BackgroundGroup","SCROLL_TO_TOP":"Anchor","SCROLL_TO_BOTTOM":"Anchor","soapAfterPagesContainer":"MeshGroup","SKIP_TO_CONTENT_BTN":"SkipToContentButton","comp-mdq3ikvr":"WRichText","comp-mdq3ikvt1":"WRichText","comp-mdq3ikvu1":"WRichText","comp-mdq3ikw38":"WPhoto","comp-mdq3ikw41":"WRichText","comp-mdq3ikw46":"WRichText","comp-mdq9bvhc":"WRichText","comp-mdq9b2qb":"StylableButton","pageBackground_q8ljy":"PageBackground","q8ljy":"Page","comp-mdq3ikvi":"ClassicSection","comp-mdq3ikvv1":"Repeater","comp-mdq3ikw15":"MediaContainer","Containerq8ljy":"Group","DYNAMIC_STRUCTURE_CONTAINER":"DynamicStructureContainer","site-root":"DivWithChildren","main_MF":"DivWithChildren","q8ljy_wrapper":"PageMountUnmount","q8ljy_wrapper_background":"PageMountUnmount"}},"appsWarmupData":{},"ooi":{"failedInSsr":{}}}</script> <!-- warmup data end --> <!-- presets polyfill --> </body> </html>