twtxt is a decentralised, minimalist microblogging service for hackers.

Overview

twtxt

Latest version released on PyPi Build status of the master branch Test coverage Documentation Status Package license

twtxt is a decentralised, minimalist microblogging service for hackers.

So you want to get some thoughts out on the internet in a convenient and slick way while also following the gibberish of others? Instead of signing up at a closed and/or regulated microblogging platform, getting your status updates out with twtxt is as easy as putting them in a publicly accessible text file. The URL pointing to this file is your identity, your account. twtxt then tracks these text files, like a feedreader, and builds your unique timeline out of them, depending on which files you track. The format is simple, human readable, and integrates well with UNIX command line utilities.

Demo

tl;dr: twtxt is a CLI tool, as well as a format specification for self-hosted flat file based microblogging.

Features

  • A beautiful command-line interface thanks to click.
  • Asynchronous HTTP requests thanks to asyncio/aiohttp and Python 3.
  • Integrates well with existing tools (scp, cut, echo, date, etc.) and your shell.
  • Don’t like the official client? Tweet using echo -e "`date +%FT%T%:z`\tHello world!" >> twtxt.txt!

Documentation

Check out the full documentation at: http://twtxt.readthedocs.org/en/latest/

Community

Contributions

License

twtxt is released under the MIT License. See the bundled LICENSE file for details.

