Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
pull_request:
types: [opened, edited]

permissions:
actions: none
checks: none
contents: none
deployments: none
issues: none
packages: none
pull-requests: write
repository-projects: none
security-events: none
statuses: none

name: "Mark Final Task"
jobs:
label_regex:
runs-on: ubuntu-latest
name: Add label
steps:
- name: "Assign label to Final Task"
uses: Bhacaz/label-regex@v1
with:
field: title
regex: '(?<final_task>(F|f)(I|i)(N|n)(A|a)(L|l)[ -]*(T|t)(A|a)(S|s)(K|k)).*'
lowercase: true
token: "${{ secrets.GITHUB_TOKEN }}"
100 changes: 100 additions & 0 deletions IrinaMinasyan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
## RSS_Reader
RSS reader is a command-line utility which receives RSS URL and prints results in human-readable format.

**Utility provides the following interface:**

```
usage: rss_reader.py [-h] [--version] [--json] [--verbose] [--limit LIMIT]
[--date DATE] [--to_html TO_HTML] [--to_pdf TO_PDF]
[source]
Performs a variety of operations on a file.

positional arguments:
source RSS URL

optional arguments:
-h, --help show this help message and exit.
--version Print version info.
--json Print result as JSON in stdout.
--verbose Outputs verbose status messages.
--limit LIMIT Limit news topics if this parameter provided.
In case of --limit greater than amount of received news - all available news will be displayed.
--date DATE Read cached news for provided URL. If not provided source prints all cached news for this date.
It takes a date in %Y%m%d format.
--to-html TO_HTML Converts news to html format and save it.
--to-pdf TO_PDF Convert news to pdf format and save it.
```

## Requirements

The API was created using Python 3.6. To run the APP you need to install with pip packages listed in [requirements.txt]
(better to use virtual environment):

```
pip install -r requirements.txt
```

## Usage of RSS-reader

For usage the utility use followed option:

clone current repository and install the requirements (see the description above), it's better to use isolated environment with virtualenv.
The entire application is contained within the rss_reader.py file. For running the utility use previously listed command line arguments. For example:

```
rss_reader https://news.yahoo.com/rss/ --limit 3
```

The output would be the following structure:

```
Title: WNBA star Brittney Griner ordered to trial Friday in Russia

Date: 2022-06-27T07:41:55Z

Link: https://news.yahoo.com/us-basketball-star-griner-due-074155275.html

Article: MOSCOW (AP) — Shackled and looking wary, WNBA star Brittney Griner was ordered
Monday to stand trial by a court near Moscow on cannabis possession charges,
about 4 1/2 months after her arrest at an airport while returning to play for
a Russian team.
The Phoenix Mercury center and two-time U.S. Olympic gold medalist also was
ordered to remain in custody for the duration of her criminal trial, which was
to begin Friday. Griner could face 10 years in prison if convicted on charges
of large-scale transportation of drugs. Fewer than 1% of defendants in Russian
criminal cases are acquitted, and unlike in the U.S., acquittals can be
overturned.

Image link: https://s.yimg.com/uu/api/res/1.2/1THMVZDeZ0z7PVXchxklYw--~B/aD00MDAwO3c9NjAwMDthcHBpZD15dGFjaHlvbg--/https://media.zenfs.com/en/ap.org/9f3f122d6d91ff94f9613b5d97409f0f
```

## Description

#### [rss_reader/rss_reader.py]

In rss_reader.py RSS reader utility is initialized and configured. The utility provides the following features:

#### *Data caching:*

