Tools for webmention.org.
Project description
webmention-tools
===============
Some simple tools in python to deal with webmentions.
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.
- webmentiontoold.webmentionio provides a class to query
webmention.io
There is also the corresponting command line tool,
webmention-tools (which is also a simple example on how
to use the library.
Check bin/demp.py on how to use the library to query
webmention.io and present information for all URLs that
mentioned http://indiewebcamp.com/webmention
Installation
============
pip install webmentiontools
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()
===============
Some simple tools in python to deal with webmentions.
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.
- webmentiontoold.webmentionio provides a class to query
webmention.io
There is also the corresponting command line tool,
webmention-tools (which is also a simple example on how
to use the library.
Check bin/demp.py on how to use the library to query
webmention.io and present information for all URLs that
mentioned http://indiewebcamp.com/webmention
Installation
============
pip install webmentiontools
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
webmentiontools-0.4.0.tar.gz
(6.0 kB
view details)
File details
Details for the file webmentiontools-0.4.0.tar.gz
.
File metadata
- Download URL: webmentiontools-0.4.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c89069dff802dd9c62f799606e535d58d833c19152bf40d70dd1b8c85963b1c |
|
MD5 | 5482f3796811dc17349a8152954cb823 |
|
BLAKE2b-256 | e2ebc02e1093a37d84c6dc260b4dc99ecf8e8e785323b98e5cf952383d4e8be7 |