Comments
  • Add # for comments in Feed

    Add # for comments in Feed

    Hello,

    it would be nice, if the client ignores lines starting with #. This way the feed format would be extensible with e.g. the date of creation or other meta fields (e.g. # nickname dracoblue is a hint for clients, who get it).

    question 
    opened by DracoBlue 37
  • Include user’s twtxt nick and URL in their user-agent string

    Include user’s twtxt nick and URL in their user-agent string

    Like proposed here: https://github.com/buckket/twtxt/issues/3#issuecomment-182738604 This allows searching the webserver’s access log for one’s followers.

    Format: twtxt/1.2.3 (+https://example.com/twtxt.txt; @somebody)

    Any other suggestions for the format we should use?

    enhancement 
    opened by buckket 12
  • Resolve Nicknames, which are Domains

    Resolve Nicknames, which are Domains

    I host a twtxt file at https://dracoblue.net/twtxt.txt

    If I reply to somebody like @buckket it's not clea if other people saved him as @buckket, too. Or a different person.

    Would it be possible to have something like @example.org resolves preferably to the person who hosts https://example.org/twtxt.txt?

    enhancement 
    opened by DracoBlue 12
  • Empty loop in get_remote_tweets leads to error (variable referenced before assignment)

    Empty loop in get_remote_tweets leads to error (variable referenced before assignment)

    > twtxt timeline
    Traceback (most recent call last):
      File "/usr/bin/twtxt", line 9, in <module>
        load_entry_point('twtxt==1.2.1', 'console_scripts', 'twtxt')()
      File "/usr/lib/python3.4/site-packages/click/core.py", line 716, in __call__
        return self.main(*args, **kwargs)
      File "/usr/lib/python3.4/site-packages/click/core.py", line 696, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python3.4/site-packages/click/core.py", line 1060, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/lib/python3.4/site-packages/click/core.py", line 889, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/lib/python3.4/site-packages/click/core.py", line 534, in invoke
        return callback(*args, **kwargs)
      File "/usr/lib/python3.4/site-packages/click/decorators.py", line 17, in new_func
        return f(get_current_context(), *args, **kwargs)
      File "/usr/lib/python3.4/site-packages/twtxt/cli.py", line 126, in timeline
        tweets = get_remote_tweets(sources, limit, timeout, cache)
      File "/usr/lib/python3.4/site-packages/twtxt/twhttp.py", line 123, in get_remote_tweets
        return tweets
    UnboundLocalError: local variable 'tweets' referenced before assignment
    

    This started after I added a few new follow urls, I don't know which one does that, will try to find out.

    bug waiting 
    opened by kdave 11
  • Support for RSS and Atom feeds

    Support for RSS and Atom feeds

    A lot of websites already provide feeds in RSS or Atom format. Popular browsers, like Mozilla Firefox, Microsoft Internet Explorer or Safari include features to view such feeds and subscribe to them. Using the Python feedparser module twtxt could be used to subscribe to such a feed without lots of additional code.

    This would also sidestep any debate regarding embedded media, metadata etc. as those who want metadata could always just provide Atom feeds (RSS is less capable). I have written a script to convert twtxt files to Atom feeds which could be patched for more metadata if so desired: http://news.dieweltistgarnichtso.net/bin/twtxt2atom

    enhancement 
    opened by erlehmann 11
  • Increase default message size

    Increase default message size

    140 characters is an archaic limitation that twitter only used so that single tweets could fit in an SMS. it's equivalent to not allowing lines of source code over 80 characters because then they won't fit on a punch card. Even doubling it, or 256 characters, would be an awesome improvement.

    question 
    opened by ghost 9
  • Follower url works in browser, does not in twtxt

    Follower url works in browser, does not in twtxt

    HTTP:

    twtxt -v follow mdom http://www.domgoergen.com/twtxt.txt
    ...
    twtxt.twhttp DEBUG    400, message='deflate'
    

    HTTPS

    ...
    twtxt.twhttp DEBUG    hostname 'www.domgoergen.com' doesn't match either of '*.kasserver.com', 'kasserver.com'
    

    works in the browser.

    enhancement question 
    opened by kdave 8
  • Updated Docstrings

    Updated Docstrings

    Hello buckket,

    I updated the docstrings of the twtxt/config.py because all the :param where missing. Also added a docstring for models.Source and added a newline to the end of main.py to follow PEP8.

    I look forward to contribute more in the future. Altoyyr

    opened by JDurstberger 8
  • Config file sanity checking, better error reporting

    Config file sanity checking, better error reporting

    I did a stupid typo Fasle instead of False in the config. This is reported as raw python exception. It would be good to print at least the line, or eg. the expected value type. The overall config sanity could look for uknown key names.

    enhancement 
    opened by kdave 8
  • Evil escape sequences

    Evil escape sequences

    Just a warning for those of you who are writing twtxt terminal clients: Please visit https://mosh.mit.edu/ and search for “Careful terminal emulation”. While we still ought to allow unicode, we should probably think about sanitizing each tweet before displaying it.

    ~@kas

    bug enhancement 
    opened by kseistrup 8
  • Add support of Python 3.7+

    Add support of Python 3.7+

    Problem: Generator-based coroutines are deprecated and scheduled for removal in Python 3.11 (docs). Due to that, twtxt doesn't work with Python 3.7+.

    Solution: I have changed gererator-based coroutines to async-def coroutines. Other dependencies have also been updated to current versions. Important: breaking changes, won't work with Python 3.6 or lower.

    Passed tests: https://github.com/win0err/twtxt/actions/runs/2009500872 I'll create a PR with integration with GitHub Actions in a separate PR.

    Closes #140, closes #141, closes #161, closes #162, closes #163

    P.S. Please, test the changes manually.

    enhancement 
    opened by win0err 7
  • Manually changing a nick will will not be noticed by the cache

    Manually changing a nick will will not be noticed by the cache

    When changing a nick in the [followings] section of the the config file it will not be picked up by the timeline command unless the cache for that entry is marked as stale, which only happens when the twtxt file changes.

    Solution: Always used the nick specified in the config file.

    bug 
    opened by buckket 0
  • Development environment pollution / using contained venvs

    Development environment pollution / using contained venvs

    Context

    Currently, running tests and installing the app requires the developer to install packages on the host directly, polluting the system with globally installed packages. This also implies that packages installed in the global scope could pollute the working environment. It would be neat if there was more isolation between twtxt and the machine used to run tests / develop on it.

    Proposed solution

    I would be tempted to add a bootstrapping script that would create a venv in which dev requirements and the app itself would be installed. This would ensure some isolation when iterating, as well as guarantee that we don't leak dependencies into the host system when someone sets everything up to run tests, lint or play around with the package.

    Something following the general pattern of the Scripts to Rule Them All feels appealing and could feature a bootstrapping script that sets up a venv (if one doesn't already exists) and installs dependencies in it.

    This would also make it easier to enforce something like a .python-version file to explicitly state what Python version development should happen in (i.e. anything >=3.7, based on the setup.py annotations).

    As a side-benefit, it would also help standardize what is being installed in CI (since we could leverage it the frozen dev requirements instead of manually installing select packages and opening the door to human error / drift in requirements).

    I'd be happy to put that together and push it up if there's interest!

    opened by mcataford 0
  • Can't install twtxt

    Can't install twtxt

    using python installed through chocolatey. Windows 10

    Installing collected packages: twtxt
      WARNING: Failed to write executable - trying to use .deleteme logic
    ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'C:\\Python310\\Scripts\\twtxt.exe' -> 'C:\\Python310\\Scripts\\twtxt.exe.deleteme'
    
    bug 
    opened by Obspogon 1
  • Suggestion: a convention for multiline statuses (line breaks)

    Suggestion: a convention for multiline statuses (line breaks)

    I would like to propose to a convention for multiline status updates or newlines in the twtxt format. The convention is backwards compatible with clients that do not support it. The conventions is: when the client sees a sequence of statuses with the same timestamp, join their text with a newline. A feed following this convention looks reasonable in a client that does not understand it as long as the client displays statues with the same timestamp in the order they appear.

    For example, twtxt currently renders

    1845-01-29T12:00:00Z	Once upon a midnight dreary, while I pondered, weak and weary,
    1845-01-29T12:00:00Z	Over many a quaint and curious volume of forgotten lore—
    1845-01-29T12:00:00Z	    While I nodded, nearly napping, suddenly there came a tapping,
    1845-01-29T12:00:00Z	As of some one gently rapping, rapping at my chamber door.
    1845-01-29T12:00:00Z	“’Tis some visitor,” I muttered, “tapping at my chamber door—
    1845-01-29T12:00:00Z	            Only this and nothing more.”
    

    as

    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    Once upon a midnight dreary, while I pondered, weak and weary,
    
    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    Over many a quaint and curious volume of forgotten lore—
    
    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    While I nodded, nearly napping, suddenly there came a tapping,
    
    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    As of some one gently rapping, rapping at my chamber door.
    
    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    “’Tis some visitor,” I muttered, “tapping at my chamber door—
    
    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    Only this and nothing more.”
    

    If support for this convention was implemented, twtxt could render the same file as

    ➤ http://127.0.0.1:8081/poe.txt (175 years ago):
    Once upon a midnight dreary, while I pondered, weak and weary,
    Over many a quaint and curious volume of forgotten lore—
    While I nodded, nearly napping, suddenly there came a tapping,
    As of some one gently rapping, rapping at my chamber door.
    “’Tis some visitor,” I muttered, “tapping at my chamber door—
    Only this and nothing more.”
    

    I have implemented the convention in my twtxt.tcl library and GUI feed reader. I have also made a page explaining it (pretty much like this issue does).

    What do you think?

    enhancement 
    opened by dbohdan 0
  • AUR package no longer working

    AUR package no longer working

    Traceback (most recent call last):
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 584, in _build_master
        ws.require(__requires__)
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 901, in require
        needed = self.resolve(parse_requirements(requirements))
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 792, in resolve
        raise VersionConflict(dist, req).with_context(dependent_req)
    pkg_resources.ContextualVersionConflict: (click 7.1.1 (/usr/lib/python3.8/site-packages), Requirement.parse('click<7,>=6.7'), {'twtxt'})
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/usr/bin/twtxt", line 6, in <module>
        from pkg_resources import load_entry_point
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3255, in <module>
        def _initialize_master_working_set():
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3238, in _call_aside
        f(*args, **kwargs)
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3267, in _initialize_master_working_set
        working_set = WorkingSet._build_master()
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 586, in _build_master
        return cls._build_from_requirements(__requires__)
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 599, in _build_from_requirements
        dists = ws.resolve(reqs, Environment())
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 787, in resolve
        raise DistributionNotFound(req, requirers)
    pkg_resources.DistributionNotFound: The 'click<7,>=6.7' distribution was not found and is required by twtxt
    
    bug 
    opened by treeshateorcs 3
Releases(v1.3.1)
  • v1.3.1(Nov 12, 2022)

  • v1.3.0(Nov 12, 2022)

  • v1.2.3(Sep 28, 2017)

  • v1.2.2(Sep 26, 2017)

  • v1.2.1(Feb 16, 2016)

    • Fixed a bug in the mention handling code
    • Nicks are now case-insensitive throughout twtxt
    • Added a character_limit option, to specify when to shorten tweets
    • Added option to include user’s nick and url in twtxt’s user-agent string for greater discovery
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Feb 12, 2016)

    • twtxt package is now executable
    • twtxt is now available as wheel archive
    • Check status of feed before following a new source
    • Added a source option to timeline command to only show one specific source
    • Added a view command which is basically an alias for the source option
    • Added support for local caching of remote twtxt files
    • Added support for mentions, see README.rst for more information
    • Added a pre_tweet_hook option, works like post_tweet_hook
    • Added a porcelain option, styles output script-friendly
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Feb 7, 2016)

    • Ignore status updates coming form the future.
    • Improved timestamp format by by removing microseconds and using local time.
    • Get confirmation before overwriting an existing source.
    • Allow tweet command to read from stdin. (echo "Test" | twtxt tweet)
    • Allow tweet command to accept unlimited amount of arguments. (twtxt tweet This is also valid)
    • Added an option to change the timeline sorting.
    • Added an option to specify max wait time for HTTP requests.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Feb 7, 2016)

  • v1.0.0(Feb 7, 2016)

