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

anewton1998/gp2toot: Takes a G+ Takeout dump and sends it to a Mastodon instance

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

开源软件名称(OpenSource Name):

anewton1998/gp2toot

开源软件地址(OpenSource Url):

https://github.com/anewton1998/gp2toot

开源编程语言(OpenSource Language):

Ruby 100.0%

开源软件介绍(OpenSource Introduction):

gp2toot

Reads a Google+ (G+) Takeout (Takeaway) downloaded archive and sends them to Mastodon.

Status

Current Status: Needs User Testing and Feedback

I have added all the functionality I plan to add at this point, and I'm waiting on feedback.

Changelog

  • Initial code prototype.
  • 0.5 functionality:
    • Currently posting textual status to Mastodon.
    • Can delete the posted statuses.
    • Also can limit the number of posts per run, so posts can be migrated over time (via a cron)
    • Has a throttle time because to be nice.
    • Will split posts and thread them if they exceed the Mastodon status character limit
    • Uploads media associated with a post.
    • Removes HTML from the original G+ posts.
    • Will backdate posts if/when Mastodon adds the feature. See mastodon/mastodon#10639

Prerequisites

You'll need

  1. Ruby
  2. Nokogiri
  3. bundler

Ruby

You'll need Ruby. This is being tested with version 2.6.2 so that is recommended at the very least. Installation varies depending on the system you are using.

Nokogiri

Nokogiri is a Ruby extension that parse HTML and HTML fragments. It uses a native libxml extension to Ruby, so there may be extra steps required to install it. See https://nokogiri.org/tutorials/installing_nokogiri.html

Bundler

Bundler is gem dependency manager for Ruby gems. Installing it is easy:

gem install bundler

Install

After you have cloned this Git repository, run bundler to install all the necessary gem dependencies.

bundler install

How to Use

In the /etc directory, there is a sample_config.rb file. Copy the file to a name of your desire (e.g. my_config.rb) and edit it with your parameters.

You can run an analysis on your G+ Takeout by doing the following:

bundler exec bin/gp2toot.rb -c my_config.rb -a

To get the access token (bearer token), you should go into your Mastodon settings -> development. Once there, create a new application. Once created, view it and get the access token.

Chances are that you will want to do a little testing before adding all your content. Use the config.limit value to limit the number of posts and media. Additionally, config.visibility should be left to unlisted for testing so that your posts don't annoy other users on the Mastodon instance.

The config.throttle value is important as Mastodon will start throttling you. Dropping it to zero is a surefire way of causing problems.

To migrate the G+ posts, execute with bundler like so:

bundler exec bin/gp2toot.rb -c my_config.rb -p

Be default, a log file is kept in var and along with files containing the status IDs of statuses that have been submitted.

To have the program attempt to delete its posts, you can pass the --delete-posts or -P option.

bundler exec bin/gp2toot.rb -c my_config.rb --delete-posts

By default, it will attempt to delete the posts from the last run. If you want it to delete all posts from all previous runs, use the all argument.

bundler exec bin/gp2toot.rb -c my_config.rb --delete-posts=all

To add posts over time, use the config.limit value, and simply run the program periodically (such as with cron). Gp2Toot keeps track of which G+ posts have been sent to Mastodon and will not resend posts.

How to Provide Feedback

The best way to provide feedback is by entering a GitHub issue.

You can also contact me on Mastodon at @[email protected].

How to Contribute

If you want to provide bug fixes or new features or whatnot, please submit a Pull Request.




鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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