{"id":15908529,"url":"https://github.com/capjamesg/micropub","last_synced_at":"2025-07-04T08:38:57.083Z","repository":{"id":38310874,"uuid":"405347190","full_name":"capjamesg/micropub","owner":"capjamesg","description":"A Micropub client and server implemented in Python Flask.","archived":false,"fork":false,"pushed_at":"2024-04-03T15:19:26.000Z","size":1255,"stargazers_count":4,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T01:50:55.092Z","etag":null,"topics":["indieweb","micropub"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capjamesg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-11T10:17:36.000Z","updated_at":"2025-01-16T18:15:01.000Z","dependencies_parsed_at":"2023-01-25T13:31:11.746Z","dependency_job_id":"15b29b1a-24dc-4d57-a1e9-f2577652bb2d","html_url":"https://github.com/capjamesg/micropub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/capjamesg/micropub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fmicropub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fmicropub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fmicropub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fmicropub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capjamesg","download_url":"https://codeload.github.com/capjamesg/micropub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capjamesg%2Fmicropub/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263478659,"owners_count":23473040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["indieweb","micropub"],"created_at":"2024-10-06T14:22:12.220Z","updated_at":"2025-07-04T08:38:57.051Z","avatar_url":"https://github.com/capjamesg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Micropub Client and Endpoint\n\nThis repository contains the code behind my Micropub client and endpoint. Unusually, the client and endpoint are both part of the same codebase. This is because I built this client and endpoint concurrently and wanted to keep the code as part of the same project.\n\nThe client.py file contains all of the code for the Micropub client. micropub_helper.py, create_items.py, and micropub.py contain code relevant to the Micropub server.\n\nThis application is powered by Python Flask.\n\n## Screenshot\n\n![Micropub homepage](screenshot.png)\n\n## Specification Compliance\n\nThis project is in development. As a result, the contents of this repository have not yet passed the Micropub client or server specifciations published on [micropub.rocks](https://micropub.rocks/).\n\nSo far, the receiving end has 30 of the 34 specification requirements in the micropub.rocks implementation report. The implementation report is here:\n\nhttps://micropub.rocks/implementation-reports/servers/593/qcErwj2OOC2MiSqE6QeU\n\n## Installation\n\n### Setting up your environment\n\nFirst, set up a virtual environment:\n\n    python3 -m venv venv\n    source venv/bin/activate\n\nNext, you will need to install the required dependencies for this project. You can do so by running this command:\n\n    pip install -r requirements.txt\n\n### Configuration\n\nTo use this endpoint, you need to create a config.py file with the following values:\n\n    UPLOAD_FOLDER = \"/path/to/website/assets/folder/\"\n    ALLOWED_EXTENSIONS = set([\"png\", \"jpeg\", \"jpg\"])\n    HOME_FOLDER = \"/path/to/folder/for/website/\"\n    ENDPOINT_URL = \"https://yourmicropubendpoint.com/micropub\"\n    MEDIA_ENDPOINT_URL = \"https://yourmicropubendpoint.com/media\"\n\n    GITHUB_KEY = \"GITHUB_ACCESS_TOKEN\"\n    GOOGLE_API_KEY = \"GOOGLE_CLOUD_API_KEY\"\n\n    TWITTER_BEARER_TOKEN = \"TWITTER_API_TOKEN\"\n\n    ME = \"yourdomain.com\"\n    CALLBACK_URL = \"https://yourdomain.com/micropub/callback\"\n    CLIENT_ID = \"https://yourdomain.com\"\n\nThese values are all required for the endpoint to work. UPLOAD_FOLDER and HOME_FOLDER should be where you keep your website assets folder and website root folder, respectively. In my case, UPLOAD_FOLDER points to my /assets/ folder in my Jekyll repository and HOME_FOLDER points to my root folder in my Jekyll repository.\n\nThis project uses PyGitHub to upload posts published through the Micropub server to GitHub. For this feature to work, you need to specify a GitHub access token that has access to read and write to a repository.\n\nThe Google API key is used for finding locations when you post a checkin. This feature is only implemented when one does not specify the address of where they are in a checkin. To disable this feature, go to the process_checkin() function in create_items.py and comment out the code related to the Google Cloud API.\n\nYou will also need to create a folder for each post type you want to support. This is essential because the Micropub server does not create these folders automatically. The folders you need to create to support all post types are:\n\n    - _webmention\n    - _rsvp\n    - _repost\n    - _likes\n    - _notes\n    - _coffee\n    - _bookmark\n    - _checkin\n\n### Start the application\n\nWith the dependencies installed, you can run the application by using this command:\n\n    python3 wsgi.py\n\n## Client Schemas\n\nThe /schemas page shows schemas for every POST request the Micropub client can make (excluding media endpoint requests).\n\nYou can refer to this page without downloading the client by going to templates/schemas.html in the source code.\n\nYou can use these schemas to help understand the data the client will send to a server.\n\nOnly JSON objects are documented on the schemas page. Support for form encoded requests is not yet stable and as a result has not been documented on the schemas page.\n\n## Server Role\n\nThe role of the server is to turn the POST requests from the client into files that can then be uploaded to a Jekyll blog or any blog that uses similar front matter. You can modify the server to create a different page type. To do so, I would suggest taking a look at the write_to_file() function in create_items.py.\n\nHere is a webmention that the server created after receiving a \"reply\" POST request from the client:\n\n    category:\n    - Webmention\n    in-reply-to:\n    - https://jamesg.blog\n    layout: webmention\n    published: 2021-09-12 08:36:55.916905\n    title: Webmention to Home   James Coffee Blog\n\n## Relevant Resources\n\nHere are some relevant resources that you might find useful if you are interested in building a Micropub client or server or would like to use the one in this repository:\n\n- [Micropub](https://indieweb.org/Micropub)\n- [Micropub Specification](https://www.w3.org/TR/micropub/)\n\n## Acknowledgements\n\nThe emojis.json file that the automatic emoji detection system uses on the /post page was retrieved from [this Gist](https://gist.github.com/harplife/c5fb201e95c9427d976d7bac37ab1e32) by [harplife](https://github.com/harplife/).\n\nThe supported TLDs list used for automatic linking is from the [iana.org TLDs list](https://data.iana.org/TLD/tlds-alpha-by-domain.txt).\n\n## Contributors\n\n- capjamesg","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fmicropub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapjamesg%2Fmicropub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapjamesg%2Fmicropub/lists"}