Own selection of news for reading on the go in a couple of minutes

    Last week I bought myself the long-awaited e-book reader Sony PRS-300, a review of which I can write separately. This reader suits me all, but
    lacked the ability to read rss news, as it is much more pleasant to spend the morning with a newspaper, drinking coffee in the kitchen at the weekend or
    during working days on the way to work or college 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 qt / c ++ application that allows you to create pdf, the design of which you can configure yourself from the rss feeds of your choice.






    Why did I choose pdf format?
    All e-book readers are friends with this format without problems, in addition, if you do not have a reader, you can simply print a pdf file to read news from paper later, which is also
    quite convenient. And in future 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 news uninteresting to you from the “content” list by pressing delete. Pressing the update button will update the selected
    news stream or update all news if there are no selected ones. Then, when you click the pdf create button, each news is downloaded in its entirety, and then, with the settings for the news site
    , the content is parsed.

    A bit more about how the contents of the downloaded page are parsed.
    In the application directory there is a directory "page-templates". 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 downloaded.
    • content.pattern - a template for finding the immediate content of the news (the template is essentially a Perl-like regular expression).
      So at Habr all content is between tags and 
    . Everything is a bit more complicated with the fountain,
    since it uses several nested div tags, so I had to specify this in the template.
  • clear.html - a flag accepting true / false values, indicating to clear the received content from html tags.


    • news.html - is responsible for the appearance of the entire contents of the file (since webkit is used to generate pdf, you can use javascript for additional actions with the contents, for example, to reduce images).
    • channel.html - appearance of news from one rss channel.
    • item.html - the appearance of a single news item.


    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, I can’t build it, because I don’t know how to test the application. Sources are open and distributed under the GPL.
    There are several bugs, for example, I do not check the rss news link and the results can be very different, and the application behaves inappropriately in the absence or loss of an Internet connection, which will be fixed in future releases.

    If you liked the application, then I will not refuse PayPal donations)

    Also popular now: