Showing posts with label hackathon. Show all posts
Showing posts with label hackathon. Show all posts

Wednesday, May 27, 2026

Team Sitecorepunk 2077 Wins the 2026 Sitecore Hackathon!

It happened again!!

I'm proud to say that 'Team Sitecorepunk 2077' (...it's still just me) has officially won the 2026 Sitecore Hackathon!  ๐Ÿ†



That's now two years in a row!  It's really an unreal feeling. 

A day or two after the event, I sifted through the SitecoreHackathon GitHub to pull some stats:  34 teams registered, 20 teams submitted something before the deadline.  

A solid Sitecore community turnout ๐Ÿ‘๐Ÿ‘๐Ÿ‘  

I vibed together a submission showcase to digest all of this year's entries. 
Check it out here: Sitecore Hackathon 2026 Submission Showcase.


๐Ÿ‘Ÿ Preparation

In my hackathon prep post, I basically said 'you can practice for this'.  Taking my own advice, I spent time leading up to the event building a couple of basic Marketplace applications locally using AI-assisted tools like Claude Code, OpenAI Codex, Microsoft Copilot, Cursor, VS Code, and Perplexity. 

After a few days into this deep dive, I wound up with a pretty solid LLM-friendly knowledge base containing relevant public Sitecore Marketplace SDK/Blok documentation, examples, and code samples to give my agents the context they need to successfully build and iterate on a Marketplace app.  With these technical barriers eliminated, I could focus on building features for whatever app I'd end up building during the event.  

Day of, I'd say I felt...pretty well prepared actually.  It wasn't my first rodeo, so I knew what to expect.   My workspace was ready, and I felt confident that I had the tools to execute whatever the categories/idea requirements. 

I took the afternoon off from work and forced a short nap, enough time to reset, and have dinner with the family.  

I had my calendar blocked.  Everyone at home knew that I'd be upstairs, locked away in my office for the next 24 hours (with the occasional break in between). 



I even had my Hackerspace Hero shirt on!


It was time.  

Thursday, February 26, 2026

Sitecore Hackathon 2026 Prep: 8 Tips From a Hackathon Vet

Sitecore Hackathon season is back!   After snagging a win with my SPE module (SPExAI) last year and basking in all the glory that comes with it, I'm returning under the Sitecorepunk 2077 banner (with a refreshed logo, too!).

thx NanoBanana

I always encourage annual participation in this event, but for those who haven't experienced it, there are some things worth acknowledging...

The Hackathon is often won before the clock starts.

Putting in some prep work to ensure you're able to spend your time wisely and facilitate smooth development is just as important as the time spent during the 24 hour development marathon.

Here's how I'm prepping for the 2026 Sitecore Hackathon, plus some tips/advice I've been giving a few internal folks at my org who decided to form their own team of three this year.

The "How does it start?" part (because everyone asks)

There's no "opening ceremony" where Akshay descends from the ceiling with a pyrotechnic backdrop and announces: "YOUR CHALLENGE IS...CONTENT GOVERNANCE. GO GO GO!"

