Javascript is a weird language and today as I was changing stuff on the admin side, I caused a bug in the pagination of the posts where it normally outputs a selection and elides the majority of the pages. Instead it was giving me all 25 pages. It was because I was grabbing the current page from the URL, so javascript was seeing the number as a string. One 'parseInt()' function later I've got it fixed, but it took me a while to debug this one silly thing.
Alright, I'm calling it a wrap on development today. Probably a total of 5 hours spread over the day. But tagging is probably 80% done. The biggest feature still to do is make tags have their own templates, so people could follow the "us politics" tag or something like that. Those get complicated because long term you could end up with tags with hundreds of entries. So I'd need to paginate them, which is more complicated.
I am also working on how I go about tagging, choosing keywords and ideas. I have decided I am not going to put people's names in as tags, but I will do it for other proper nouns such as countries, etc.
I wrote the code for automated tweets to grab the tags from all of those posts and take the top 3 tags to be mentioned in the tweet in hopes of making it more interesting to people and driving more engagement. We will see how it goes.
This morning's coding project is to finally begin adding tagging. I mapped it out in my head last night into this rough "to-do" list for the devwork as follows:
- Admin UI - 70% - Mostly done, spent an hour or so figuring it out and watching tutorials online.
- Backend - 10% - I have the table structure, now I just need to make it submit the tags and then the backend to process and tag
- Admin tag suggest - 0% - Suggest as you type completion functionality of existing tags, I conceptually know how to do this but haven't done any implementation
- Modify editing post to properly handle tags - 0% - More admin-side work, if I modify a post it needs to load that post's tags.
- Templating integration - 0% - Add tags to entries, and then add tag template pages
- Going back and tagging old posts - 0%
I suspect I might get to the third item this morning, we'll see. After doing this I think I will prioritize code cleanup and organization as things like the admin javascript are getting a bit unruly.
Update: Three-ish hours of work and I'm mostly done with the first four to-dos. Next will come templating it and then going back and tagging old posts which will be arduous. But this is a good stopping point.
As Glowbug continues to be my pet project, last night I coded in functionality to enable easy sharing from my phone. I use an Android device, so the workflow (for now) makes use of Tasker and AutoShare (a plugin for it) to call a custom endpoint on the webserver. It is still not a 100% process, as it turns out Android sharing is a pretty messy thing and is not standardized as nice as I would like. But I've got a working structure for now.
At some point I'll probably code a simple Android app that acts as a sharing bridge, solely existing to take the text and dump it into a webcall to the server. But for now, the Tasker + AutoShare functionality gets the job done.
Glowbug Development & Commit Updates
The recent commits to Glowbug's Github:
- Speed up frequency of server pings for new posts - This was a small admin side fix which increased the frequency of server pings checking for new posts, from 5 seconds to 3 seconds.
- Image manager Page introduced - As discussed earlier tonight, another admin side implementation.
- Moving to Google Analytics - I had previously tried to use a self-hosted site analytics tool but found it lacking in my current structure. So I moved to Google Analytics as a temporary tool. At some point I'll code my own analytics tool as well.
- Fixed bug which would tweet when saving a draft - I accidentally discovered a bug that a tweet went out when saving a draft. This commit fixed it.
By far the biggest of these was the image manager implementation. I don't currently plan for any major coding, we'll see what comes up.
Last night's coding was to give Glowbug some additional functionality around images:
First, I coded the upload to shrink any image upload to fit within a 1024x1024 square. Secondly I coded an image manager page that lets me see all the uploaded images, and gives me the easy ability to delete images as well as rename them. Renaming them changes the file name and then looks for posts which referred to that image name and changes it to point to the new name.
Just some more admin functionality. I still want to add ability to rotate images, since I want to do more uploading pictures from my phone and I suspect that will be an issue.
What started as a small quicklinks project, then was renamed to 'Blips' as I seek something to replace Twitter as an easy way to drop small thoughts, has been renamed 'Glowbug.'
Years ago I had plans to make my own complete site CMS, and that was called 'Glowbug' at the time. It quickly became evident that Wordpress and other offerings were far more robust and beyond what I could do. But here we are, coming full circle, as I build my own little tool out.
