Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Ryuno-Ki/webmention-tools
Tools for webmention.org
https://github.com/Ryuno-Ki/webmention-tools
Last synced: 5 days ago
JSON representation
Tools for webmention.org
- Host: GitHub
- URL: https://github.com/Ryuno-Ki/webmention-tools
- Owner: Ryuno-Ki
- License: mit
- Created: 2013-09-18T22:55:39.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T00:16:47.000Z (6 months ago)
- Last Synced: 2024-05-30T02:34:23.014Z (5 months ago)
- Language: Python
- Homepage: https://webmention-tools.readthedocs.io/
- Size: 134 KB
- Stars: 54
- Watchers: 3
- Forks: 5
- Open Issues: 20
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-starred - Ryuno-Ki/webmention-tools - Tools for webmention.org (others)
README
webmention-tools
================|CircleCI| |Vulnerabilities| |Coverage| |Maintainability| |ReadTheDocs|
Some simple tools in python to deal with Webmentions.
Note, that this package was formerly known as
`webmentiontools `__, but had
to be renamed due to
`PEP-541 `__. (Namely, not
classified as abandoned project, because the author was reachable).Currently:
- webmentiontools.send implements WebmentionSend that sends
Webmentions.
- webmentiontools.urlinfo implements UrlInfo() that will rerurn usefull
information about a web page, like title, the existance of an
"in-reply-to" link, the author name, the author image, etc.
- webmentiontools.webmentionio provides a class to query webmention.ioThere is also the corresponting command line tool, webmention-tools
(which is also a simple example on how to use the library.Check `bin/demo.py <./bin/demo.py>`__ on how to use the library to query
webmention.io and present information for all URLs that mentioned
http://indiewebcamp.com/webmentionInstallation
------------pip install webmention-tools
Usage
-----Command line:
::
webmention-tools send `source` `target`
webmention-tools urlinfo `url`or
Python code to send a Webmention:
::
from webmentiontools.send import WebmentionSend
source = 'URL of page sending the Webmention'
target = 'URL of page to receive the Webmention'
mention = WebmentionSend(source, target)
mention.send()Python code to get info about a webpage.
::
from webmentiontools.urlinfo import UrlInfo
url = 'a link to a web page'
i = UrlInfo(url)
if i.error:
print('There was an error getting %s' % url)
else:
print('in-reply-to link: %s' % i.inReplyTo())
print('publication date: %s' % i.pubDate())
print('page title: %s' % i.title())
print('image link: %s' % i.image())Development
-----------1. Create a virtualenv with python3
2. Change into that directory and clone the repository
3. Activate the virtualenv by ``source``\ ing ``bin/activate``
4. Change into the cloned repository and install dependencies via \`pip
install -r requirements.txt'
5. Run ``pytest --cov=webmentiontools`` for unit tests with code coverage.. |CircleCI| image:: https://circleci.com/gh/Ryuno-Ki/webmention-tools.svg?style=svg
:target: https://circleci.com/gh/Ryuno-Ki/webmention-tools
.. |Vulnerabilities| image:: https://img.shields.io/snyk/vulnerabilities/github/Ryuno-Ki/webmention-tools.svg?style=popout
.. |Coverage| image:: https://codecov.io/gh/Ryuno-Ki/webmention-tools/branch/master/graph/badge.svg
:target: https://codecov.io/gh/Ryuno-Ki/webmention-tools
.. |Maintainability| image:: https://api.codeclimate.com/v1/badges/bb63f7d3f38456ea8770/maintainability
:target: https://codeclimate.com/github/Ryuno-Ki/webmention-tools/maintainability
.. |ReadTheDocs| image:: https://readthedocs.org/projects/webmention-tools/badge/?version=latest
:target: https://webmention-tools.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status