All Projects → alekseysotnikov → buran

alekseysotnikov / buran

Licence: Apache-2.0 License
Bidirectional, data-driven RSS/Atom feed consumer, producer and feeds aggregator

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to buran

reader
A Python feed reader library.
Stars: ✭ 290 (+974.07%)
Mutual labels:  rss, rss-reader, feed-reader, feed, rss-aggregator
webfeed
A dart package for parsing RSS & Atom feed
Stars: ✭ 92 (+240.74%)
Mutual labels:  atom, rss, rss-reader, feed-reader, feed-parser
Pluto
pluto gems - planet feed reader and (static) website generator - auto-build web pages from published web feeds
Stars: ✭ 174 (+544.44%)
Mutual labels:  atom, rss, rss-reader, feed-reader, feed
RSS-to-Telegram-Bot
A Telegram RSS bot that cares about your reading experience
Stars: ✭ 482 (+1685.19%)
Mutual labels:  rss, rss-reader, feed-reader, feed
Freshrss
A free, self-hostable aggregator…
Stars: ✭ 3,793 (+13948.15%)
Mutual labels:  rss, rss-reader, feed, rss-aggregator
News
📰 RSS/Atom feed reader
Stars: ✭ 524 (+1840.74%)
Mutual labels:  rss, rss-reader, feed-reader, feed
baRSS
Menu Bar RSS reader for macOS
Stars: ✭ 39 (+44.44%)
Mutual labels:  atom, rss, rss-reader, feed
Liferea
Liferea (Linux Feed Reader), a news reader for GTK/GNOME
Stars: ✭ 612 (+2166.67%)
Mutual labels:  atom, rss, rss-reader, feed
FeedReader
C# RSS and ATOM Feed reader library. Supports RSS 0.91, 0.92, 1.0, 2.0 and ATOM. Tested with multiple languages and feeds.
Stars: ✭ 221 (+718.52%)
Mutual labels:  atom, rss, rss-reader, feed-reader
Feedek
FeedEk jQuery RSS/ATOM Feed Plugin
Stars: ✭ 190 (+603.7%)
Mutual labels:  rss, rss-reader, feed-reader, feed
Feedreader
C# RSS and ATOM Feed reader library. Supports RSS 0.91, 0.92, 1.0, 2.0 and ATOM. Tested with multiple languages and feeds.
Stars: ✭ 180 (+566.67%)
Mutual labels:  atom, rss, rss-reader, feed-reader
ttrss ynh
Tiny Tiny RSS package for YunoHost
Stars: ✭ 17 (-37.04%)
Mutual labels:  rss, rss-reader, rss-aggregator
laminas-feed
Consume and generate Atom and RSS feeds, and interact with Pubsubhubbub.
Stars: ✭ 97 (+259.26%)
Mutual labels:  atom, rss, feed
osmosfeed
Turn GitHub into an RSS reader
Stars: ✭ 839 (+3007.41%)
Mutual labels:  rss, rss-reader, feed
vuepress-plugin-feed
RSS, Atom, and JSON feeds generator plugin for VuePress 1.x
Stars: ✭ 46 (+70.37%)
Mutual labels:  atom, rss, feed
feed2email
RSS/Atom feed updates in your email
Stars: ✭ 37 (+37.04%)
Mutual labels:  atom, rss, feed
bubo-rss
An irrationally minimalist, static RSS feed reader you can instantly deploy on Netlify, Glitch or your own server.
Stars: ✭ 41 (+51.85%)
Mutual labels:  rss, rss-reader, feed-reader
Feed-on-Feeds
FeedOnFeeds is a lightweight server-based RSS feed aggregator and reader
Stars: ✭ 52 (+92.59%)
Mutual labels:  rss, rss-reader, rss-aggregator
vue-rss-feed
Embed RSS Feeds in your Vue web app
Stars: ✭ 37 (+37.04%)
Mutual labels:  rss, rss-reader, rss-parser
JARR
JARR is a web news aggregator.
Stars: ✭ 99 (+266.67%)
Mutual labels:  atom, rss, feed-reader

Buran (meaning "Snowstorm" or "Blizzard") was the first spaceplane to be produced as part of the Soviet/Russian Buran programme. Wikipedia

Buran

Clojars Project CircleCI codecov CodeScene System Mastery CodeScene Code Health

Buran is a library designed to consume and produce any RSS/Atom feeds by using data-driven approach. It works as ROME wrapper but in Buran, feeds are just data structures.

Buran could be used as an aggregator of vary feed formats into regular Clojure data structures. If you consume a feed, Buran creates a map. Thus all you have to do is either read or manipulate the map as you wish using regular functions like filter, sort, assoc, dissoc and so on. After the modifications, Buran can generate from it your own feed, for example in a different format (RSS 2.0, 1.0, 0.9x or Atom 1.0, 0.3).

Installation

  1. Add to project.clj - [buran "0.1.4"]

  2. Import

in your namespace

(:require [buran.core :refer [consume consume-http produce combine-feeds filter-entries sort-entries-by shrink]])

or REPL

