One common use of GenAI is to use it to write ad-hoc scripts for exploratory tasks.
The kind of task where we are not exactly sure where we will eventually reach, but we
just want to try a few things to see where it kind of goes.
To bring context to it, I'll talk about one exploratory task where this went really well
for me.
So, I had this tool to check server-side rendering on my website for a couple of years where
someone can come in, they enter a URL and see if it does server-side rendering alright
or no.
But I have not kind of tracked its usage or how people are using it for, you know, anytime.
All I do is I have a log file where whatever URL is it and its timestamp gets stored on
the server, but that's about it.
So, I was kind of curious to see how people have been using it, what its usage looks like
and yeah, for purpose I thought I'll kind of generate some sort of report and see what
I get out of it.
So, before we talk about how GenAI came in and how it helped me, this is the report that
eventually came out of it.
I was able to get a calendar view of like how this gets used over the months every day.
I was then also able to get stuff like the trend over the days, over the months, over
the weeks to see how it is growing, stuff like its repeat usage, like, you know, how
frequently it gets used, you know, in a given month and how this frequency of usage kind
of changes over a period and that sort of stuff.
So, the interesting thing was I did not have all of this what we just looked at sorted
at the outset, but as I kind of used GenAI and I was kind of exploring things, you know,
some of the questions came to my mind and that kind of eventually helped me build this
sort of report.
So, let's look at how something like that calendar view was generated, which was the
first kind of report I generated.
I mostly use cursor and we can use anything else, different models will not go in detail
here, but this is the cursor instruction I provided to GenAI.
I have a log file containing log entries like those shared below.
I want to create a calendar view showing the count of URLs for the day.
This needs to be in HTML.
The calendar view needs to show monthly calendar with name of the month on top and days of
the week underneath and dates of the month, so on and so forth.
I then provided it a bunch of log file entries from where it needs to read so that it gets
the format.
I actually also provided it name of the log file, which was also present on my system.
So, it went ahead and actually look for the log file.
It read the log file entries and then generated the code.
I found some issues with the code and then something was undefined, we started to fix
it.
So, every time it would make a change, I would accept it, run and look at how the log would
look like, why was I seeing some errors.
There was obviously quite a lot of to and fro.
I'll just show some other examples like, you know, the counts for Jan 2025 were all wrong
at some point.
So, I asked like, can you check why it went ahead and looked at it.
Then some other counts were wrong or the day of the week was incorrect and these kinds
of things.
And then there were places where like despite me providing multiple prompts and attempts,
it wouldn't wasn't able to fix.
So, I went in and kind of address some of those changes.
You know, so it wasn't exactly this guy just floating through and writing all the code.
But the point was because I was able to quickly make these changes, then try it out and then
go and prompt.
It was more jointly working together and getting this sort of report.
And once I got this report, I started to have more questions and then I wanted like a different
report so on and so forth.
So, I think maybe across various days, as my thinking was evolving as to what I wanted,
I would have spent maybe six to eight hours getting all of these various reports and maybe
this will evolve for me to extract a lot more out if I want to.
But the important point is that because this friction to generate this sort of thing is
pretty low.
I'm a lot more inclined to just create something, let it sit and then later think what else
I want to do with it and so on and so forth.
So, that's the interesting thing that has kind of come out with, you know, having GenEI
as part of the overall workflow here.