論及 ronkyuu - mention, reference to, touching upon
HTML Python Makefile
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs Update README_nginx_uwsgi.md Dec 10, 2013
examples add support for Tox; setup 2.7 and 3.5 testing; fix some linting erro… Aug 20, 2016
ronkyuu
tests
.gitignore
LICENSE Initial commit Nov 27, 2013
MANIFEST.in
Makefile bring over some tox and Makefile tweaks from my other projects Dec 18, 2016
README.md
circle.yml switch to CircleCI v2 beta Dec 18, 2016
pytest.ini oops, forgot to change target after cut-n-paste Aug 21, 2016
requirements-test.txt
requirements.txt
setup.cfg ignore lint errors for indented continuation lines Sep 5, 2017
setup.py fix some lint errors Dec 18, 2016
tox.ini

README.md

Downloads Circle CI CodeCov Requirements Status

論及 ronkyuu - mention, reference to, touching upon

Python package to help with parsing, handling and other manipulations of the IndieWeb Toolkit items, such as:

  • Webmention
  • Discovery of mentions in a publisher's post, the handling of finding what the Webmention callback is for the reference and also handling of incoming Webmention requests are handled.
  • RelMe
  • Take a source URL and a resource URL that is supposed to be a rel=me for the source and verify that it is.

See the examples/ directory for sample command line tools.

Because Ronkyuu uses BeautifulSoup4 for it's amazing HTML wrangling ability, you have the option of enabling faster parsing via the lxml package instead of the default html5lib package. This is done by having lxml installed and...

import ronkyuu

ronkyuu.webmention.setParser('lxml')

Contributors

  • bear (Mike Taylor)
  • kartikprabhu (Kartik Prabhu)

WebMentions

findMentions()

Find all elements in the html returned for a post. If any have an href attribute that is not from the one of the items in domains, append it to our lists.

findEndpoint()

Search the given html content for all elements and return any discovered WebMention URL.

discoverEndpoint()

Discover any WebMention endpoint for a given URL.

sendWebmention(sourceURL, targetURL, webmention=None)

Send to the targetURL a WebMention for the sourceURL. The WebMention will be discovered if not given in the optional webmention parameter.

RelMe

findRelMe()

Find all elements in the given html for a post. If any have an href attribute that is rel="me" then include it in the result.

confirmRelMe()

Determine if a given resourceURL is authoritative for the profileURL. The list of rel="me" links will be discovered if not provided in the optional profileRelMes parameter or the resourceRelMes paramter.

Validators

URLValidator class

TODO: fill in details of how to use

Requires

Python v2.6+ but see requirements.txt for a full list

For testing we use httmock to mock the web calls.