All Projects → kartikprabhu → Hfeed2atom

kartikprabhu / Hfeed2atom

Licence: mit
Python functions to convert a h-feed to Atom 1.0

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Hfeed2atom

meta-extractor
Super simple and fast html page meta data extractor with low memory footprint
Stars: ✭ 38 (+245.45%)
Mutual labels:  atom, feed
Reader
Free and open source feeds reader, including all major Google Reader features
Stars: ✭ 347 (+3054.55%)
Mutual labels:  atom, feed
baRSS
Menu Bar RSS reader for macOS
Stars: ✭ 39 (+254.55%)
Mutual labels:  atom, feed
laminas-feed
Consume and generate Atom and RSS feeds, and interact with Pubsubhubbub.
Stars: ✭ 97 (+781.82%)
Mutual labels:  atom, feed
Python Feedgen
Python module to generate ATOM feeds, RSS feeds and Podcasts.
Stars: ✭ 501 (+4454.55%)
Mutual labels:  atom, feed
feed2email
RSS/Atom feed updates in your email
Stars: ✭ 37 (+236.36%)
Mutual labels:  atom, feed
buran
Bidirectional, data-driven RSS/Atom feed consumer, producer and feeds aggregator
Stars: ✭ 27 (+145.45%)
Mutual labels:  atom, feed
Event Driven Spring Boot
Example Application to demo various flavours of handling domain events in Spring Boot
Stars: ✭ 194 (+1663.64%)
Mutual labels:  atom, feed
Jquery Rss
An easy-to-use rss plugin for jquery with templating.
Stars: ✭ 443 (+3927.27%)
Mutual labels:  atom, feed
Picofeed
PHP library to parse and write RSS/Atom feeds
Stars: ✭ 439 (+3890.91%)
Mutual labels:  atom, feed
atom
Library for serializing the Atom web content syndication format https://crates.io/crates/atom_syndication
Stars: ✭ 68 (+518.18%)
Mutual labels:  atom, feed
Miniflux Legacy
Minimalist RSS reader (version 1.x)
Stars: ✭ 897 (+8054.55%)
Mutual labels:  atom, feed
V2
Minimalist and opinionated feed reader
Stars: ✭ 3,239 (+29345.45%)
Mutual labels:  atom, feed
vuepress-plugin-feed
RSS, Atom, and JSON feeds generator plugin for VuePress 1.x
Stars: ✭ 46 (+318.18%)
Mutual labels:  atom, feed
Feed Io
A PHP library to read and write feeds in JSONFeed, RSS or Atom format
Stars: ✭ 200 (+1718.18%)
Mutual labels:  atom, feed
feeds-to-pocket
Sends entries from RSS and Atom feeds to Pocket (https://getpocket.com)
Stars: ✭ 24 (+118.18%)
Mutual labels:  atom, feed
Pluto
pluto gems - planet feed reader and (static) website generator - auto-build web pages from published web feeds
Stars: ✭ 174 (+1481.82%)
Mutual labels:  atom, feed
Feed Module
Everyone deserves RSS, ATOM and JSON feeds!
Stars: ✭ 182 (+1554.55%)
Mutual labels:  atom, feed
Hexo Generator Feed
Feed generator for Hexo.
Stars: ✭ 400 (+3536.36%)
Mutual labels:  atom, feed
Feed
A RSS, Atom and JSON Feed generator for Node.js, making content syndication simple and intuitive! 🚀
Stars: ✭ 523 (+4654.55%)
Mutual labels:  atom, feed

hfeed2atom

Convert h-feed pages to Atom 1.0 XML format for traditional feed readers. You can try it out at https://kartikprabhu.com/hfeed2atom

Installation

To install hfeed2atom use pip as follows:

pip install git+https://github.com/kartikprabhu/hfeed2atom.git --process-dependency-links

This will install hfeed2atom with its dependencies from pypi and mf2py from the experimental repo https://github.com/kartikprabhu/mf2py/tree/experimental.

Usage

hfeed2atom takes as arguments one or more of the following:

  • doc: a string, a Python File object or a BeautifulSoup document containing the contents of an HTML page
  • url: the URL for the page to be parsed. It is recommended to always send a URL argument as it is used to convert all other URLs in the document to absolute URLs.
  • atom_url: the URL of the page with the ATOM file.
  • hfeed: a Python dictionary of the microformats h-feed object. Use this if the document has already been parsed for microformats.

hfeed2atom returns the following as a tuple:

  • Atom format of the h-feed, or None if there was an error.
  • A string message of the error if any

The easiest way to use hfeed2atom in your own python code to parse the feed on a URL http://example.com

from hfeed2atom import hfeed2atom

atom, message = hfeed2atom(url = 'http://example.com')

With this code, hfeed2atom will do a GET request to http://example.com, find the first h-feed and return the Atom as a string.

If you already have the contents of the URL (by doing a GET request yourself, or if it is your own page on your server), then you can pass them as a doc argument as

atom, message = hfeed2atom(doc = contents, url = 'http://example.com')

doc can be a string, a Python File object or a BeautifulSoup document.

If you already have the h-feed microformats object of a page as a Python dictionary in the variable hfeed then use

atom, message = hfeed2atom(hfeed = hfeed, url = 'http://example.com')

Note, in this case hfeed2atom assumes that all the required properties for Atom are already in the hfeed variable and will not attempt to generate any fallback properties.

Features

  • Finds first h-feed element to generate Atom feed, if no h-feed found defaults to using the top-level h-entries for the feed.
  • Generates fallbacks for required Atom properties of the feed. The fallbacks, in order, are:
    • title : h-feed name property else, <title> element of the page else, Feed for URL.
    • id : h-feed uid or url property else, URL argument given.
    • updated date : h-feed updated or published property else, updated or published property of the latest entry.
  • Generates fallback categories for the h-feed from the meta name='keywords'> element of the page.
  • Generates fallback for required Atom properties of each entry in the h-feed. The fallbacks, in order, are:
    • title : h-entry name property if it is not same as content>value else, content property truncated to 50 characters else, uid or url of the entry.
    • id : h-entry uid property or url property else, error and skips that entry.
    • updated date : h-entry updated or published property else, error and skips that entry.

To Do

  • Author discovery if the h-feed does not have an author property. Note <author> is an optional tag in Atom!

Go forth

Now use this yourself and give feedback.

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].