Confirm that files have been uploaded to Backblaze Cloud Backup successfully

Backblaze Backup Checker This Python script compares metadata captured from files within source folders against data parsed from Backblaze Cloud Backu

18 Jul 29, 2022
Leveraged grid-trading bot using CCXT/CCXT Pro library in FTX exchange.

Leveraged-grid-trading-bot The code is designed to perform infinity grid trading strategy in FTX exchange. The basic trader named Gridtrader.py contro

Hao-Liang Wen 25 Oct 07, 2021
Rhythm bot clone for discord written in Python and uses YouTube to get media files.

Tunebot About Rhythm bot clone for discord written in Python and uses YouTube to get media files. Usage You need a .env file within the same directory

1 Oct 21, 2021
discord voice bot to stream radio

Radio-Id Bot (Discord Voice Bot) Radio-id-bot (Radio Indonesia) is a simple Discord Music Bot built with discord.py to play a radio from some Indonesi

Adi Fahmi 20 Sep 20, 2022
Account Profiles Dumper for Fortnite.

Fortnite Profile Dumper This program allows you to dump your Fortnite account profiles. How to use it? After starting the FortniteProfileDumper.py, yo

PRO100KatYT 12 Jul 28, 2022
Create a Neo4J graph of users and roles trust policies within an AWS Organization.