The RSS news are stored in the local storage while reading. For this purpose [shelve](https://docs.python.org/3/library/shelve.html), dictionary-like object, was used.
With the optional argument ```--date %Y%m%d``` (for example: ```--date 20220624```) the cashed news can be read. Also, adding URL make the displayed news sorted by date and link.
If the news are not found - should be returned error.

#### *Data conversion to .pdf and .html:*

The RSS reader utility provides news converter to .pdf and .html formats. It can be done with the following optional arguments: ```--to_pdf``` and
```--to_html```. Both arguments receive the path where file would be saved. The name of the file generates automatically.

There are two options for news conversion:

*convert from cache*

For this case news conversion doesn't depend on internet. With ```rss_reader.py --date 20220625 --limit 1 --to_html ~/finaltask/reader``` one news for the specified day would
be converted (the same with ```--to_pdf```), and file with it would be generated in the specified PATH.There would be clickable links to the full article
and image.

*convert news from the Internet*

For this case Internet is required. With ```rss_reader.py https://news.yahoo.com/rss/ --limit 1 --to_html ~/finaltask/reader``` one news from listed link
would be converted (the same with ```--to_pdf```), and file with it would be generated in the specified PATH. There would be clickable links to the full
article and image.
30 changes: 30 additions & 0 deletions IrinaMinasyan/examples/example_html.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<title>RSS NEWS</title>
</head>
<body>
<h1>RSS News</h1>
<div>
<h2>Officials: Georgia man sentenced to die kills self in prison</h2>
<p>2022-06-27T12:50:43Z</p><br>
<a href="https://news.yahoo.com/officials-georgia-man-sentenced-die-125043110.html">Read the full article</a><br>
<img src="https://s.yimg.com/uu/api/res/1.2/zEeBoPLQVzw1u2VjZt.THA--~B/aD03NDk7dz0xMDAwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/ap.org/5cf8e923a8d9dec8758480785184f376" width="600">
<p>JACKSON, Ga. (AP) — A Georgia man who was recently sentenced to death in the
killings of two corrections officers during an escape attempt five years ago
has died in prison of an apparent suicide, corrections officials said.

Prison guards found Ricky Dubose unresponsive in his cell at the Georgia
Diagnostic and Classification Prison in Jackson around 4:45 p.m. Sunday,
according to a Department of Corrections news release. The guards called for
medical help and began rendering aid. The coroner at the prison declared
Dubose dead at 5:56 p.m.

Dubose, 29, was sentenced to death June 16 after he was convicted of murder in
the June 2017 shooting deaths of Sgt. Christopher Monica and Sgt. Curtis
Billue.

</p><br>
</div>
</body>
</html>
24 changes: 24 additions & 0 deletions IrinaMinasyan/examples/example_xml.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<rss xmlns:ns0="http://search.yahoo.com/mrss/" version="2.0"><channel>
<title>Yahoo News - Latest News &amp; Headlines</title>
<link>https://www.yahoo.com/news</link>
<description>The latest news and headlines from Yahoo! News. Get breaking news stories and in-depth coverage with videos and photos.</description>
<language>en-US</language>
<copyright>Copyright (c) 2022 Yahoo! Inc. All rights reserved</copyright>
<pubDate>Tue, 28 Jun 2022 13:10:03 -0400</pubDate>
<ttl>5</ttl>
<image>
<title>Yahoo News - Latest News &amp; Headlines</title>
<link>https://www.yahoo.com/news</link>
<url>http://l.yimg.com/rz/d/yahoo_news_en-US_s_f_p_168x21_news.png</url>
</image>
<item>
<title>Officials: Georgia man sentenced to die kills self in prison</title>
<link>https://news.yahoo.com/officials-georgia-man-sentenced-die-125043110.html</link>
<pubDate>2022-06-27T12:50:43Z</pubDate>
<source url="http://www.ap.org/">Associated Press</source>
<guid isPermaLink="false">officials-georgia-man-sentenced-die-125043110.html</guid>
<ns0:content height="86" url="https://s.yimg.com/uu/api/res/1.2/zEeBoPLQVzw1u2VjZt.THA--~B/aD03NDk7dz0xMDAwO2FwcGlkPXl0YWNoeW9u/https://media.zenfs.com/en/ap.org/5cf8e923a8d9dec8758480785184f376" width="130" />
<ns0:credit role="publishing company" />
</item>
</channel>
</rss>
10 changes: 10 additions & 0 deletions IrinaMinasyan/font/ALEE_copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This package was debianized by A Lee <alee@debian.org> on
Sun, 18 Jul 2004 09:30:17 +0900.

Copyright 2006 (C) A Lee <alee@debian.org>. All rights reserved.
All the fonts are free; you can redistribute them and/or modify them
under the terms of the Artistic License; either version 1.0 of the
License, or (at your option) any later version.

On Debian systems, the complete text of the Artistic License can be
found in the /usr/share/common-licenses/Artistic file.
Binary file added IrinaMinasyan/font/Bandal.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/Bangwool.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSans-Bold.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSans-BoldOblique.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSans-ExtraLight.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSans-Oblique.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSans.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSansCondensed-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSansCondensed.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSansMono-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSansMono-Oblique.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSansMono.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSerif-Bold.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSerif-BoldItalic.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSerif-Italic.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSerif.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSerifCondensed-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added IrinaMinasyan/font/DejaVuSerifCondensed.ttf
Binary file not shown.
99 changes: 99 additions & 0 deletions IrinaMinasyan/font/DejaVu_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)

Bitstream Vera Fonts Copyright
------------------------------

Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:

The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.

The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".

This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.

The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.

THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.

Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.

Arev Fonts Copyright
------------------------------

Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:

The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.

The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".

This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.

The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.

THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.

$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
Binary file added IrinaMinasyan/font/Eunjin.ttf
Binary file not shown.
Binary file added IrinaMinasyan/font/EunjinNakseo.ttf
Binary file not shown.
Loading