Translate README files in reStructuredText with Sphinx reStructuredText (reST) is a markup language that is popular in the Python developers community. reST is the standard markup language for docutils, Sphinx documentation generator, and the Python Package Index (PyPI). However, reST by now is still not popular enough. Most translation platforms, including Crowdin which I’m using now for EH Forwarder Bot, have no support to reST documents. Sphinx has provided a plug-in sphinx-intl, which extract strings from reST documents and compile into GNU gettext message catalog template (.pot) files, and build new documents with translated strings in other languages. GNU gettext formats are widely accepted by translation platforms, making our life much easier. This would work out-of-box if you are generating HTML or PDF documentations, but not so simple if you want a reST output. Continue reading Translate README files in reStructuredText with Sphinx
Splitting a Large Class and Multiple Inheritance in Python When I started refactoring EFB Telegram Master Channel (ETM) for 2.0 updates, I was investigating ways to organize code into different files in a decent manner. In this article I’d like to talk about the strategy I used, comparing to another codebase I was reading back then, itchat. Continue reading Splitting a Large Class and Multiple Inheritance in Python
RWG: an Experiment on Semi-Automated AI (?) Agent for Genkai Shiritori Mobile Few days ago, a new game, Genkai Shiritori Mobile (GSM), was released by Baton Co., Ltd. and a web media and YouTubers team QuizKnock. Shiritori is a traditional Japanese word game where each player says a new word that starts with the last letter (or rather kana) of the previous word. Genkai Shiritori is a game originated from QuizKnock where they added a few new rules on top of the simple Shiritori game, including: Including a random factor of playing cards: the next player must say a word with the number of kanas on the card drawn.Time limit: each player has a total of 5 minutes of time per game After the Genkai Shiritori video series has gain popularity on YouTube, QuizKnock then modified the rules further and made into a mobile game. This article is introducing my analysis, attempts and thoughts on building a semi-automated AI (?) agent, which I later named it as Random Word Generator. Continue reading RWG: an Experiment on Semi-Automated AI (?) Agent for Genkai Shiritori Mobile
What’s so new in EH Forwarder Bot 2 (and its modules) After almost a whole year, EH Forwarder Bot 2 has finally more or less finalized its features and structures. Most of the modules have also entered beta stage together with the framework. This update will be a lot different from the previous version, and as suggested by the semantic versioning, it will not be compatible with the previous version. So, I think it should be the time to introduce about the new features in EFB v2. Continue reading What’s so new in EH Forwarder Bot 2 (and its modules)
Obfuscate PDF Text: Scramble Copied Text with Crafted CMap Notice This does not prevent your PDF from being copied. OCR nowadays is pretty advanced.Backup your document before you do anything.The author does not encourage plagiarism in any form. Continue reading Obfuscate PDF Text: Scramble Copied Text with Crafted CMap
My Telegram mini toolkits (zh-CN) Abstract My first submission to “Matrix”, a private product sharing platform built by SSPai (in zh-CN). This article introduces some of my recent bots or project related to Telegram, including the following stuff: EH Forwarder Bot: an extensible tunnel bot framework. Big Text Bot: A pure text sticker Telegram inline bot. Source. BankComm Rate Monitor: Log, monitor, and alert for exchange rate from Bank of Communication. Source. Telegram Sticker Removal bot (tg-cli interface): Remove stickers from group chat with 60s TTL. tg-cli and normal user account required. FanfouBot (电磁炉): A Fanfou tweet bot on Telegram (@FanfouBot) Continue reading My Telegram mini toolkits (zh-CN)
Idea: Group Chat Tunneling (Sync) with EH Forwarder Bot EH Forwarder Bot (EFB) is an extensible chat tunneling framework written in Python 3. GitHub. EFB is mainly designed for gathering messages from many other platforms to the one platform, but also designed with other types of tunneling in mind. In this article, I’d like to introduce how EFB works now, and how to design channels for group chat tunneling with utilizing available channels in EFB. Here “group chat tunneling” means synchronizing messages across several groups in different platforms. Continue reading Idea: Group Chat Tunneling (Sync) with EH Forwarder Bot
EFB How-to: Send and Receive Messages from WeChat on Telegram (zh-CN) 安装并使用 EFB:在 Telegram 收发微信消息 Abstract This article is a tutorial on how to install EH Forwarder Bot on a VPS server, with Telegram Master Channel and WeChat Slave Channel, alongside with simple exmaples of how to use it. Targeting WeChat power users in China, this article is written in Chinese (zh-CN). For installation manual in English, please visit the documentation. Continue reading EFB How-to: Send and Receive Messages from WeChat on Telegram (zh-CN)
The Making of: Lyricova Screensaver v2 It has been long since last time I post here. This time I’d like to share about how I made the Lyricova Screensaver v2: refractor from my own legacy code. Continue reading The Making of: Lyricova Screensaver v2
Documents from StuDocu without watermark Trying to download some documents from StuDocu, namely those past papers and slides. Even you can easily get free premium for months, but there’s always annoying watermark blocking your vision. Really I have tried to write a script to programmatically remove the watermark, but PDF is Evil. So, I kinda worked out a workaround, generate PDF from the webpage. Continue reading Documents from StuDocu without watermark