AWS_ORG_MAPPER This tool uses sso-oidc to authenticate to the AWS organization. Once authenticated the tool will attempt to enumerate all users and ro

Ruse 24 Jul 28, 2022
A Simple Telegram Inline Torrent Search Bot by @infotechIT

Torrent-Search-RoBot A Simple Telegram Inline Torrent Search Bot by @infotechIT. Torrent API Using api.infotech.wtf API Host Bot Deploy to Heroku Clic

InfoTech 0 May 05, 2022
iCloudPy is a simple iCloud webservices wrapper library written in Python

iCloudPy 🤟 Please star this repository if you end up using the library. It will help me continue supporting this product. 🙏 iCloudPy is a simple iCl

Mandar Patil 49 Dec 26, 2022
Tracks how much money a profile has in their bank and graphs it, as long as they enable the bank api

Tracks how much money a profile has in their bank and graphs it, as long as they enable the bank api. (you could really use this to track anything from the hypixel api)

1 Feb 08, 2022
Recommended AWS CDK project structure for Python applications

Recommended AWS CDK project structure for Python applications The project implements a user management backend component that uses Amazon API Gateway,

AWS Samples 110 Jan 06, 2023
PR Changes Matrix Builder

Pr-changes-matrix-builder - A Github Action that will output a variable to be used in a matrix strategy job based on a PR&'s changes

Kyle James Walker (he/him) 21 Oct 04, 2022
Free Game Download Client

XGames Free Game Download Client В проекте была использована библиотека igruha а также PyQt5 WARN ⚠️ Возможно потребуется скачать и установить vc_redi

LORD_CODE 3 Jun 25, 2022
Simple web browser to visualize HiC tracks

HiCBrowser : A simple web browser to visualize Hi-C and other genomic tracks Fidel Ramirez, José Villaveces, Vivek Bhardwaj Installation You can insta

The deepTools ecosystem 14 Jun 21, 2022
Pydf: A modular Telegram Bot which provides Pdf Tools using PyPdf2

pyDF-Bot 🌍 Pydf - Pyrogram Document File Bot, a modular Telegram Bot which prov

HyDrix 2 Feb 18, 2022
A collection of discord tools I've made.

Discord A collection of discord tools i've made. What's in here? Basically every discord related project i've worked on can be found here, i'll try an

?? ?? ?? 6 Nov 13, 2021
Discord bot do sprawdzania ceny pizzy.

Discord bot do sprawdzania ceny pizzy w pizzeri Bombola. Umieszczony jest na platformie Heroku, dzięki czemu działa 24/7. Commands List Info: Jako com

1 Sep 18, 2021
A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.

A Happy and lightweight Python Package that Provides an API to search for articles on Google News and returns a JSON response.

Muhammad Abdullah 273 Dec 31, 2022
A Discord bot to easily and quickly format your JSON data

Invite PrettyJSON to your Discord server Table of contents About the project What is JSON? What is pretty printing? How to use Input options Command I

Sem 4 Jan 24, 2022
Requests based multi-threaded script for increasing followers on Spotify

Proxyless Spotify Follow Bot Requests based multi-threaded script for increasing followers on Spotify. Click here to report bugs. Usage Download ZIP h

397 Jan 03, 2023
A minimalist file manager for those who want to use Linux mobile devices.

Portfolio A minimalist file manager for those who want to use Linux mobile devices. Usage Tap to activate and press to select, to browse, open, copy,

Martin Abente Lahaye 71 Nov 18, 2022