For a while now I have had an idea that the Greenpage could use a display that shows what the top sources are for the page. During the academic year I post 60 articles a week. It seemed like a nice feature would be to have a display that showed where the majority of the posts were coming from - with a link. It also felt a little bit like an informal attribution; an additional plug for the source publications that were filling out the page.
I've probably had this on my to do list for more than a couple of years. It sat there unexecuted because I figured the coding I would need was beyond my ability. I had noodled around with the idea of tasking it to a student assistant with programming chops or maybe looking for someone elsewhere on campus. There had to be someone in the community that could do it.
Today I asked Gemini. I've been thinking about how to integrate AI applications into what I do. I keep seeing stories saying that if you don't come up to speed using AI assistants you will be helping to obsolete yourself. I actually started a few days ago by asking if the assistant could craft some automation around the comments students do for class. Years ago I had student assistants read and correct every comment for spelling and grammar. It proved to be a tedious, repetitive, thankless task (beyond being paid - that's another post). The nature of the thing meant it wasn't too long lived as a student assistant task. I wondered if an AI assistant could give me a way to automate it.
Suffice it to say that the assistant totally thinks it can and it showed me sample code to get it going. The process requires integration of Blogger, RSS, Google Sheets, and Gmail - plus a third party grammar checker. Reading the responses from Gemini made my head hurt and reminded me just how far we've come from 10 PRINT "David "; :GOTO 10. I was going to need a little bit of a ramp.
That lead me to think about the page display I wanted to add. So I started again and took a swing at that.
This one turns out to be a lot less complicated, initially only working with Blogger itself. There was however an initial bump in the road. The Newspage Blog has nearly 60,000 posts since its inception. Doing a gadget in the blogger template doesn't rally come with any memory or storage, it does everything in real time. That meant in a simple application the gadget on the page was going to have to count the instances of each source on the page for all 60k posts on every page view. That felt... stupid. I am sure there is a more complicated solution where I could do a Google Sheet with historical data and a script where every day it updates the count based on that days articles. That way the gadget would just have to look up one set of values on the page load rather than do the actual counting. But that felt like it was leading down the road I had been on before and abandoned to get to here in the first place. So I moved the goalposts.
The new display would show the most commonly used sources in the past 30 days. This is a little more complicated as it requires using the ATOM feed, but that was already set up anyway. You can still see the process thinking, but it doesn't need to chug the way it would have for the original idea. Once the new result set was defined the work was mostly about stripping out the formatting Gemini thought made the output look good. It wasn't wrong, but to get it to show properly in the existing blog template using the very least amount of formatting made the most sense.
Which leaves us with:
TADA!
Which I guess is current and will update here as the page updates as well. I will have to monitor it as the posting numbers go up in the fall and as the queries go up with the increased page views but based on the tools involved I don't think it should develop any problems. I guess we'll see.
It isn't exactly what I was looking for. But I guess it is a nice improvement and a decent first step.
No comments:
Post a Comment