In reality, it's all rather...unceremonious:

  1. On the week before or of the event, you'll receive an email from the organizers with your team's GitHub repo (and some general participation / Slack / sharing info). 
  2. About an hour before kickoff (for me that's around 6 PM CT) you'll receive the email containing the year's categories/ideas. They're intentionally open-ended.

    Here are some categories we've seen come through in last few years:
    • Best use of Headless using JSS or .NET
    • Best use of SPE to help Content authors and Marketers
    • The best enhancement to SXA
    • The best enhancement to the Sitecore Admin (XP) for Content Editors & Marketers
    • Best enhancement to SXA Headless
    • Best Enhancement to XM Cloud
    • Best use of AI
    • Best Module for XM/XP or XM Cloud
    • Best Migration Module to move from XP (traditional) to XM Cloud/Content Hub One/Headless CMS
    • Show us what you got!
  3. At 8PM STC / 7 PM CST, the clock starts.

That said, there are several ways you can prepare yourself (at least a little bit) ahead of time.

Not by writing a full submission early based on a guess of what the categories might be (absolutely 100% don't be that team), but by doing everything else that prevents you from wasting 4 of your precious 24 hours on unproductive churn.

Some Prep Philosophy

Hackathon time is for ideation, execution, and shipping. It's not the ideal time for troubleshooting why your local Sitecore installation is failing on step 4...

My practical TL;DR prep advice here is basically:

  • Pick your likely build lane (Traditional XM/XP Module vs SitecoreAI Marketplace vs Sitecore PowerShell Extensions)
  • Pre-flight your local or shared environment 
  • Understand the required deliverables (README + video + submission mechanics; see the bottom of https://sitecorehackathon.org/sitecore-hackathon-2026/
  • Stock the fridge and snack pantry...it's a long 24 hours. 
  • Rest up beforehand...again, it's a long 24 hours.

Let's dive in!


Tip 1: Decide your lane early (classic module vs Marketplace app)

Up until now, choices for Hackathon development were basically limited to a custom C#, SPEAK app, Chrome extension, CLI tool, or SPE module (I'm sure there are other creative options not listed that teams had ran with successfully, though).

The biggest differentiator in 2026, especially compared against previous years, is that the Sitecore Marketplace is now publicly available; including established development patterns and starter kits.


I expect a good chunk of teams are going to build Marketplace apps (which are often just decoupled Next.js apps that interact with Sitecore APIs) since:

  • They're easier to demo
  • Easier to package and install
  • Don't necessarily require a full local "traditional Sitecore" installation to participate.

Someone asked me, "Can I contribute without being deep in Sitecore development?"

Totally. Especially if your team goes the Marketplace route, someone without a whole lot of Sitecore expertise can absolutely contribute towards:

  • API integrations
  • UI/UX/FED
  • Build pipeline + packaging
  • Project/time management
  • Quality assurance/testing
  • Documentation
  • Video production

...all of which can be done without needing a full local XP instance.

You do still need someone on the team to understand the extension points and how the app runs in a hosted SitecoreAI context...but you're not forced into the "I must stand up XP locally or I'm useless" camp.

My likely path this year: Marketplace-first (unless the categories strongly scream for an in-platform module).


Tip 2: Machine/Workspace prep

This is where teams self-eliminate during the early stages of the event. If you prep your machine properly, you can avoid unnecessary setbacks.

GitHub readiness checklist

Personally, I've always made sure to accept the invite as soon as it comes through, clone it locally, and confirm I can push a commit before the Hackathon starts. If you need a check list:

  • Accept the repo invite
  • Clone the repo down locally
  • Confirm you can create a branch
  • Confirm you can push (a tiny "Initial setup and access verified" commit the day before should do) 
  • Confirm you can open a PR (or push directly if your team is living dangerously)
  • Confirm your teammates can do the same

Now you know the pipeline works! No surprises at hour 3 when you're trying to figure out why GitHub thinks you don't exist.

Environment readiness: pick one

You need something you can build against and demo.

Option A: Local Sitecore instance

  • Docker-based XP/XM setup, or an IIS-based instance you trust
  • Verified you can deploy, run, and debug
  • Verified you can install your final deliverable cleanly (this matters more than you think since the judges will need to follow those same steps to test your submission).

Option B: Hosted SitecoreAI org / demo instance

  • Ideal if you're doing Marketplace app work
  • No local XP required
  • You still need stable access, a clean demo space, and time to validate the "deploy, run, test, demo" loop

If your team has access to an existing SitecoreAI org, set up a demo site ASAP and make sure it's accessible to your team.  


Tip 3: Familiarize on Concepts before Hackathon weekend

If you haven't built a Sitecore Marketplace app before, ideally you aren't waiting for the categories email to start reading docs.


My recommendation here is to:

That's really all you need. You don't need to become a Marketplace wizard to be successful. There will be plenty to learn along the way ๐Ÿ™‚

Bonus tip: Sitecore's Hackerspace workshop prerequisites from last year's Symposium might be useful in setting up your workspace with the right tools. If you can complete those ahead of time, you should be fine.

https://developers.sitecore.com/learn/getting-started/marketplace/hackerspace-workshop


Tip 4: Prep the whole entry, not just the code

Unfortunately, a good submission isn't just the code.

It's a combination of a:

  • Clean, working solution.
  • Clean, well-documented README.md.
  • Easy to follow installation instructions.
  • Strong video demo (5 minutes or less)
  • Public link(s)
  • Screenshots (optional, but usually worth it)


When you get access to your GitHub repo, carefully review the ENTRYFORM.md and SUBMISSION_REQUIREMENTS.md first and foremost.  Do as it says!

A default README.md will be present in the repo.  Make sure to include all of the necessary sections from the ENTRYFORM.md. It's up to you to make the final README.md impactful. 

Feel free to check out how I formatted my README.md last year - emojis and all ๐Ÿš€:
https://github.com/Sitecore-Hackathon/2025-Sitecorepunk-2077  

Video: prep the pipeline now

Video production always takes longer than you think. Always.

My past tooling approach has been:

  • OBS Studio for recording (screen + mic) - but you can also do something like a Google Meet or Teams recording to obtain demo footage.
  • Clipchamp / CapCut / whatever for stitching (intro/outro, trimming, music)

If you want to prep similarly, work on prepping the following:

  • OBS installed and tested
  • Mic levels tested (seriously)
  • You know how to crop your capture area
  • You have a YouTube account/channel ready to upload to.
  • You've tested uploading an unlisted video

Music note: obviusly don't use random copyrighted tracks only to discover the audio on your uploaded video is muted - or your upload is flagged.  I've always used my own music to avoid the "surprise, your demo is silent" experience.  Adding music is completely optional...extra credit if anything - but if you're in need of something quick, check out Suno to generate something simple.


Tip 5: Team strategy

I've done Hackathon in a team of three, but most years I'm solo. Both are totally viable.

If you're a team, you can either be wildly effective together...or you can get in each others way for 24 hours.

If you're solo, you can move extremely fast...right up until you realize you also need to write the README, record/edit/upload the video, update X again, and remember your own name.

First tip: assign ownership

Whether you have 1 person or 3, every major deliverable needs a single "owner."

For example, if you're a team of three

  • Builder #1 (project setup, core development): core functionality (the "it works" person)
  • Builder #2 (core development,feature developement, polish): UI/UX, integration glue, edge cases
  • Producer (Ship It): README.md, screenshots, docuementation, install steps, video, final packaging

If you're solo: you'll still need "roles" (you're just time-slicing them instead)

This is my solo approach: I rotate between Builder Gabe and Producer Gabe. If I stay in Builder mode for 20 straight hours, it can easily fall apart toward the end.

Works for both

  • Keep one visible TODO list. If it isn't written down, it doesn't exist.
  • Decide how you merge before you start (PRs vs direct pushes).
  • Get a demo working early.
  • Schedule breaks.

Tip 6: Ideation

People get hung up here: "But we don't know the categories yet...how can we plan?"

While you can't pre-build the final solution, you can pre-build the engine that will help you build during the event.

What I like to do in advance

  • Keep an idea bank of category-flexible utilities
  • Prep reusable scaffolding (config handling, auth patterns, basic UI shell, logging + error display)
  • Think in "building blocks" (reporting/insights, author productivity tools, governance helpers, integrations that reduce friction)

Then when categories arrive, you're not inventing a concept from scratch.


Tip 7: Physical prep

24 hours is a long time. Having the right balance of food, drink, and comfort is crucial.

For me, that's:

  • Drinks (water, caffeine, tea, soda, etc)
  • Snacks that won't wreck you at 3 AM
  • A solid Spotify playlist ready to go
  • Comfortable chair
  • A plan for breaks

(Also, the last couple of years I had worked 10+ hours before the start of the Hackathon. 0/10 would not recommend.)

If you can take the day off and actually rest beforehand, do it. Your 24 hours will be better, your decision-making won't be trash, and your final hour won't feel like you're editing a video underwater.


Tip 8: Build in public

I like documenting my 24 hours on X as a living TODO list + progress log using the #SitecoreHackathon tag.  

I found that this approach helps keep me accountable and motivated throughout the night.  Is it one extra thing to remember to do every hour/couple of hours while trying build?  Sure, but it also serves as a good pausing point to reflect and understand what my next steps are, all with the added benefit of sharing your experience with the community in real-time.  

Plus, you'll end up with built-in material for a post-event recap ๐Ÿ˜

Could you use LinkedIn? I guess you could...just don't expect anyone to see it on their feed for 3 weeks...


TL;DR Prep Checklist

1 week before

  • Pick your likely lane (module vs Marketplace)
  • Run the starter kit / sample app
  • Confirm your toolchain is good

48 hours before

  • Repo access confirmed
  • README template ready
  • OBS + video workflow tested
  • YouTube channel ready
  • Check that your development environment is still ready
  • Check Slack for a #hackathon channel to join

Day of

  • Rest
  • Eat
  • Do not do "one last thing" at work for 10 hours

1 hour before kickoff

  • Categories email arrives
  • Brainstorm ideas and pick one
  • Commit to a plan
  • Start building

Final thoughts

There are 32 teams participating this year, which is awesome to see!  The Hackathon is a great opportunity to learn, push yourself, and contribute something useful to the community.  It's also a great excuse to spend 24 hours building something cool and sharing it with the world.

If you're participating this year, drop your team name and which lane you're leaning toward.

Don't forget to capture some team selfies!

Good luck, hackers!

Tuesday, April 22, 2025

SPExAI Report Builder: A Winning Sitecore Hackathon Module

The results of the 2025 Sitecore Hackathon are in...

Look what I got! ๐Ÿ˜ญ๐Ÿ‘‡

It's a really decent piece of hardware!

I'm super proud of this accomplishment, given that I was pushing into delirium territory near the end of the event, having been up for 32 hours straight and all...running on mostly caffeine and adrenaline to get it done. 

Here's a snapshot of my real-time X updates throughout the event:



Sitecore Hackathon?

It's a virtual community-driven event where teams worldwide (52 teams across 13 countries this year) compete to build the most impactful Sitecore module given a set of categories (e.g., "Best use of AI" or "Best tool for XM Cloud") within a strict 24-hour timeframe.

Typically, the event is held in late February / early March, with teams registering roughly 4-6 weeks in advance. Submissions are then judged by a panel of long-time Sitecore MVPs and community members who review each completed entry, test the functionality, and collectively pick a winner.  

Submission Requirements are clearly laid out in the GitHub repository to which each team is assigned:

Winner Benefits

  • ๐Ÿ—ฃ Name recognition across Sitecore's official channels; the winning team is announced officially at SUGCON Europe and highlighted in the MVP community.
  • ๐Ÿ›’ $150 Amazon Gift Card (per team member)
  • ๐Ÿ† A customized Hackathon trophy

My Past Hackathons

Wasn't my first rodeo! ๐Ÿค 
Here's a rundown of my past Sitecore Hackathon participations:

The name "Sitecorepunk 2077" is a not-so-subtle reference to
the 2020 video game Cyberpunk 2077 (which, admittedly,
I've barely played, but I liked the play-on-words when I came up with it).

I kinda love that I'm a 2x Sitecore Hackathon winner now ๐Ÿ˜…


The Idea

This year, instead of multiple categories (and multiple winners), the organizer's idea prompt was simply:

"Free for all — you can create your own idea for the Hackathon solution. Show us what you got!" 

It was a huge opportunity to build without barriers, with one winning team to take it all. I've been waiting for an opportunity to bring this idea I've been mulling over in my head for months to life, and this was it. 

Problem Statement

The biggest hurdle for analyzing content and creating reports in Sitecore PowerShell Extensions (SPE) has always been the technical skill needed (PowerShell scripting/syntax + SPE-specific commandlets).  

You'd need to train up; learn how to query items using Get-Item and Get-ChildItem commands, declare an array object to store results, utilize for loops and if conditions, etc.  

And if PowerShell scripting isn't your thing, well...


In the age of generative AI though, this technical skills barrier can be dramatically lifted for non-technical Sitecore authors and admin, and/or drastically reduce the turnaround time for developers tasked with writing custom PowerShell reports.



Enter: SPExAI Report Builder

What is it?

SPExAI Report Builder is an installable Sitecore PowerShell Extensions module that allows users to describe their Sitecore report in natural language, which in turn generates a complete and reusable SPE script:

  • ๐Ÿง ๐Ÿ’ป Type your prompt
  • ๐Ÿ“œ๐Ÿ’พ Generate a PowerShell script and save it
  • ๐Ÿ› ️๐Ÿš€ Run it or modify it

"SPExAI" stands for Sitecore PowerShell Extension x Artificial Intelligence, which combines the power of SPE with modern LLM tech. 

Compatibility

SPExAI Report Builder works with Sitecore 10.x or later.  I tested on Sitecore 10.0, 10.3, and 10.4 during the event, but I'm pretty confident that it would also work with other versions, too.

I didn't get a chance to test this on XM Cloud, but given SPE's flexibility, it is likely compatible.


How about a quick demo?

Say you need to audit template usage across the content tree.

When activating SPExAI from the ribbon, a dialog appears where you set a title, select the root context for the report, and provide a description.

"Report of all templates (ID, Name, Path) and their usage count."



SPExAI generates this clean, complete, and reusable script, which is stored in a dedicated part of the content tree:

Running the generated script without any modifications (which, on its own, included an option to select a root context, making it easily reusable against different parts of the tree) provides an accurate result set!



Another demo!

"Report of all renderings (ID, Name, Path) and their usage count under a selected content root."

SPExAI again generates a clean, complete, and reusable script, stored again using the name provided:

Running the generated script confirms that the script has been correctly generated and provides expected results.  



What's truly amazing is that we can generate 75-100 lines of working PowerShell code in seconds.

The code is appropriately structured, cohesive, error-free, and ready to be run immediately—no developer needed!



How SPExAI Works (Under the Hood)

API Settings

Before anything runs, the module looks for a specific Sitecore item:
/sitecore/system/Modules/PowerShell/Script Library/SPExAI Report Generator/API Settings:

There are four required fields:
  • API Keyyour OpenAI secret key

  • Model – the ID of the OpenAI model to use (e.g. o3-mini-2025-01-31)

  • Knowledgebase – a markdown-formatted reference block full of Sitecore PowerShell examples, documentation, best practices, etc.  

  • System Prompt – the instruction template that tells the model exactly how to behave, respond, etc. 


The module will abort early if any of these are missing.

Model Selection

During development, I tried a few different OpenAI models. The one that gave me the most consistent, one-shot responses was o3-mini-2025-01-31.

If you want to try a different OpenAI model later, simply update the Model field with the name; no code changes are required. (Expanding beyond OpenAI to Anthropic Claude or Google Gemini is also possible as part of a potential future v2.)

The Knowledgebase

This field contains raw reference material to guide the AI's responses. Think of it as an internal code cookbook, mostly pulled from the official SPE documentation and a compiled generic collection of snippets from my private repository of PowerShell scripts.

It includes sample report formats, SPE-specific syntax, and usage patterns that the model should stick to when replicating and generating new reports.

Looks like this:

The System Prompt

This is the master instruction set. Essentially, "You are a Sitecore PowerShell assistant...you do this, this, and that..." with additional specific constraints and formatting rules.

It includes a {0} token that the Knowledgebase content replaces.

Check it out:


A good chunk of the hackathon effort was spent refining the directives that the model should abide by. With every test run, I found myself adding to the list of rules. 

Getting the model to stick to the directives was...challenging to say the least (one-shot prompting definitely has its limitations depending on the model).  

Finding the right combination of rules for the model to consider was tricky, and I'm sure both the base system prompt and the knowledge base content could use even further refinement beyond what I could get done before the deadline.  Either way, I feel like I struck a solid balance for v1.

The good news is that the module was built to easily modify the system prompt in the configuration item without touching the underlying code, hypothetically allowing you to continuously improve the final output. 

UX Flow

SPExAI provides a new button in the Sitecore Ribbon. When clicked, this button surfaces a dialog window for the user's input.  



Users fill out the Report Name, set the Report Scope (tree selector), and the Describe your Report fields.  

It takes only a few seconds for the script to be generated.  

Users are then presented with the following options:



SPExAI Code Breakdown

Here's how the pieces come together behind the scenes:

1. Load the API Settings

The script set the four field values into variables.


2. Present a dialog for user input

The user's inputs from the dialog (report name, scope, description) are stored as global variables.


3. Variable validation

Validate that variables, like the script name, are valid and don't already exist in the saved script location.

4. Invoke the custom `Invoke-OpenAIChat` function

Invoke-OpenAIChat sends a custom one-shot prompt (including merging system instructions, knowledgebase, and user input) to OpenAI’s Chat Completion API and returns the generated response.

5. Save the script to the tree

Upon successful script generation, the module saves all generated scripts under a dedicated folder:  /sitecore/system/Modules/PowerShell/Script Library/SPExAI Report Generator/Content Reports/Reports/SPExAI Generated

6. Open, Run, or Close Dialog
After saving the script item, the module presents a modal dialog with its three choices:

1. Open Script Item – jumps to the new item in the Content Editor
2. Run Report – immediately executes the report using Invoke-Script
3. Close – exits with no action



Video Demo

As part of the entry, a video demo is required. You can check it out here:



Some Final Thoughts

If you haven’t seen it, fellow long-time MVP Rodrigo Peplau compiled a list of this year's submissions - all worth checking out. 

The quality of entries this year made it hard to predict how things would shake out. Winning was unexpected, but also an absolute honor.

Bummed I couldn't be at SUGCON EU to accept the award in person, but luckily the announcement was recorded. ๐Ÿ˜€  I will cherish this screenshot for all time:


Each year I've participated (whether on a team or solo), I've come away with valuable hackathon experience and a solid module, or at least the beginnings of one, that I could share and expand on further. I've always enjoyed the satisfaction of shipping something interesting and useful to others under competitive pressure. 

If you’re considering participating next year, I highly encourage it.  About 20% of the teams are solo, but it's not for everyone.  I recommend grouping up with others, especially if it's your first Hackathon. 

It’s a great way to push yourself, learn something new, make connections, and contribute to the spirit of the Sitecore community.

Keep on hackin'! ๐Ÿ‘จ‍๐Ÿ’ป

Monday, May 20, 2024

Sitecore PowerShell Extensions Text-to-Speech Audio Synthesis Module

Another year, another exciting Sitecore Hackathon!  This round, I flew solo under the moniker "Sitecorepunk 2077" (a play on the critically acclaimed 2020 action role-playing video game "Cyberpunk 2077").


If you're curious how the event unfolded, I documented my progress on X (formerly Twitter) every couple of hours:













Needless to say, I was utterly exhausted and slept for 12 hours straight, following the 32 hours I had been awake.  While I didn't snag a win (congrats, team Cloud Surfers and team 451 Unavailable For Legal Reasons ), I enjoyed the experience, am proud of what I was able to output, and look forward to the next one.


Module Concept and Inspiration

The 2024 Sitecore Hackathon category I chose to work against was "Best Module for XM/XP or XM Cloud" - although the result could also fit the bill for "Best use of AI".  Inspired by the ever-increasing need for accessible content, I decided to develop a module that converts text content into spoken audio files, which are then stored remotely and saved as an MP3 links within the item's context - all from within Sitecore. Ultimately, once I landed on the idea, the goal was to provide an easy-to-use tool for generating audio versions of Sitecore content, thereby enhancing accessibility and improving user engagement for individuals with visual impairments or preferences for audio content.

Features

Here’s a breakdown of what makes the SPE Text-to-Speech Audio Synthesis Module stand out:

Lifelike Speech Synthesis from Microsoft Azure Cognitive AI Speech Services

One of the core features of this module is its ability to convert text content into lifelike speech. By transforming text into life-like speech, the module makes content more accessible to a broader audience, including those with visual impairments and individuals who prefer consuming content through audio.

The module utilizes Microsoft Azure Cognitive Services Speech Service to generate audio from selected text fields dynamically. This integration ensures high-quality, natural-sounding speech output. Whether it's a blog post, news article, or product description, every piece of content can be converted into audio, broadening its reach and enhancing user engagement.

Storage via Azure Blob Storage

To store the generated audio files, the module leverages Azure Blob Storage APIs. Once an audio file is generated and store locally in a temporary directory, it is then uploaded to a dedicated Azure Storage container. The API returns a URL to the audio file, which is then populated in the context page item’s Audio URL field. 


Interface and Custom Ribbon Button

A custom Ribbon Button on the Home tab streamlines the audio-generating process. This button triggers an interactive Sitecore PowerShell Extensions dialog where authors can configure various options, such as voice selection, field selection, and speech rate adjustment, and kick off the speech synthesis generation.


The customizable options ensure the audio output matches the intended tone and speech rate, providing a tailored listening experience.

Multi-Language Support

Recognizing the diverse needs of global users, the module supports multiple languages. For demonstration purposes and within the natural time constraints of the Hackathon, the following languages are supported in the initial implementation:

  • English (en)
  • Japanese (ja-JP)
  • German (de-DE)
  • Danish (da)

Each supported language selection has a series of Neural (lifelike, natural-sounding) voice options from Microsoft Azure Cognitive Services Speech Service (~449 neural voices to choose from). These hand-selected voices are configured to provide the best audio experience for each language. Of course, support can be expanded to include additional languages (there are 136 languages supported by Azure AI Speech Services).  


High-level Technical Breakdown

Initialization and Setup

The script sets up the necessary Azure services and local environment configurations.


User Interaction and Dialog Configuration

The script provides a dynamic interface through a custom Ribbon Button in the Sitecore Content Editor. This button, titled 'Generate Audio' or 'Regenerate Audio' based on the context item’s state, opens a dialog for configuring the audio output.  The fields and options available in the dialog are as follows:

- Field to Convert to Speech
  • Lists all Rich Text Editor (RTE) and multi-line text fields available on the item.
  • Special Case: If the 'Speech Content Override' field is populated, it appears as an additional option.

- Include Title?
  • A standalone radio button to include the item's title in the audio file.

- Voice
  • Dynamic option based on the item's language, the dialog offers preselected AI Neural voices.

- Speech Rate
  • Control the how fast the speech is spoken. 
    • Optional double value, defaulting to 1.0 if left empty.
    • Range: Between 0.5 (slow) and 2.0 (fast).

The dialog properties and user input handling are defined as follows:


Fetching and Sanitizing Text Content

The Invoke-AudioStreamFetch function handles the core functionality of fetching the text content from Sitecore, sanitizing it, and preparing it for conversion into speech.

The function checks if the title should be included and concatenates it with the main text content. It then sanitizes the text by removing HTML tags and special characters, ensuring clean input for the TTS service.


Sending Text to Azure AI for Speech Synthesis

As seen above, the sanitized text is then sent to the speech service endpoint for conversion into an audio file. The response, which contains the audio stream, is saved locally.


Uploading the Audio File to Azure Blob Storage

Once the audio file is generated, it is uploaded to Azure Blob Storage by calling the Upload-FileToAzureStorage function. This function handles the Azure Storage REST API authentication and the file upload process.


Updating Sitecore Item with Audio URL

After uploading the audio file to Azure, the script updates the Sitecore item with the URL of the audio file, ensuring that the content authors can easily access and manage the generated audio files.


Utilizing the Audio File on the Front-end

Once an item's Audio URL field has been populated, it can be used on the front-end within an HTML audio tag:




This is the simplest approach for playing the audio file, but further styling customizations are doable.


Video Demo

Part of the Hackathon Entry includes a video demo. You can check it out below:


Final Thoughts

Participating in the Sitecore Hackathon has always been an exhilarating experience for me, given the time crunch and competitiveness of the community. That night, the development of the SPE Text-to-Speech Audio Synthesis Module pushed my organizational and technical boundaries, and I'm proud of what I could accomplish in such a short timeframe. More importantly, I hope the resulting module helps highlight the importance of accessibility in content management and end-user experiences. 

If you're interested in or inspired to build your own Text-to-Speech synthesis module, the full PowerShell script and documentation are available on Github.

Thursday, April 8, 2021

Sentiment Analysis and Keyword Extraction using Sitecore PowerShell and Microsoft Cognitive Text Analytics

Sitecore Hackathon 2021

Well...wow, it actually happened...

I managed to snag a category win for the 2021 Sitecore Hackathon! ๐Ÿ˜…


This year, I unexpectedly flew solo as my team members could not attend (both due to completely understandable reasons).  Luckily for me, one of this year's categories, in particular, made me feel like I stood a chance: "Best use of Sitecore PowerShell Extensions to help Content Authors and Marketers."

YES. YES YES 1000x YES. 

Knowing that I needed to land on something fairly quickly to complete all submission requirements (a completed module with clean code, reliable installation instructions, a well-documented README.md, and a video) my evening began with a brainstorming session listing all possible routes I could take for the next 24 hours.  

I actually landed on a similar concept I posted about a couple of years back; interacting with Microsoft's Cognitive Services using PowerShell, then focusing on content translation. I knew Microsoft had continued to update their API offerings since that post, so I started digging into what was new.  I stumbled upon the Sentiment Analytics API, which seemed like an excellent use case that could satisfy the 'help Content Authors and marketers' category requirement.  

By providing the right combination of SPE user interactivity (modal dialogs, accessibility of the utility in the Ribbon, etc.), I could build a utility that analyzes content from a given field and provide a sentence-by-sentence breakdown of the content's sentiment score using AI.

After playing around with the example APIs in the browser, I decided to create my Text Analytics Cognitive Service in Azure, grab my API keys, and fiddle around with the API further in PostMan.  At that point, I felt pretty confident that I could integrate this with SPE. ๐Ÿคž

The Sentiment Analyzer would

  • Analyze the sentiment of field content directly in Sitecore.

  • Give Content Authors the ability to run an analysis of a given field's content, which returns an overall sentiment score and a sentence-by-sentence breakdown of each sentence's sentiment score and corresponding confidence scores.

  • The results are displayed using a Show-Result modal and rendered in an easy-to-digest format.

I built the user dialog, wrote code that generated the appropriate POST data to be passed to the sentiment API endpoint, built the functions to render the data (using emojis, of course ๐Ÿ‘ฉ‍๐Ÿš€), configured a new Sitecore template and the corresponding item for API key storage then tied it all together into an SPE module that exposed the tool from the right-clicked Context Menu, and from the Ribbon.

As midnight approached, I felt that I was in decent enough shape with the Sentiment Analysis script, I could begin exploring using another API in the same Text Analytics product group. I moved forward with a second tool utilizing the API's keyphrase extraction feature without a tremendous amount of overhead; mostly endpoint changes, JSON parsing, and data rendering differences. 

The Keyword Analyzer would:

  • Analyze a field's content to extract critical keywords/phrases.

  • Give Content Authors the ability to analyze a given field's content which returns a list of extracted keywords that can then be used to manually populate a meta keywords field.

  • The results are displayed using a Show-Result modal and rendered in an easy-to-copy format. 


I got started, but a couple hours later...


Then a few hours later...

I spent most of the day (alongside juggling sick-kids priorities) polishing the scripts I had so far; resolving logic issues, error prevention, adding code comments, and overall meticulous code clean-up.

Eventually, I had a functional set of utilities. 

Buttons in the Ribbon configured in the SPE module.


Dialog when clicking either utility against an item
with a Single-Line, Multi-Line, or Rich Text field. 

Sample output of sentiment analysis

Sample output of keyword analysis

I made sure to stop by for a late morning Coffee Break. ☕


I built the final structure of the SPE module using the Module Wizard ๐Ÿง™‍♂️ to configure my integration points.  The module also stores the API Settings item, so swapping in an API key would be seamless for anyone who installs the module.  


⚡ The module looked like this in the tree:




I spent the final hours of the event packaging the module/testing the installation steps before working on multiple documentation phases (using Markdown for absolutely everything in 2020 was really coming in handy).

It wasn't long before a mid-afternoon Twitter update:



The video production was probably one of the most challenging parts of this experience.  After writing a short-handed verbal script, I tried to record the entire demo in a single recording.  I used OBS Studio to record and the built-in Video Editor in Windows for post-production.  I even squeezed some personal music snippets I composed some time ago without risking Copywrite strikes on YouTube. ๐Ÿ˜‚

The video submission can be viewed here:

By around 5 PM, I was done and had submitted my entry ๐Ÿš€

The full Github submission can be found here, including the full source code for both scripts, the module ZIP for installation, and installation steps. 

Take it for a spin if you care to! ๐Ÿคน‍♂️

I'm really humbled and proud to have been a part of the winner's circle this year.  Another big shout-out to the folks who run and judge the event, as well as a big congratulations to the other category winners!

Check out the complete 2021 Sitecore Hackathon winners announcement here: https://www.youtube.com/watch?v=YEOy7lIDZUU

I'm already looking forward to next year. ๐Ÿ“†