PudlStack - Building Wagtail Affinity Group Communities That Offer Bot Helpers

This video is from Wagtail Space US 2024 in Philadelphia, Pennsylvania, USA.

PudlStack - Building Wagtail Affinity Group Communities That Offer Bot Helpers
0:17:58
Published July 19, 2024
32 views

I've set out to use Wagtail as a base cms to support a few affinity groups of personal interest. I'll demonstrate a proof of concept of using Wagtail to offer "bots for adoption" for affinity groups like my personal interest songwriters. Bots can be built with either UiPath or Python and served as content block types in a Streamfield.

đź’» Wagtail is the easiest open-source Python CMS to use:
Install the demo and start building your first site in 10 minutes: https://wagtail.org/get-started

📹 Related Videos To Watch Next:

â–¶ Quick Video Tour of Wagtail CMS 6.0 https://www.youtube.com/watch?v=_Vg_lPMipcQ
â–¶ The Latest on Wagtail AI https://www.youtube.com/watch?v=4zfs1u4Vy5Y
▶ What’s New in Wagtail CMS 6.0 https://www.youtube.com/watch?v=2AxLFyOFjQo

Wagtail future proofs your CMS system, as it’s open source, continuously updated and built on Python, one of the most popular global programming languages, used widely in machine learning and big data. So you’re always ahead of the curve when it comes to CMS platforms.

Wagtail is the #1 choice for accessibility, is scalable and most importantly, secure.

👉 Get started with a FREE Wagtail CMS TRIAL: https://wagtail.org/get-started
and see how easy it is to build a website that works for you.

📊 Read why Google, NASA, and the British NHS, are powering their digital estates with Wagtail: https://wagtail.org/about-wagtail/

🎥 More Wagtail Videos: https://www.youtube.com/watch?v=cne2kxemMAQ&list=PLfwZ-fob20cPvSQ_v1hkjto8BAPN21tLJ

📣 Follow us on social:

#WagtailCMS #Django #WagtailSpace

Transcript

2,440 words · auto-generated Show

Automatically transcribed, so expect mistakes in names and technical terms.

0:00

Right.

0:02

Speaker 1: So we'll dive just in. We've got a little bit more of a tight schedule today. Um Next up is my friend Anthony Garcia, who's one of our organizers today. So thank you very much for stepping up the plate and helping organize this year. This was Anthony's first year helping organize. which has been a big help. And uh his talk today is on Puddle Stack, Building Wagtail Affinity Group Communities that offer bot helpers. So I will get out of the way and let Anthony take it from here. Thank you.

0:30

Speaker 2: Thank you all. So my employer is UiPath, and Jana mentioned yesterday that the bots are coming. And I wrote this talk because The company is a billion-dollar company, but we don't get to tell a lot of stories about community. And I I thought it was a miss and I wanted to rectify that by coming up with some ideas here. So if you click on my LinkedIn, you'll see that I am not a programmer. I have a 31-year-old computer science degree that I've been trying to keep warm by by learning from people like Caleb. on how to code in Python and and the Torchbox

1:15

Speaker 2: for teaching me content management systems. So how did I come up with this idea? Well, so I'm a total girl dad. I've got three daughters. My daughter Maya is a game design student at Drexel. And my youngest daughter, Amy, she's a third degree black belt, but also a UIUX incoming freshman at Jefferson. So Raising the girls, I've got a third daughter who I'll talk about next. Raising the girls, we've had involvement in so many different affinity groups. Local music, the Catholic school system, karate.

2:00

Speaker 2: art, uh Special Olympics. We I I call myself the the forest dump of volunteering. As you can see here, I I'm at Penn volunteering for a Wagtail conference And uh uh it's a good way to meet people for sure. Uh Toastmasters, uh my wife is a a dentist from a foreign country and we uh were really adamant about why can't foreign trained dentists practice in the United States. So just things we're passionate about, we we joined affinity groups. One of the biggest affinity groups we've spent a lot of time on is my daughter, my oldest daughter, Alyssa's songwriting journey. She started

2:46

Speaker 2: learning how to play piano. You can see her Instagram there. Please follow her. And she started learning how to play piano at five. She lucked into a piano teacher who was also a songwriter and that started the journey in in the ten years that she has been On this journey, she has gotten some movies, some songs and some movies. There's a movie called The Starling on Netflix, that where she is the only unknown, unsigned uh artist. She's had mentorships with some of you some of the older folks might know Carl Palmer from ELK in in London.

3:32

