Giter Site home page Giter Site logo

irq0 / llar Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 0.0 29.91 MB

๐Ÿ–– Live Long and Read! A self-hosted news aggregator focused on customizability.

License: GNU Affero General Public License v3.0

Dockerfile 0.43% Makefile 1.51% Clojure 87.97% Shell 0.10% CSS 3.01% JavaScript 4.65% HTML 2.34%
clojure feed-reader hackernews-api news-aggregator reddit-api rss rss-reader crawler news-reader

llar's Introduction

๐Ÿ––

Live Long and Read!

A self-hosted news aggregator focused on customizability.

Getting Started

LLAR needs a PostgreSQL database, a JVM and a couple of command line tools to run. Easiest way to get started is to use docker compose with the llar container image.

git clone https://github.com/irq0/llar.git
cd llar/docker
docker-compose pull
docker-compose up

Add your first feed

If you use the docker compose way above, the configuration lives in llar/config. LLAR watches that directory for change.

Let's add an RSS feed and the Hacker News front page as an example.

this projects GitHub release feed as an example. Put the following in llar/config/myfirstconfig.llar.

(fetch github-llar-releases (src/feed "https://github.com/irq0/llar/releases.atom") :tags #{:my-first-feed :github})
(fetch hn-frontpage (src/hn :front_page) :tags #{:my-first-feed :hackernews})
(sched-fetch my-first-feeds :now-and-hourly (some #{:my-first-feed} $TAGS))

What does this do?

fetch instructs LLAR how to fetch a source, it's name and various options. In this example we have a feed source with URL https://github.com/irq0/llar/releases.atom and a hn source which takes a Hacker News search tag instead of an address. Feed sources are the most common and support RSS, Atom and the like.

github-llar-releases and hn-frontpage are source key. A user-defined identifier for all data fetched from this source.

:tags #{:my-first-feed :github} instructs LLAR to tag this source with :my-first-feed and :github. This is Clojure syntax to say "set the fetch function's tags keyword argument to a set of two keywords". Keywords in this case behave much like strings, except that you really shouldn't use whitespace in them.

The last line creates a fetch schedule. LLAR is quite flexible in when to update what. In this case we define a schedule my-first-feeds that updates all sources tagged :my-first-feed now (0-120 seconds after LLAR loads the schedule) and then every hour.

Have an OPML file?

Awesome! Copy it to the config directory and let LLAR convert if for you. If you use docker please ensure that LLAR can write to the config directory.

The generated file will have the extension .llar.example. I suggest that you have a look and adjust the generated source keys. If you want LLAR to load the config, just rename it to .llar and it will load the file.

Features

  • Sources: RSS, Atom, Wordpress REST, Reddit, Hacker News, IMAP mailboxes
  • Custom Feeds from HTML selectors (example, example)
  • Article extraction (via Postlight Parser)
  • HTML sanitation (fix URLs, remove annoying elements and ads)
  • Bookmark / read it later from single URLs
  • Blobstore: Keep copy of feed images to make content self-contained
  • Clojure-scriptable processing: Run code to filter or change fetched items
  • Reader UI
  • Dashboard UI

UI

Reader

Screenshot of the LLAR UI

Per default running on port 8023.

Dashboard

Per default running on port 9999.

Makes internal application state accessible. This includes memory usage, database stats, schedules, application state, threads and configuration.

Gives a technical view on the fetch status of configured sources. Shows timing and error information and allows manual triggers.

Concept

The updater fetches sources, normalizes the data into items, runs them through the processor and finally persists them.

.llar files specify sources to fetch, schedules to run, and much more. A fetch definition not only contains the source, but also pre, post and filter rules, as well as, UI options and source tags.

On update a fetcher creates items. Each has a title, timestamps, content, descriptions, tags, source. Processors and filters act on individual items. Both are Clojure functions. As long as the result adheres to the item spec they are free to do any kind of manipulation.

LLAR knows two kinds of tags. Source tags, that are defined as part of a fetch definition. They basically group sources and are useful to specify schedules on. Item tags, that are attached to an item. Predefined tags are unread, saved, in-progress, archive, highlight. Each has its own semantics in the UI. Arbitrary additional tags are supported.

Configuration

Appconfig

Loaded on startup. Contains paths to command line tools, blob store, state directory, credentials file.

Examples:

Config

Runtime configuration. Automatically loaded when files in the :runtime-config-dir change. Specify sources to fetch, schedules, highlight rules here.

Files are (almost) Clojure code with extra constructs for convenience. They use the extension .llar. See readme.llar for documentation or check out my config.

Credentials

The credentials file contains secrets made available with the $credentials function in .llar config files. See credentials.edn.example.

llar's People

Contributors

irq0 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.