21 November 2020

Blog improvements

Over the past few weeks I've been improving and adding some things here in this blog. Each of them is a minor script/change, so I didn't found necessary to create a post for that, but now that the number of changes is moderate I felt like writing about them.


'Usefulness' page form

There is now a small form at the bottom of the page (left bar in desktop mode) so you can say whether you found a page useful or not, with an optional comment. It is as easy as pressing a button, and the answer is sent through google forms (google forms has a feature that allows anyone to send a response simply by visiting a page, so when you press a button that petition is performed in the background via a fetch command). It even works anywhere in the blog, even in search pages!
As of now I received 76 'yes' and 28 'no', most of them on the click to chat addon page. I may post in the future more statistics (tell me if you would like that).

Collapsible comments

This was something I personally wanted, the comment section at the bottom is as long as the amount of comments, and some pages have a loooot of them. This made very long pages and hard to scroll all the way to the bottom, and I'm sure people didn't even know there is some info there. When I added the usefulness form this was even more noticeable. So I simply made the comments element hidden, with a toggle button at the top. It is collapsed by default, press the button and the comments will be shown, press again to hide.

Filters in menu

A few years ago I had some of the important apps in the blog menu (the horizontal bar at the top with an arrow at the right, or the top bar with buttons in desktop mode) however I needed to add manually new apps there, and it was boring.
Then I found that there is a blogger widget that shows a list of all the tags in the blog, and when clicked it shows only the posts with that tag. I tag every post with the app it represents (with the exception of the blog tag, for posts like this) so this is a very useful way to display the apps I published (not all, but those I actively develop) and it's even sorted!
The issue is that this list is shown as a separate element, at the bottom (left in desktop) and I didn't like that. So I made a script that converts the automatically populated widget list to entries in the bar menu.
Now you can quickly see all posts of a specific app simply by selecting that filter from the menu, and it will be automatically updated with new apps/tags so I don't need to do anything! 

Fixed date on top of menu

Just a quick fix, but worth mentioning. In the mobile mode, when viewing a single post, the date at the top was displayed above the menu entry and it looked bad. I found the culprit css and patched it.

Pro-adblock message

This blog has a 'you should use an adblock' message at the top, which should not be visible if you use one. However, even if you do, you may have seen it in the past. The way this message works is by simply 'look' like an ad (which adblocks remove) however the list of ads they block is not static and changes over time, so I need to update it when the current method no longer works.

Arc-io

Arc-io is a service that 'helps build a faster internet with fewer ads'. It acts as a distributed CDN (content delivery network) in which users visiting the page can get page elements (images, scripts, css,...) by other users, instead of all from a centralized server. And it only ads a blue circle at the bottom left, no ads, no banners, nothing else. At first I was like 'using your bandwidth to share code to other users? no way' but after some checking and investigation I found its not as bad as it looks, and 'apparently' it only works with desktop users or under wifi. In any case, if you don't like that service it is automatically removed with adblocks (that you should have) but if for some reason it is still show for you and you want to disable it you can from the 'opt-out' link after pressing the blue icon, which redirects to here.
And what do I earn? The service pays you for the traffic (because companies pays them for the faster internet). Note that it is a very low revenue, 4$/month more or less, and I keep it because of the no-ads alternative it represents.
Another interesting fact is that this service requires you to set a specific file in the root of the site. Blogger don't allow that, however I discovered that you can embed an iframe with the arc-io widget from another site, and it will work! I currently have arc-io on my personal trianguloy.github.io page, and that's why when pressing the circle it says 'github.io gets a boost' instead of 'blogspot.com gets a boost'.