A new random update is out...
What a great day is today!
A new random update is out and you're gonna read π§ about some new little improvements I made.
First of all let's go back to the Update 20201209#01.
The theme of that update was RSS feeds because I added to the discord server the capability to auto post figure skating articles in the π-gossip channel from a list of websites RSS feed's links.
All that was a huge improvement but not enough.
There are some websites that doesn't have a RSS feed page but they publish tons of interesting content every day.
So how to share their articles without a RSS feed or a dedicated API? π€·ββοΈ
Web scraping was the only solution I found and it was quite easy to implement too. The function only takes the link of the articles from a filtered page and post only the new ones.
I know it's a solution dependent on the style of the web page but I don't expect those big website to change the html of their pages so often.
For sure I will merge those check in the RSS check when a RSS feed link will be available.
A big slice of the figure skating daily news is written in Russian language π·πΊ.
This is not a problem in a normal context but the Figure Skating Stats Discord server's language is English π¬π§ so I need to provide english titles for the articles.
So how to translate something automatically?
Itβs kinda weird to say; using Google Translate that comes with some API I can use to get Russian titles translated in English without any effort π
And that is what I have done π <--(not that...the translation thing).
Yes you are reading well π!
As said in the last update I was working in beckground on the website.
The major update I've added is the blog django app.
As you can see reading this article, the website has now a blog section that allows me to write about new updates and things I'm working on π.
In order to achive this result, I had to add a django app, add new models for the database and of course write π» all the code.
I decided to use the MarkDown as way to write the articles.
I like it's minimalism and the way I can just run a python π function to translate it into HTML thanks to the markdown2
from markdown2 import Markdown
Markdown().convert()
MarkDown is also a good way to manage the articles if I need to export them.
Going into details, the features added are:
πWrite articles (just for me π )
π°Paginated article list preview
π¦Filter articles by category
π¦Filter articles by tag
πRead an article
As you know better than me, talking about surfing πββοΈ the web, today people use mobile devices more than desktop ones.
So a menu designed for small screens it's a need.
That's why I edited the navbar adding icons, colors and a new menu for small screens (less than 768 pixels in width).
Of course there are also other addition to the style here and there.
A thing that I've never done before was styling the scrollbar β. I think it's a cool thing to add.
And this is it for the second random update!
Cheers π
Author: Fantantonio
Date: 27-12-2020
Categories: service