https://github.com/capjamesg/microformats-to-mediawiki

A webhook that turns a page marked up with a microformats h-entry object into a MediaWiki page.

https://github.com/capjamesg/microformats-to-mediawiki

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.4%) to scientific vocabulary

Keywords

bot indieweb mediawiki microformats2

Keywords from Contributors

projection archival interactive transformers sequences generic ecosystem-modeling autograding hacking shellcodes
Last synced: 5 months ago · JSON representation

Repository

A webhook that turns a page marked up with a microformats h-entry object into a MediaWiki page.

Basic Info
  • Host: GitHub
  • Owner: capjamesg
  • License: mit-0
  • Language: HTML
  • Default Branch: main
  • Homepage:
  • Size: 95.7 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 0
Topics
bot indieweb mediawiki microformats2
Created about 4 years ago · Last pushed about 2 years ago
Metadata Files
Readme License

README.md

Publish a microformats h-entry to MediaWiki

This repository contains a script and web server to publish a microformats h-entry to MediaWiki.

This project is being used on the Breakfast and Coffee to allow wiki submissions from other websites.

Getting Started

First, install the required dependencies for this project:

pip3 -r requirements.txt

Then, create a config.py file with the following variables:

PASSPHRASE="the unique password you want to use to access the webhook"
LGNAME="your bot username for the wiki you are using"
LGPASSWORD="your bot password for the wiki you are using"
SYNDICATION_LINK="your wiki URL"
API_URL="the URL of your wiki api.php file"
REQUIRE_SYNDICATION_LINK=False

You can get the LGNAME and LGPASSWORD values using the Bot passwords MediaWiki feature.

If REQUIRE_SYNDICATION_LINK is set to True, the API will only accept posts that have a syndication link to the wiki homepage. This is useful if you want to ensure that only posts that are syndicated to your wiki are added to the wiki. If you set this to False, the API will accept any post that has a valid URL and the right markup.

Finally, run the web server:

python3 wsgi.py

The web server creates an endpoint at /webhook where you can send POST requests.

The endpoint looks for a payload from webmention.io, which is being used to host the Breakfast and Coffee Webmention endpoint.

You can change the "urltoparse" variable to change the way in which the URL to parse is retrieved, depending on how you want your webhook to work.

Type checking and linting

You can run a type check and lint on this codebase using the following command:

tox

API Documentation

This API contains a single endpoint that creates a wiki page for a user.

Authentication

To use this API, you need to specify a ?passphrase= URL argument. The value of this argument should be equal to the PASSPHRASE value you set in your config.py file.

Create a wiki page

To create a wiki page, you must be registered with the MediaWiki associated with the installation of this software. Your MediaWiki username must be equal to the domain from which you want to post a URL. This ensures that you cannot submit an arbitrary post to the wiki that you do not own.

Request syntax:

``` GET /webhook?passphrase=[passphrase] Content-Type: application/json

Request Body:

{ "post": { "url": "https://example.com" } }

```

The body of your request should include the URL of the post you want to add to the wiki. The post must be marked up with either h-entry or h-review microformats. A response from the webmention.io webhook feature is compatible with the API.

If the post is a h-review, your post will be created as a review page on the wiki. If a page already exists for the place you want to review, your review will be appended to the existing page.

h-entry posts are created as regular wiki entries.

This endpoint may return the following status codes:

  • 403: A valid passphrase was not specified or the domain who created the post is not registered as a user on the wiki.
  • 400: A valid post URL was not specified or a syndication link was not present.
  • 201: Your post was created successfully. A 201 response will send a Location: header that contains the URL of the post created on the MediaWiki.

All edits are made in the name of the bot user specified in your configuration file.

Technologies

  • Python
  • Flask

License

This project is licensed under the MIT 0 license.

Contributors

  • capjamesg

Owner

  • Name: James
  • Login: capjamesg
  • Kind: user
  • Location: Scotland
  • Company: @Roboflow

from words, wonder.

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 31
  • Total Committers: 2
  • Avg Commits per committer: 15.5
  • Development Distribution Score (DDS): 0.258
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
capjamesg j****g@j****g 23
dependabot[bot] 4****] 8
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 1
  • Total pull requests: 9
  • Average time to close issues: N/A
  • Average time to close pull requests: about 18 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 9
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • capjamesg (1)
Pull Request Authors
  • dependabot[bot] (8)
Top Labels
Issue Labels
Pull Request Labels
dependencies (8)

Dependencies

requirements.txt pypi
  • Flask ==2.2.2
  • Jinja2 ==3.1.2
  • MarkupSafe ==2.1.1
  • Werkzeug ==2.2.2
  • attrs ==22.1.0
  • beautifulsoup4 ==4.11.1
  • bs4 ==0.0.1
  • certifi ==2022.9.24
  • charset-normalizer ==2.1.1
  • click ==8.1.3
  • distlib ==0.3.6
  • filelock ==3.8.0
  • html5lib ==1.1
  • idna ==3.4
  • iniconfig ==1.1.1
  • itsdangerous ==2.1.2
  • mf2py ==1.1.2
  • packaging ==21.3
  • platformdirs ==2.5.2
  • pluggy ==1.0.0
  • py ==1.11.0
  • pyparsing ==3.0.9
  • pytest ==7.1.3
  • requests ==2.28.1
  • six ==1.16.0
  • soupsieve ==2.3.2.post1
  • tomli ==2.0.1
  • tox ==3.26.0
  • urllib3 ==1.26.12
  • virtualenv ==20.16.5
  • webencodings ==0.5.1