{ "info": { "author": "Laurent Peuch and al.", "author_email": "cortex@worlddomination.be", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Topic :: Communications", "Topic :: Utilities" ], "description": "# t2m - Twitter 2 Mastodon\n\nA script to manage the forwarding of tweets from Twitter accounts to a Mastodon one.\n\n[![Build Status](https://travis-ci.org/yoloswagteam/t2m.svg?branch=refactoring-tests-pip-installation)](https://travis-ci.org/fcayre/t2m)\n\n# Installation\n\nOn debian/ubuntu:\n\n sudo apt-get install python-virtualenv\n\n virtualenv ve\n source ve/bin/activate\n\n # if you run with an old version of python 2.7 (Ubuntu 14.04 for example)\n # you'll need to run those, otherwise requests will break because it won't\n # be able to correctly verify the host of the https issuer\n # if you use python 3 you can ignore that\n pip install pyopenssl ndg-httpsclient pyasn1\n\n python setup.py develop\n\nThen you need twitter API credentials. Following this tutorial https://python-twitter.readthedocs.io/en/latest/getting_started.html then create a `conf.yaml` file of this format:\n\n consumer_key: \"...\"\n consumer_secret: \"...\"\n access_token_key: \"...\"\n access_token_secret: \"...\"\n\nThe credentials for Mastodon are automatically generated at the first startup.\n\n# Python 2/3 and one known bug\n\nCompatible with both.\n\nThere is a known bug if you run python2 coming for the STL lib `mimetypes`:\nJPEG images will be uploaded with the `.jpe` extension, this will break \"going\non the exact url of the image\" (will cause a download instead of a display).\n\nThis bug is fixed in python 3 so I would recommend running t2m with it.\n\n# Usage\n\n## One account\n\nForward for one account:\n\n t2m one twitter_account -m mastodon_account\n\nThis will forward all not already forwarded tweet (this can be up to 200) while\nwaiting 30 seconds between each toot. This will also remember the mastodon account (so you don't need to specify it again).\n\nTweets that starts with a \"@\" won't be forwarded. Retweets won't be forwarded unless the `-r` option is specified.\n\nYou might want a finer control on your action, so you can do:\n\n t2m one twitter_account -m mastodon_account -n 10\n\nTo forward only 10 tweet (be careful: if you relaunch the command this will forward 10 other tweets that weren't already forwarded).\n\nYou can also mark the whole available tweet as \"already seen\" without forwarding them so they'll never be forwarded in the future by using this command:\n\n t2m one twitter_account -m mastodon_account -o\n\nIf you want to test your commands without forwarding you can simply uses the `-d` (or `--debug`) option:\n\n t2m one twitter_account -m mastodon_account -d\n t2m one twitter_account -m mastodon_account -n 10 -d\n\n## Recommendation\n\nIn general, when I had a new account I look at its timeline, read how many tweets make sens then do:\n\n t2m one twitter_account -m mastodon_account -n \n t2m one twitter_account -m mastodon_account -o\n\n## Several accounts\n\nTo forward tweets for all accounts, simply run:\n\n t2m all\n\nThis is a good command to put inside a crontab.\n\nTo check all accounts that will be forwarded, do a:\n\n t2m list\n\nYou can also add an account directly without using the `one` command using:\n\n t2m add twitter_account mastodon_account\n\n## Retweets\n\nWhen enabled, retweets are forwarded using the `retweet.tmpl` file as a template, feel free to edit it to suit your needs. The following tokens will be replaced in the template:\n\n* `%(text)s`: the retweeted text\n* `%(user)s`: the original tweet author username\n* `%(id)s`: the original tweet id\n\nTo create a link to the original tweet, use `https://twitter.com/%(user)s/status/%(id)s`. To link to the original author profile, use `https://twitter.com/%(user)s`.\n\n\n## Content Warnings\n\nContent warnings can be added automatically to toots based on regular\nexpressions. These are configured by creating a file named cw.json.\n\nFor example, simple patterns can be used to match any tweet mentioning specific\nkeywords:\n\n```json\n{\n \"coding\": [\n \"code\", \"coding\", \"pull request\", \"github\", \"git\", \"json\", \"regex\"\n ],\n \"coffee\": [\n \"#coffee\", \"coffee\", \"caffeine\"\n ]\n}\n```\n\nIf a regex pattern contains a group then that group will be used as the content\nwarning text. This allows rules such as using the first hashtag of a tweet as\nthe CW warning:\n\n```json\n{\n \"hashtag-prefix\": [\n \"^(#[^\\\\s]*)\\\\s\"\n ]\n}\n```\n\nThis also allows using a prefix such as CW to specify that the first line of a\ntweet should be used as the content warning:\n\n```json\n{\n \"cw-prefix\": [\n \"^CW (.*)\\\\n\"\n ]\n}\n```\n\nNote that the regex is matched after the `retweet.tmpl` file is applied as a\ntemplate, so this can be used to automatically apply a content warning to all\nRTs, or RTs from specific people, etc.\n\n# Licence\n\n Copyright (C) 2017-2018 Laurent Peuch and [Contributors](https://github.com/Psycojoker/t2m/graphs/contributors)\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Psycojoker/t2m", "keywords": "mastodon twitter bot robot", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "t2m", "package_url": "https://pypi.org/project/t2m/", "platform": "", "project_url": "https://pypi.org/project/t2m/", "project_urls": { "Homepage": "https://github.com/Psycojoker/t2m" }, "release_url": "https://pypi.org/project/t2m/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Twitter to Mastodon timeline forwarding tool", "version": "0.1.0" }, "last_serial": 3670986, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "029ada5b1eabdaa66479f55c6d25caf2", "sha256": "a3cf9dae2c076b0c2d3045f266c1584b9eaf7b9e107f59b2b90177902eed03bf" }, "downloads": -1, "filename": "t2m-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "029ada5b1eabdaa66479f55c6d25caf2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 27519, "upload_time": "2018-03-15T01:17:57", "url": "https://files.pythonhosted.org/packages/51/f4/7856e474371c62bae74ab923b72bdcde4a594c1a1349146d2c7c0e88c0bb/t2m-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc3150e99822bfe0af4fa041f8c52cce", "sha256": "6f1479454328af0a338d71d714ae0cc6d6aa9d4f5644eb4fa7a0c01c781fe20b" }, "downloads": -1, "filename": "t2m-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fc3150e99822bfe0af4fa041f8c52cce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24193, "upload_time": "2018-03-15T01:17:55", "url": "https://files.pythonhosted.org/packages/21/fe/3790458db01abcf408b446954e554a1fd4180b7763f5b92424afbdaec92c/t2m-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "029ada5b1eabdaa66479f55c6d25caf2", "sha256": "a3cf9dae2c076b0c2d3045f266c1584b9eaf7b9e107f59b2b90177902eed03bf" }, "downloads": -1, "filename": "t2m-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "029ada5b1eabdaa66479f55c6d25caf2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 27519, "upload_time": "2018-03-15T01:17:57", "url": "https://files.pythonhosted.org/packages/51/f4/7856e474371c62bae74ab923b72bdcde4a594c1a1349146d2c7c0e88c0bb/t2m-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc3150e99822bfe0af4fa041f8c52cce", "sha256": "6f1479454328af0a338d71d714ae0cc6d6aa9d4f5644eb4fa7a0c01c781fe20b" }, "downloads": -1, "filename": "t2m-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fc3150e99822bfe0af4fa041f8c52cce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24193, "upload_time": "2018-03-15T01:17:55", "url": "https://files.pythonhosted.org/packages/21/fe/3790458db01abcf408b446954e554a1fd4180b7763f5b92424afbdaec92c/t2m-0.1.0.tar.gz" } ] }