git ssb

0+

cel / ssb-wikimedia



Tree: 6b5ec2095160533416cd20a72f45e53f40849103

Files: 6b5ec2095160533416cd20a72f45e53f40849103 / README.md

3788 bytesRaw

ssb-wikimedia

Wikimedia to Secure Scuttlebutt bridge. Sync revisions from Wikimedia pages into SSB.

CLI

Usage: ssb-wikimedia-sync [-y] [-n] [-h] [<url>...]

Options:
  -y  Yes mode. Publish messages without prompting for confirmation.
  -n  Dry run. Output message draft JSON instead of publishing them.
  -h  Help mode. Output usage text and exit.

If URLs are not given on the command-line, they are read line-by-line from a file in the SSB directory: ~/.ssb/wikimedia-pages.txt
Lines in that file starting with "#" are considered comments and skipped. Blank lines are also skipped.

Schema

type: wikimedia/revisions

The message content is as returned from the Wikimedia Query/Revisions API, with the following change:

Example:

{
  "type": "wikimedia/revisions"
  "pageid": 77777777,
  "ns": 0,
  "site": "https://en.example.org/",
  "title": "Article Title",
  "pageId": "&...sha256",
  "parents": [
    "%...sha256",
  ],
  "revisions": [
    {
      "revid": 999999999,
      "parentid": 999999998,
      "user": "Username",
      "userId": "&...sha256",
      "timestamp": "2019-11-22T00:00:00Z",
      "roles": [
        "main"
      ],
      "slots": {
        "main": {
          "size": 0,
          "sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
          "contentmodel": "wikitext",
          "contentformat": "text/x-wiki",
          "*": "&47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=.sha256"
        }
      },
      "comment": "Example edit summary",
      "tags": []
    }
  ]
}

Config

{
  "wikimedia": {
    "contact": "example@example.org",
    "bot": false
  }
}

References

License

Copyright (C) 2019 cel @f/6sQ6d...

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Built with git-ssb-web