Speaker 2: Danny Roebuck is an actor who was on The Fugitive. She's even gotten a chance through Drexel to Uh she won a chance to get mentored by Linda Perry, who's in the songwriter Hall of Fame. She's open for Crash Sys Dummies for Caleb in in Canada. That's a big band there, a couple members of the voice and through an organization associated with Penn She got to open virtually for Amos Lee, who is a local but famous, uh internationally known artist. So I have always been thinking a lot about how do I help affinity groups,

4:19

Speaker 2: particularly ones that are near and dear to my heart, like Alyssa. and the songwriting community in Philadelphia. So many of them have helped us. And so came up with this concept of uh music is the cure. It's it's something that my daughter's piano teacher used to always it was his mantra and so I bought music is thecure. org so he he couldn't take it from me and And we are are playing around and and of course uh we're using Wagtail. And Here's the here's the kind of the problem statement. How do we help Alyssa? She performs locally and on the interweb she needs to keep up social media because that's what artists do these days.

5:06

Speaker 2: And can we come up with a number of tools that that can help artists but be more prescriptive for music creators and by music creators? So I want to give a first demonstration. This is a concept of using UiPath to build a bot. The UiPath is a low-code environment. One of the things that we One of the challenges we face is the songwriters that don't know how to code. And then and then I think Tom talked about simplicity versus these barriers to entry. So I would like to demonstrate, you know, here is one way to do it.

5:52

Speaker 2: You could also do similar things using Python and Selenium to scrape websites. But The intention of this tool is to make it visually easy to do in a low-code manner, opening a browser. Going to a site here, I'm I'm plugging in a an argument of Alyssa's site as an example. And then grabbing the information, and in here, in this case here, just for this example, I'm just going to spit the information to a log. But I'll show you later how I 've implemented this into a bot, a more sophisticated

6:37

Speaker 2: bot. But so we're going to run this, and you're going to see a quick flash of her Instagram. page and I'll kind of explain what what's happened. So hopefully the demo does come up. I don't know if you saw that. Did you see the browser come up? Yes. Okay, so uh I left the browser so that it would it wouldn't disappear. And let me just move something out of my way so I can So I can grab that. So just just so just to uh explain, the bot is going to open this browser.

7:23

Speaker 2: It's going to go to this section here. One of the things I found is if this number is over 10,000, it'll just say 10k here, but there's an overlaying attribute that has the real number in it So UiPath is going and grabbing the attribute as opposed to the displayed value. And for me, for this example, just for this demo, I am just printing it out to the the output and it says follower count is equal to 2025. So one of the gaps that I saw with Instagram is like I want to see followers over time and I can't do that with an out-of-the-box

8:09

Speaker 2: account unless I'm like a big named artist. So what I've done in this case, and we'll go back to the presentation here Is I've taken UiPath and Again, UIPOTHA billion dollar company, but doesn't have a lot of stories about affinity groups and repurposed it to and re-envisioned it to be a component to Wagtail. uh that is going to serve bots, make a b an army of bots for uh people like songwriters.

8:57

Speaker 2: And how how would it work? Process wise how it would work is people would sign up for an account on a Wagtail site And they would visit a bot store and sign up for a bot. They'd adopt the bot that that spoke to them that could do something that they they do. And uh And how how do you get to bots that speak to you and do things you do? Well, you can contribute to ideation of bots that you might want to use. And from there you would log on to your page and you'd have a personalized dashboard that showed information that the bot went and retrieved for you So I'll move on since time is going

9:43

Speaker 2: a little bit fast. So in this case the architecture looks like this. People sign up for an account, that account Drives what we call a dispatcher, which is just a list of jobs for the bot to do. Everyone who signed up for a bot is going to get a couple seconds of this bot's time to grab their Instagram page for the day. Those Instagram followers are going to be written into a database and then available to Wagtail to retrieve through an API that is talking between UiPath and Wagtail. And a couple of the details behind that, that just real quickly, UiPaths, security tokens only last for an hour.

10:30

Speaker 2: So I have a little cron job that's just refreshing the token before it before it runs out of time. The dispatcher is grabbing all the people that are signed up for that bot. The performer is going to each of those persons Instagram page and grabbing the counts. And then on the Wagtail side We're we're reading the Instagram count. We've got a little customized block in Wagtail that is going to One, uh, Google Gemini, do an analysis of the JSON that's coming back about the last 10 days of follower counts. And then it's going to present in in a chart-based form and also a visual form, which I think Jana

11:16

Speaker 2: , I was kind of inspired that Jana had talked about, well not everyone can see what a chart looks like And it's going to render a Wagtail block with an Instagram follower count, historical count. So now we're here to another demo. And on this demo, I want to show you kind of what the Wagtail side looks like. So on the wagtail side, the end result is going to look like this. It's going to be Personalized for Alyssa, it's going to be the last

12:02

