Git Product home page Git Product logo

krill's Introduction

PyPI Python versions krill rocks

Want news? Just krill it!

Krill are filter feeders. True to its namesake, krill ๐Ÿค filters feeds. It is not picky about its diet, and will happily consume RSS, Atom, CDF and even Twitter ๐Ÿฆ feeds (no credentials required!). It aggregates feed items from all sources you specify, filters out those that interest you, and displays them as a live stream ๐Ÿ”ฅ of clean, legible command line output.

Screenshot

krill is beautifully minimal. krill is extremely easy to set up and use, and runs anywhere Python runs. krill is a refreshingly different way of consuming news ๐Ÿ“ฐ and updates from anywhere on the web. krill is the hacker's way of keeping up with the world. ๐ŸŒ

Installation

krill requires Python 2.7+/3.2+ ๐Ÿ. If you have the pip package manager, all you need to do is run

pip install krill

either as a superuser or from a virtualenv environment.

Of course, you can also download the script directly from this repository, in which case you will need to install the dependencies Beautiful Soup (what a library! โญ), feedparser, Blessings and Requests manually.

Usage

Command line

krill [-h] [-s URL [URL ...]] [-S FILE] [-f REGEX [REGEX ...]]
      [-F FILE] [-u SECONDS]

  -s URL [URL ...], --sources URL [URL ...]
                        URLs to pull data from
  -S FILE, --sources-file FILE
                        file from which to load source URLs (OPML format
                        assumed if filename ends with ".opml")
  -f REGEX [REGEX ...], --filters REGEX [REGEX ...]
                        patterns used to select feed items to print
  -F FILE, --filters-file FILE
                        file from which to load filter patterns
  -u SECONDS, --update-interval SECONDS
                        time between successive feed updates (default: 300
                        seconds, 0 for single pull only)

Example

krill -s "https://twitter.com/nasa" -f "new ?horizons"

will follow NASA's ๐Ÿš€ Twitter stream, printing only tweets that mention the New Horizons probe.

krill automatically determines whether to treat a web document as a Twitter or an XML feed. If multiple sources and/or filters are loaded from a file with the -S and -F tags, each must be on a separate line (except if the sources file uses the OPML format, in which case all xmlUrl attributes are loaded). Empty lines and lines starting with # (comments) are ignored.

Any URL format accepted by the Requests library is supported. In particular, feeds requiring (basic) HTTP authentication can be accessed by supplying credentials in the URL string with https://user:[email protected]/feed.

Inline and file specifications may be combined freely. If more than one filter is given, items matching any of the filters are printed. If no filter is given, all items are printed.

License

Copyright ยฉ 2015 Philipp Emanuel Weidmann ([email protected])

Released under the terms of the GNU General Public License, version 3

krill's People

Contributors

p-e-w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

krill's Issues

throws error with opml

This opml was geenrated by tinytinyrss

Traceback (most recent call last):
File "/usr/local/bin/krill", line 9, in
load_entry_point('krill==0.3.0', 'console_scripts', 'krill')()
File "/usr/local/lib/python2.7/dist-packages/krill-0.3.0-py2.7.egg/krill/krill.py", line 337, in main
Application(args).run()
File "/usr/local/lib/python2.7/dist-packages/krill-0.3.0-py2.7.egg/krill/krill.py", line 298, in run
self.update()
File "/usr/local/lib/python2.7/dist-packages/krill-0.3.0-py2.7.egg/krill/krill.py", line 272, in update
for item in self._get_stream_items(source):
File "/usr/local/lib/python2.7/dist-packages/krill-0.3.0-py2.7.egg/krill/krill.py", line 72, in get_feed_items
feed_data = feedparser.parse(xml)
File "/usr/lib/python2.7/dist-packages/feedparser.py", line 4014, in parse
saxparser.parse(source)
File "/usr/lib/python2.7/dist-packages/drv_libxml2.py", line 214, in parse
eltName,eltQName,attributesNSImpl)
File "/usr/lib/python2.7/dist-packages/feedparser.py", line 1809, in startElementNS
raise UndeclaredNamespace, "'%s' is not associated with a namespace" % givenprefix
feedparser.UndeclaredNamespace: 'dc' is not associated with a namespace

Curses/Blessings unsupported on windows

Krill crashes on windows.

The root cause of the crash is that curses is not on windows machines.

The library you are using for terminal manipulation (blessings) has an open issue on github for this here.

It looks like you are only using this to color/format text in the terminal. It may be worth looking into colorama which is cross platform.

If I have time I might try and implement this myself.

Traceback:

Traceback (most recent call last):
  File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python34\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python34\Scripts\krill.exe\__main__.py", line 5, in <module>
  File "C:\Python34\lib\site-packages\krill\krill.py", line 31, in <module>
    from blessings import Terminal
  File "C:\Python34\lib\site-packages\blessings\__init__.py", line 5, in <module>

    import curses
  File "C:\Python34\lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ImportError: No module named '_curses'

Other than this minor issue I really like you code :)

color configuration

It would be nice make krill theme configurable, I really like it, but the colors are... well, not of my liking. :)

Is it possible to use authentication?

I have an RSS feed that's generated by an issue tracker that I want to track with Krill. However the RSS feed in question requires authentication.

I didn't see any information in the docs about authentication. Is this possible, maybe via an opml file?

Windows 7

I was able to get fcntl.py working then next error "termios" is missing.

Maybe add a note that this won't work under Windows.

OPML i/o

https://en.m.wikipedia.org/wiki/OPML

Feed readers such as Feedly and Inoreader can import and export lists of feed subscriptions in OPML format. Would be nice to be able to get that data into krill quickly using an import tool.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.