在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):YoloSwagTeam/t2m开源软件地址(OpenSource Url):https://github.com/YoloSwagTeam/t2m开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):t2m - Twitter 2 MastodonA script to manage the forwarding of tweets from Twitter accounts to a Mastodon one. InstallationUsing pip:
Alternatively from source, on debian/ubuntu:
Then you need twitter API credentials. Following this tutorial https://python-twitter.readthedocs.io/en/latest/getting_started.html then create a
The credentials for Mastodon are automatically generated at the first startup. Python 2/3 and one known bugCompatible with both. There is a known bug if you run python2 coming for the STL lib This bug is fixed in python 3 so I would recommend running t2m with it. UsageOne accountForward for one account:
This will forward all not already forwarded tweet (this can be up to 200) while waiting 30 seconds between each toot. This will also remember the mastodon account (so you don't need to specify it again). Tweets that starts with a "@" won't be forwarded. Retweets won't be forwarded unless the You might want a finer control on your action, so you can do:
To forward only 10 tweet (be careful: if you relaunch the command this will forward 10 other tweets that weren't already forwarded). You 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:
If you want to test your commands without forwarding you can simply uses the
RecommendationIn general, when I had a new account I look at its timeline, read how many tweets make sens then do:
Several accountsTo forward tweets for all accounts, simply run:
This is a good command to put inside a crontab. To check all accounts that will be forwarded, do a:
You can also add an account directly without using the
RetweetsWhen enabled, retweets are forwarded using the
To create a link to the original tweet, use Content WarningsContent warnings can be added automatically to toots based on regular expressions. These are configured by creating a file named cw.json. For example, simple patterns can be used to match any tweet mentioning specific keywords: {
"coding": [
"code", "coding", "pull request", "github", "git", "json", "regex"
],
"coffee": [
"#coffee", "coffee", "caffeine"
]
} If a regex pattern contains a group then that group will be used as the content warning text. This allows rules such as using the first hashtag of a tweet as the CW warning: {
"hashtag-prefix": [
"^(#[^\\s]*)\\s"
]
} This also allows using a prefix such as CW to specify that the first line of a tweet should be used as the content warning: {
"cw-prefix": [
"^CW (.*)\\n"
]
} Note that the regex is matched after the Licence
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论