Last week I bought myself a long-sought-after Sony PRS-300 e-book reader, a review of which I can write separately. This reader suits me all, but
lacked the ability to read rss news, as the morning is much nicer to spend with a newspaper, drinking coffee in the kitchen on the weekend or
during workdays on the road for work or institute in public transport. For several evenings, I wrote a small qt application that solved this problem, and I will write about it later.
YourOwnNewsMaker is a simple application written in qt / c ++ that allows you to create pdf, the design of which you can configure yourself from the rss news feeds you have chosen.



Why did I choose pdf format?All e-book readers are friendly with this format without any problems, besides, if you do not have a reader, you can simply print a pdf file, then read the news from the paper, which is also
quite comfortable. And in the next versions of the application, I plan to add support for the fb2 format. I don’t see any sense in supporting other formats.
The basic principle of the application.After adding rss to the application, you can delete uninteresting news from the “content” list by pressing delete. Pressing the update button will update the selected stream.
news or update all news if selected is not. Further, when you click the pdf creation button, each news is downloaded entirely, and then, if there are settings for the news site
Content is parsed.
')
A little more about how to parse the contents of the downloaded page.There is a page-templates directory in the application directory. It already has two ready-made properties files for Fontanka.ru and Habrahabr.
- The file format is as follows:
- rss.host is the host of the site from which the news content is being downloaded.
- content.pattern - a template for finding the direct content of the news (the template is essentially a Perl-like regular expression).
So Habr has all the content between the tags <div class = "content"> and </ div>. It’s a little harder with the fountain
since it uses several nested div tags, so I had to specify this in the template. - clear.html - a flag that takes values ​​true / false, indicating to clear the received content from html tags.
- news.html - is responsible for the appearance of the entire contents of the file (as webkit is used to generate pdf, javascript can be used for additional actions with the contents, for example, to reduce images).
- channel.html - the appearance of news from one rss channel.
- item.html - the appearance of a separate news.
<! - ITEM_CONTENT -> and similar tags are replaced with content, so you should not remove them from templates.
An example pdf file can be downloaded
from here .
The application itself is downloaded
from here . There is a build for Windows and for Linux (for linux, binaries were built using qt 4.5, so the application should work on all distributions without problems).
Unfortunately for Mac build I can not do it, because I can not imagine how to test the application. The sources are open and distributed under the GPL license.
There are several bugs, for example, I do not check the rss news link and the results can be very different, the application also behaves inadequately if there is no Internet connection or is lost, which will be fixed in future releases.
If you liked the application, then I will not refuse PayPal donate)