Skip to main content
Topic: Artix News: Scraping  (Read 14786 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Artix News: Scraping

Hello!

I have a small contribution, which may be useful for someone here.

Sometimes I lost my X because a weird upgrade, would be nice if I can check the artix news to look if some breaking upgrade was released.

Because of that I made a scraper of Artix news page: https://github.com/ryukinix/artix-news.

It's mostly based on archnews python script (https://github.com/mjiricka/archnews/blob/master/archnews).
It's me. The only me.

Re: Artix News: Scraping

Reply #1
It works!
A couple of things I encountered that may be useful for installation by others -  to use pip install you have to first install the python-pip package from the repos. And I did not have .local/bin in PATH so I got a warning about that, and had to call it by it's full path to run it. Installing it without the --user option worked though.

And if you do
$ artix-news | less - R
 you can see it in less, but still keep the color display.


Re: Artix News: Scraping

Reply #2
Great!!! Thanks for testing it. I'll plan some additional documentation and I can make a AUR package if there is a need for it. There is a planned flag (artix-news -s) to add a brief summary of news: https://github.com/ryukinix/artix-news/issues/1

Which will make this result:

It's me. The only me.

Re: Artix News: Scraping

Reply #3
Very nice! Thanks for this!

Re: Artix News: Scraping

Reply #4
It works!
A couple of things I encountered that may be useful for installation by others -  to use pip install you have to first install the python-pip package from the repos. And I did not have .local/bin in PATH so I got a warning about that, and had to call it by it's full path to run it. Installing it without the --user option worked though.

And if you do
$ artix-news | less - R
 you can see it in less, but still keep the color display.


Was this the warning?

pip install --user artix-news
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try 'pacman -S
    python-xyz', where xyz is the package you are trying to
    install.

    If you wish to install a non-Arch-packaged Python package,
    create a virtual environment using 'python -m venv path/to/venv'.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip.

    If you wish to install a non-Arch packaged Python application,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. Make sure you have python-pipx
    installed via pacman.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Re: Artix News: Scraping

Reply #5
I don't think so, that one's new, you need to add the --break-system-packages option to bypass it. Actually it shouldn't break anything but on a version upgrade of Python artix-news will break and some files will get left behind somewhere and will need to be manually deleted which is why you shouldn't generally use pip install, but it seems here it's the only option currently available, so go for it.  ;D
Code: [Select]
$ pip install --user --break-system-packages artix-news
Collecting artix-news
  Downloading artix_news-0.3.0-py3-none-any.whl.metadata (1.1 kB)
Downloading artix_news-0.3.0-py3-none-any.whl (4.7 kB)
Installing collected packages: artix-news
  WARNING: The script artix-news is installed in '/home/$USER/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed artix-news-0.3.0

Here's how to avoid those pesky warnings, if you know what you are doing:
Code: [Select]
$ sudo pip install --break-system-packages --root-user-action ignore artix-news
Collecting artix-news
  Using cached artix_news-0.3.0-py3-none-any.whl.metadata (1.1 kB)
Using cached artix_news-0.3.0-py3-none-any.whl (4.7 kB)
Installing collected packages: artix-news
Successfully installed artix-news-0.3.0

 
Artix forum uses a single cookie to remember youOK