• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

wtsnjp/twoot.py: Sync Twitter and Mastodon nicely

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

wtsnjp/twoot.py

开源软件地址(OpenSource Url):

https://github.com/wtsnjp/twoot.py

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

twoot.py (v1.3.0)

Sync Twitter and Mastodon nicely ― forward tweets to Mastodon and forward toots to Twitter, carefully not to make duplicate posts on a service. Other features of twoot.py:

  • images are also forwarded each other,
  • sync so-called "thread" and "self BT/RT" as well,
  • shortened URLs (such as https://t.co/*) are expanded before posting, and
  • multiple pairs of Mastodon/Twitter accounts are supported.

Requirements

This script is designed to work with Python (3.5 or later).

Installation

All dependencies can be installed by one shot:

$ python setup.py install

Usage

Setup running

After installing the script, run twoot.py once by hand and fill the following fields:

$ python twoot.py
Welcome to Twoot! Please answer a few questions.

#1 First, decide about your application.
Name (optional; empty for "twoot.py"): 
Website (optional; empty for "https://github.com/wtsnjp/twoot.py"): 

#2 Tell me about your Mastodon account.
Instance (e.g., https://mastodon.social): 
Login e-mail (never stored): 
Login password (never stored): 

#3 Tell me about your Twitter account.
cf. You can get keys & tokens from https://developer.twitter.com/
API key: 
API secret key: 
Access token: 
Access token secret: 

All configuration done. Thanks!

When the setup mode is completed successfully, all necessary configuration will be stored under $HOME/.twoot.py. No toots nor tweets are sent within the setup mode.

Note: If you want to change these configuration, execute python twoot.py --setup to start setup mode once again or just edit $HOME/.twoot.py/default.json directly.

Regular running

After the setup running, set cron (or whatever) to run python twoot.py regularly, e.g., running every 15 sec:

* * * * * for i in `seq 0 15 59`;do (sleep ${i}; python /path/to/twoot.py --log=/path/to/twoot.log) & done;

Using profile

You can detect a profile with the command line option --profile (-p) to use this script for multiple accounts. The configuration and the data for a profile NAME are saved to ~/.twoot.py/NAME.json and ~/.twoot.py/NAME.pickle respectively. When you omit the command line option, the "default" profile is automatically selected.

License

This software is distributed under the MIT license.


Takuto ASAKURA (wtsnjp)




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap