Skip to main content

Microblog server backend

Project description

Microblog server

Python backend for a low-volume personal microblog.

Input server (Telegram bot) waits for user to post new microblog entries and saves them to storage (git repo). Entries can be fetched from storage via provided Python library. There is also a plugin for Pelican to render microblog entries on a static web site.

Input server and storage engine should be easy to replace or add new implementations in future.

Installation

Usage

Running input server

  • Commandline entrypoint: microblog
  • Configuration is done via environment variables:
    • MICROBLOG_STORAGE: Path to a local checkout of git repository that stores the microblog
    • MICROBLOG_TOKEN: Telegram bot token
    • MICROBLOG_USERS: Comma-separated list of Telegram accounts allowed to interact with the bot

Using Python library to read microblog from storage

See the source code

Rendering static web site

See Pelican docs for general information on using static site generator.

Plugin configuration:

# pelicanconf.py
import microblog.pelican
import microblog.storage
PLUGINS = [
    microblog.pelican,
]
MICROBLOG = microblog.storage.GitStorage('./path/to/local/copy/of/git/repo/')

Your theme is expected to provide the following templates:

  • micros for paginated microblog index (example)
  • micro for individual microblog entries (example)

Check plugin source for further information. See author's site configuration for further examples.

License and copyright

Copyright 2022 Vitaly Potyarkin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microblog-server-1.0.4.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microblog_server-1.0.4-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file microblog-server-1.0.4.tar.gz.

File metadata

  • Download URL: microblog-server-1.0.4.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.7

File hashes

Hashes for microblog-server-1.0.4.tar.gz
Algorithm Hash digest
SHA256 3d6ac0369a91c9e140099cf69769cfc8fe29c52fa0c6afe5bfac68406415b919
MD5 cc3a330583a33943b916f3de9da649f8
BLAKE2b-256 5d4eb789add2459dd0bc1d312afe785b737f7b5820fabfa11ff1842177ab51db

See more details on using hashes here.

File details

Details for the file microblog_server-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for microblog_server-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ff71e8b13028470ec63365aae83992249c50e93d8714219d0ec7791efda4e6d
MD5 23015c4520c0af732d23e98f919c2e5b
BLAKE2b-256 634c5a9700d125efb1c3d1026b124eaac59771949eaa00c72a9d199edc651de0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page