Speaker 2: ten things the bot grabbed. In this case I I had this bot off for a long time and then I ran it last night So you can see a big jump in her followers. And then the bot is I've I've written a prompt for the bot to explain what the what the chart looks like. And again, I am a big beginner wagtail person, learned a lot through the Wagtail Slack, through Caleb 's. uh learn ragtail and uh udami course on full stack python development and And uh so this is what I came up with as the idea of one bot of possibly other bots that we could build

12:48

Speaker 2: to help songwriters. And uh here's kind of what it looks like on the admin page. You can uh add a stream field uh called UI path And the idea here is you could you could put some introductory information and things like that. In this case I was experimenting with just plugging in a different Instagram account, but programmatically in in the real vision of things you wouldn't have to plug in the Instagram count. It would know based on your Wagtail login which Instagram to use. And uh let me just uh close it out here.

13:33

Speaker 2: I think I'm running out of time So yeah, the benefits are that eventually this these bots could be like your your AR person. They could help you plan a tour, they could help you collaborate with other members and and if you know about the thousand true fan fans, if you want to be a sustainable artist you've got to have a thousand true fans that can give you at least a hundred dollars a year. So that's that's kind of the goal and the idea and the vision for this. And with that, I'm going to leave it with a link to my GitHub. So if you wanted to download the code and the presentation, you're welcome to do that. I wonder if anyone has questions.

14:30

Speaker 3: I I mean that's how much work it looks pleasant. Looks amazing. Very cool. How how much work is it to add an e bot? Like have you got a framework for that yet or um is the e spot like kind of quite individual

14:43

Speaker 2: Um so so uh so each bot would have this dispatcher performer concept and And it's fairly templ cookie-cutter type, you just follow this the same kind of pattern And the the idea would be yeah, the uh the the bots could scale if you if you got a thousand users, uh you could you could um run them over multiple robots and because uh the the way the pat the dispatcher performer pattern works uh it doesn't care If you're running things simultaneously, it's just pulling the next job off of the list of jobs to do. I don't know if that answers your question.

15:30

Speaker 3: Um it's clear that each bot kind of stores data in my palette, you have to store the historical performance, for example. How are you doing at the moment? Like is it a hard coded one for me to watch? Oh, okay.

15:42

Speaker 2: That that's a great uh qu that's a great question. So So UiPath, at least in this case, UiPath has a database as part of its platform. And I have a let's see. I have a table called um signups And I have a table call uh so this is a table called signups and and if you take a look at the data, I've got four different Instagrams that I'm running by. And then I have another table called following. And this table just holds all of the followers that were grabbed

16:29

Speaker 2: And then the query just grabs the last 10 retrievals.

16:34

Speaker 3: So it's not saving over the whiteout side, it's always querying over the other

16:37

Speaker 2: side. That's right. That's right. I could figure out how to do it on the Wagtail side with again Selenium and and Python and and some kind of a database.

16:47

Speaker 3: No, I was just interested in whether you were kind of querying each spot run saving and I don't know whether you were querying them directly. Is that that's

16:54

Speaker 2: I was yeah I was querying them I'm querying them directly and they're just being stored here Uh this this implementation has been a derivative of of many different talks I've done. I think my whole point is to get to Alyssa who's in the back of the room. followers for her Instagram. Why didn't you put your output to the Instagram?

17:25

Speaker 3: It says it looks

17:27

Speaker 2: It's in there, it's in there. It's in it's in the PowerPoint. So so thank you, and any other questions All right. I appreciate uh everything and uh I'm I'm glad I I was able to do it.

Questions this talk answers

How does the bot read Instagram follower counts above 10,000?

When Instagram displays an abbreviated value such as “10k,” the UiPath bot reads the underlying page attribute to retrieve the actual count instead of relying on the displayed text.

Discussed at 7:23

How can I track Instagram followers over time with Wagtail?

A UiPath bot periodically reads the Instagram follower count and stores each result. Wagtail retrieves the latest counts through an API and displays the history in a chart with a generated summary.

Discussed at 8:09

How does the Wagtail bot system collect and display data?

Users sign up for a bot, and a dispatcher queues their accounts for a performer to process. The results go into UiPath’s database, then Wagtail reads them through an API and renders them on a personalized dashboard.

Discussed at 9:43

How difficult is it to add another bot, and can bots scale to many users?

Each bot follows a reusable dispatcher-and-performer pattern, so adding one is fairly template-based. The dispatcher can hand out jobs across multiple robots, including running them simultaneously.

Discussed at 14:43

Where does the bot store historical Instagram follower counts?

In this implementation, UiPath’s database stores user signups in one table and retrieved follower counts in another. A query fetches the most recent ten retrievals for display in Wagtail.

Discussed at 15:42

Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.

More videos from Wagtail Space US