(require '[buran.core :refer [consume consume-http produce combine-feeds filter-entries sort-entries-by shrink]])

Usage

No matter with which format of a feed you work, no matter you want to consume a feed or produce a new one. Every time you work with the same data structure. Buran's API is short - consume, consume-http, produce and some helpers to manipulate the feeds combine-feeds, filter-entries, sort-entries-by and shrink. The basic workflow is continually passing a data structure to the API functions, see Various options for details.

examples

Consume a feed from String

(def feed "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
           <feed xmlns=\"http://www.w3.org/2005/Atom\">
             <title>Feed title</title>
             <subtitle />
             <entry>
               <title>Entry title</title>
               <author>
                 <name />
               </author>
               <summary>entry description</summary>
             </entry>
           </feed>
           ")
(shrink (consume feed))
=>
{:info    {:feed-type "atom_1.0", 
           :title     "Feed title"},
 :entries [{:title       "Entry title", 
            :description {:value "entry description"}}]}

Produce a feed

(def feed {:info {:feed-type "atom_1.0"
                  :title     "Feed title"}
           :entries [{:title       "Entry title"
                      :description {:value "entry description"}}]})
(produce feed)
=>
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
 <feed xmlns=\"http://www.w3.org/2005/Atom\">\r
   <title>Feed title</title>\r
   <subtitle />\r
   <entry>\r
     <title>Entry title</title>\r
     <author>\r
       <name />\r
     </author>\r
     <summary>entry description</summary>\r
   </entry>\r
 </feed>
 "

Consume a feed over http

(consume-http "https://stackoverflow.com/feeds/tag?tagnames=clojure")
=>
{:info {...},
 :entries [...],
 :foreign-markup [...]}

Shrink a feed (remove nils, empty colls, maps and etc.)

(shrink (consume-http "https://stackoverflow.com/feeds/tag?tagnames=clojure"))
=>
{:info {:description "most recent 30 from stackoverflow.com",
        :feed-type "atom_1.0",
        :published-date #inst"2018-08-20T08:03:33.000-00:00",
        :title "Active questions tagged clojure - Stack Overflow",
        :link "https://stackoverflow.com/questions/tagged/?tagnames=clojure&sort=active",
        :uri "https://stackoverflow.com/feeds/tag?tagnames=clojure",
        :links [{:href "https://stackoverflow.com/questions/tagged/?tagnames=clojure&sort=active",
                 :type "text/html",
                 :rel "alternate",
                 :length 0}, ...]},
 :entries [{:description {:type "html", :value "<p>..."},
            :updated-date #inst"2018-08-20T06:16:12.000-00:00",
            :foreign-markup [...],
            :published-date #inst"2018-08-20T05:54:39.000-00:00",
            :title "Clojure evaluate lazy sequence",
            :author "Constantine",
            :categories [{:name "clojure", :taxonomy-uri "https://stackoverflow.com/tags"}, ...],
            :link "https://stackoverflow.com/questions/51924808/clojure-evaluate-lazy-sequence",
            :uri "https://stackoverflow.com/q/51924808",
            :authors [{:name "Constantine", :uri "https://stackoverflow.com/users/4201205"}],
            :links [{:href "https://stackoverflow.com/questions/51924808/clojure-evaluate-lazy-sequence",
                     :rel "alternate",
                     :length 0}]}, ...],
 :foreign-markup [...]}

Various options

Consume feed

(consume {:from             (java.io.File. "~/feed.xml") 
                                        ; String, File, Reader, W3C DOM document, JDOM document, W3C SAX InputSource
          :validate         false       ; Indicates if the input should be validated
          :locale           (Locale/US) ; java.util.Locale
          :xml-healer-on    true        ; Healing trims leading chars from the stream (empty spaces and comments) until the XML prolog.
                                        ; Healing resolves HTML entities (from literal to code number) in the reader.
                                        ; The healing is done only with the File and Reader.
          :allow-doctypes   false       ; You should only activate it when the feeds that you process are absolutely trustful
          :throw-exception  false       ; false - return map with an exception, throw an exception otherwise
         })
(consume-http {:from             "https://stackoverflow.com/feeds/tag?tagnames=clojure" 
                                                      ; <http url string>, URL, File, InputStream
               :headers          {"X-Header" "Value"} ; Request's HTTP headers map
               :lenient          true                 ; Indicates if the charset encoding detection should be relaxed
               :default-encoding "US-ASCII"           ; Supports: UTF-8, UTF-16, UTF-16BE, UTF-16LE, CP1047, US-ASCII
               ... 
               + all options which are applied to a (consume) call
              })

Beware! consume-http from either http url string or URL is rudimentary and works only for simplest cases. For instance, it does not follow HTTP 302 redirects. Please consider using a separate library like clj-http or http-kit for fetching the feed.

Produce feed

(produce {:feed            {:info {:feed-type "atom_1.0" ; Supports: atom_1.0, atom_0.3, rss_2.0, 
                                                         ; rss_1.0, rss_0.94, rss_0.93, rss_0.92, 
                                                         ; rss_0.91U (Userland), rss_0.91N (Netscape), 
                                                         ; rss_0.9
                                   :title "Feed title"}
                            :entries [{:title       "Entry 1 title"
                                       :description {:value "entry description"}}]
                            :foreign-markup nil}

          :to              :string ; <file path string>, :string, :w3cdom, :jdom, File, Writer
          :pretty-print    true    ; Pretty-print XML output
          :throw-exception false   ; false - return map with an exception, throw an exception otherwise
         })

License

Copyright © 2018-2020 Aleksei Sotnikov

Distributed under the Apache License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].