twitter2mastodon 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.rspec +3 -0
- data/.rubocop.yml +5 -0
- data/.travis.yml +16 -0
- data/CHANGELOG.md +0 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +113 -0
- data/LICENSE.txt +21 -0
- data/README.md +42 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/twitter2mastodon +3 -0
- data/lib/twitter2mastodon.rb +64 -0
- data/lib/twitter2mastodon/configuration.rb +31 -0
- data/lib/twitter2mastodon/status.rb +16 -0
- data/lib/twitter2mastodon/store.rb +51 -0
- data/lib/twitter2mastodon/version.rb +3 -0
- data/twitter2mastodon.gemspec +41 -0
- metadata +207 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b06e524dbd02b67e401eae37a13bf3aa002f3435c59affad1ecc449ed12f9066
|
4
|
+
data.tar.gz: 3c01793ab6b460232c1daf8b41505b95d76025a12befc52193f569765894f014
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7ace622e28649e526e1f638f88f20a13cf133bd64aa9d48497ea031837e2add526381e16beae7b50bcce4e010f918ace8d0e0844738c7aba93a069629f75fdcd
|
7
|
+
data.tar.gz: 7c3a4221bb347e0d5ad9cca87a08b30e5496c39f32776a7d8609c3c6111d8c1bc4eeb55299b131cf06f29470597cf8d1bb43de7c531e0db75722ae3e077f8180
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
sudo: false
|
3
|
+
language: ruby
|
4
|
+
cache: bundler
|
5
|
+
rvm:
|
6
|
+
- 2.6.1
|
7
|
+
before_install: gem install bundler -v 2.0.1
|
8
|
+
before_script:
|
9
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
10
|
+
- chmod +x ./cc-test-reporter
|
11
|
+
- ./cc-test-reporter before-build
|
12
|
+
script:
|
13
|
+
- bundle exec rspec
|
14
|
+
- bundle exec rubocop -DESP
|
15
|
+
after_script:
|
16
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
data/CHANGELOG.md
ADDED
File without changes
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at fardeauarmand@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
twitter2mastodon (0.1.0)
|
5
|
+
mastodon (~> 0.3.1)
|
6
|
+
mastodon-api (~> 2.0.0)
|
7
|
+
thor (~> 0.20.3)
|
8
|
+
twitter (~> 6.2.0)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
addressable (2.6.0)
|
14
|
+
public_suffix (>= 2.0.2, < 4.0)
|
15
|
+
ast (2.4.0)
|
16
|
+
buftok (0.2.0)
|
17
|
+
byebug (11.0.0)
|
18
|
+
diff-lcs (1.3)
|
19
|
+
docile (1.3.1)
|
20
|
+
domain_name (0.5.20180417)
|
21
|
+
unf (>= 0.0.5, < 1.0.0)
|
22
|
+
equalizer (0.0.11)
|
23
|
+
http (3.3.0)
|
24
|
+
addressable (~> 2.3)
|
25
|
+
http-cookie (~> 1.0)
|
26
|
+
http-form_data (~> 2.0)
|
27
|
+
http_parser.rb (~> 0.6.0)
|
28
|
+
http-cookie (1.0.3)
|
29
|
+
domain_name (~> 0.5)
|
30
|
+
http-form_data (2.1.1)
|
31
|
+
http_parser.rb (0.6.0)
|
32
|
+
jaro_winkler (1.5.2)
|
33
|
+
json (2.2.0)
|
34
|
+
mastodon (0.3.1)
|
35
|
+
mastodon-api (2.0.0)
|
36
|
+
addressable (~> 2.6)
|
37
|
+
buftok (~> 0)
|
38
|
+
http (~> 3.3)
|
39
|
+
oj (~> 3.7)
|
40
|
+
memoizable (0.4.2)
|
41
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
42
|
+
multipart-post (2.0.0)
|
43
|
+
naught (1.1.0)
|
44
|
+
oj (3.7.9)
|
45
|
+
parallel (1.14.0)
|
46
|
+
parser (2.6.0.0)
|
47
|
+
ast (~> 2.4.0)
|
48
|
+
powerpack (0.1.2)
|
49
|
+
psych (3.1.0)
|
50
|
+
public_suffix (3.0.3)
|
51
|
+
rainbow (3.0.0)
|
52
|
+
rake (10.5.0)
|
53
|
+
rspec (3.8.0)
|
54
|
+
rspec-core (~> 3.8.0)
|
55
|
+
rspec-expectations (~> 3.8.0)
|
56
|
+
rspec-mocks (~> 3.8.0)
|
57
|
+
rspec-core (3.8.0)
|
58
|
+
rspec-support (~> 3.8.0)
|
59
|
+
rspec-expectations (3.8.2)
|
60
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
+
rspec-support (~> 3.8.0)
|
62
|
+
rspec-mocks (3.8.0)
|
63
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
+
rspec-support (~> 3.8.0)
|
65
|
+
rspec-support (3.8.0)
|
66
|
+
rubocop (0.65.0)
|
67
|
+
jaro_winkler (~> 1.5.1)
|
68
|
+
parallel (~> 1.10)
|
69
|
+
parser (>= 2.5, != 2.5.1.1)
|
70
|
+
powerpack (~> 0.1)
|
71
|
+
psych (>= 3.1.0)
|
72
|
+
rainbow (>= 2.2.2, < 4.0)
|
73
|
+
ruby-progressbar (~> 1.7)
|
74
|
+
unicode-display_width (~> 1.4.0)
|
75
|
+
ruby-progressbar (1.10.0)
|
76
|
+
simple_oauth (0.3.1)
|
77
|
+
simplecov (0.16.1)
|
78
|
+
docile (~> 1.1)
|
79
|
+
json (>= 1.8, < 3)
|
80
|
+
simplecov-html (~> 0.10.0)
|
81
|
+
simplecov-html (0.10.2)
|
82
|
+
thor (0.20.3)
|
83
|
+
thread_safe (0.3.6)
|
84
|
+
twitter (6.2.0)
|
85
|
+
addressable (~> 2.3)
|
86
|
+
buftok (~> 0.2.0)
|
87
|
+
equalizer (~> 0.0.11)
|
88
|
+
http (~> 3.0)
|
89
|
+
http-form_data (~> 2.0)
|
90
|
+
http_parser.rb (~> 0.6.0)
|
91
|
+
memoizable (~> 0.4.0)
|
92
|
+
multipart-post (~> 2.0)
|
93
|
+
naught (~> 1.0)
|
94
|
+
simple_oauth (~> 0.3.0)
|
95
|
+
unf (0.1.4)
|
96
|
+
unf_ext
|
97
|
+
unf_ext (0.0.7.5)
|
98
|
+
unicode-display_width (1.4.1)
|
99
|
+
|
100
|
+
PLATFORMS
|
101
|
+
ruby
|
102
|
+
|
103
|
+
DEPENDENCIES
|
104
|
+
bundler (~> 2.0.1)
|
105
|
+
byebug (~> 11.0.0)
|
106
|
+
rake (~> 10.0)
|
107
|
+
rspec (~> 3.0)
|
108
|
+
rubocop (~> 0.65.0)
|
109
|
+
simplecov (~> 0.16.1)
|
110
|
+
twitter2mastodon!
|
111
|
+
|
112
|
+
BUNDLED WITH
|
113
|
+
2.0.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Armand
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Twitter2mastodon
|
2
|
+
![Travis build](https://travis-ci.org/armandfardeau/twitter2mastodon.svg?branch=master)
|
3
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/40816bd505e6a66e0147/maintainability)](https://codeclimate.com/github/armandfardeau/twitter2mastodon/maintainability)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/40816bd505e6a66e0147/test_coverage)](https://codeclimate.com/github/armandfardeau/twitter2mastodon/test_coverage)
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'twitter2mastodon'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install twitter2mastodon
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
TODO: Write usage instructions here
|
25
|
+
|
26
|
+
## Development
|
27
|
+
|
28
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
29
|
+
|
30
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
31
|
+
|
32
|
+
## Contributing
|
33
|
+
|
34
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/twitter2mastodon. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
35
|
+
|
36
|
+
## License
|
37
|
+
|
38
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
39
|
+
|
40
|
+
## Code of Conduct
|
41
|
+
|
42
|
+
Everyone interacting in the Twitter2mastodon project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/twitter2mastodon/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "twitter2mastodon"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
require "twitter2mastodon/version"
|
2
|
+
require "thor"
|
3
|
+
require "byebug"
|
4
|
+
require "yaml"
|
5
|
+
require "twitter2mastodon/status"
|
6
|
+
require "twitter2mastodon/configuration"
|
7
|
+
require "twitter2mastodon/store"
|
8
|
+
|
9
|
+
module Twitter2mastodon
|
10
|
+
class Cli < Thor
|
11
|
+
class_option :ultraverbose, type: :boolean, aliases: "-V"
|
12
|
+
class_option :verbose, type: :boolean, aliases: "-v"
|
13
|
+
class_option :configfile, type: :string, aliases: "-c"
|
14
|
+
|
15
|
+
desc "get_last_tweet", "Get last tweet from a user a toots it!"
|
16
|
+
method_option :user, type: :string, aliases: "-u"
|
17
|
+
|
18
|
+
def get_last_tweet
|
19
|
+
message_count = 0
|
20
|
+
return unless options[:configfile]
|
21
|
+
|
22
|
+
# Configure different client
|
23
|
+
configuration = Twitter2Mastodon::Configuration.new(options[:configfile])
|
24
|
+
|
25
|
+
puts configuration.inspect if options[:ultraverbose]
|
26
|
+
|
27
|
+
twitter = configuration.twitter_client
|
28
|
+
mastodon = configuration.mastodon_client
|
29
|
+
@store = Twitter2Mastodon::Store.new
|
30
|
+
|
31
|
+
users = if options[:user]
|
32
|
+
[options[:user]]
|
33
|
+
else
|
34
|
+
configuration.users
|
35
|
+
end
|
36
|
+
|
37
|
+
users.each do |user|
|
38
|
+
# get last tweet and stores it
|
39
|
+
last_twitt = twitter.user_timeline(user).reject(&:retweet?).reject(&:user_mentions?).first
|
40
|
+
last_twitt = @store.add_to_store(Twitter2Mastodon::Status.new(last_twitt))
|
41
|
+
|
42
|
+
# publish status
|
43
|
+
if last_twitt
|
44
|
+
mastodon.create_status(last_twitt.status)
|
45
|
+
message_count += 1
|
46
|
+
puts "Succefully published #{last_twitt.message}" if options[:ultraverbose]
|
47
|
+
else
|
48
|
+
puts "No new status has been published" if options[:ultraverbose]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
puts @store.store if options[:ultraverbose]
|
53
|
+
return unless options[:verbose]
|
54
|
+
|
55
|
+
if message_count
|
56
|
+
puts "Succefully published #{message_count} status"
|
57
|
+
else
|
58
|
+
puts "No status published as expected"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
Cli.start
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require "twitter"
|
2
|
+
require "mastodon"
|
3
|
+
|
4
|
+
module Twitter2Mastodon
|
5
|
+
class Configuration
|
6
|
+
attr_reader :mastodon, :twitter, :users
|
7
|
+
|
8
|
+
def initialize(config_file)
|
9
|
+
file = File.expand_path(config_file)
|
10
|
+
raise ArgumentError, "No file provided" unless File.exist?(file)
|
11
|
+
|
12
|
+
configuration = YAML.load_file(file)
|
13
|
+
@users = configuration["users"].map { |user| user.downcase }
|
14
|
+
@twitter = configuration["twitter"]
|
15
|
+
@mastodon = configuration["mastodon"]
|
16
|
+
end
|
17
|
+
|
18
|
+
def twitter_client
|
19
|
+
Twitter::REST::Client.new do |config|
|
20
|
+
config.consumer_key = twitter["consumer_key"]
|
21
|
+
config.consumer_secret = twitter["consumer_secret"]
|
22
|
+
config.access_token = twitter["access_token"]
|
23
|
+
config.access_token_secret = twitter["access_token_secret"]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def mastodon_client
|
28
|
+
Mastodon::REST::Client.new(base_url: mastodon["base_url"], bearer_token: mastodon["bearer_token"])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Twitter2Mastodon
|
2
|
+
class Status
|
3
|
+
attr_reader :message, :url, :name, :id
|
4
|
+
|
5
|
+
def initialize(twitt_object)
|
6
|
+
@id = twitt_object.id
|
7
|
+
@name = twitt_object.user.name
|
8
|
+
@message = twitt_object.full_text
|
9
|
+
@url = twitt_object.url
|
10
|
+
end
|
11
|
+
|
12
|
+
def status
|
13
|
+
"#{name}\n\n#{message}\n\nOriginal tweet:#{url}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require "etc"
|
2
|
+
require "yaml"
|
3
|
+
|
4
|
+
module Twitter2Mastodon
|
5
|
+
class Store
|
6
|
+
attr_reader :store
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@store_file = find_or_create_store
|
10
|
+
@store = JSON.parse(File.read(@store_file))
|
11
|
+
end
|
12
|
+
|
13
|
+
def never_been_published?(twitt)
|
14
|
+
@store.none? { |tweet| tweet[0] == make_hash(twitt) }
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_to_store(tweet_object)
|
18
|
+
status = tweet_object
|
19
|
+
id = make_hash(tweet_object)
|
20
|
+
|
21
|
+
return nil unless never_been_published?(tweet_object)
|
22
|
+
|
23
|
+
clean_store
|
24
|
+
|
25
|
+
@store[id] = { name: status.name, message: status.message, uri: status.url.to_str }
|
26
|
+
File.write(@store_file, @store.to_json)
|
27
|
+
|
28
|
+
tweet_object
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def clean_store
|
34
|
+
return unless @store.size > 100
|
35
|
+
|
36
|
+
@store.shift
|
37
|
+
end
|
38
|
+
|
39
|
+
def find_or_create_store
|
40
|
+
file = File.join(Etc.getpwuid.dir, ".twitter2mastodon.json")
|
41
|
+
return file if File.exist?(file)
|
42
|
+
|
43
|
+
FileUtils.touch file
|
44
|
+
File.write(file, "{}")
|
45
|
+
end
|
46
|
+
|
47
|
+
def make_hash(tweet_object)
|
48
|
+
Digest::MD5.hexdigest tweet_object.message + tweet_object.id.to_s
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "twitter2mastodon/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "twitter2mastodon"
|
7
|
+
spec.version = Twitter2Mastodon::VERSION
|
8
|
+
spec.authors = ["Armand Fardeau"]
|
9
|
+
spec.email = ["fardeauarmand@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Tweet from Twitter to Mastodon."
|
12
|
+
spec.description = "Import Tweet from twitter and publish them to Mastodon."
|
13
|
+
spec.homepage = "https://github.com/armandfardeau/twitter2mastodon"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes." unless spec.respond_to?(:metadata)
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/armandfardeau/twitter2mastodon"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/armandfardeau/twitter2mastodon/blob/master/CHANGELOG.md"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
25
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 2.0.1"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_development_dependency "rubocop", "~> 0.65.0"
|
35
|
+
spec.add_development_dependency "simplecov", "~> 0.16.1"
|
36
|
+
spec.add_development_dependency "byebug", "~>11.0.0"
|
37
|
+
spec.add_runtime_dependency "thor", "~> 0.20.3"
|
38
|
+
spec.add_runtime_dependency "twitter", "~>6.2.0"
|
39
|
+
spec.add_runtime_dependency "mastodon-api", "~>2.0.0"
|
40
|
+
spec.add_runtime_dependency "mastodon", "~>0.3.1"
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: twitter2mastodon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Armand Fardeau
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.1
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.65.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.65.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.16.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.16.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 11.0.0
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 11.0.0
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: thor
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.20.3
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.20.3
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: twitter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 6.2.0
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 6.2.0
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: mastodon-api
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 2.0.0
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 2.0.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: mastodon
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 0.3.1
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 0.3.1
|
153
|
+
description: Import Tweet from twitter and publish them to Mastodon.
|
154
|
+
email:
|
155
|
+
- fardeauarmand@gmail.com
|
156
|
+
executables:
|
157
|
+
- twitter2mastodon
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- ".gitignore"
|
162
|
+
- ".rspec"
|
163
|
+
- ".rubocop.yml"
|
164
|
+
- ".travis.yml"
|
165
|
+
- CHANGELOG.md
|
166
|
+
- CODE_OF_CONDUCT.md
|
167
|
+
- Gemfile
|
168
|
+
- Gemfile.lock
|
169
|
+
- LICENSE.txt
|
170
|
+
- README.md
|
171
|
+
- Rakefile
|
172
|
+
- bin/console
|
173
|
+
- bin/setup
|
174
|
+
- exe/twitter2mastodon
|
175
|
+
- lib/twitter2mastodon.rb
|
176
|
+
- lib/twitter2mastodon/configuration.rb
|
177
|
+
- lib/twitter2mastodon/status.rb
|
178
|
+
- lib/twitter2mastodon/store.rb
|
179
|
+
- lib/twitter2mastodon/version.rb
|
180
|
+
- twitter2mastodon.gemspec
|
181
|
+
homepage: https://github.com/armandfardeau/twitter2mastodon
|
182
|
+
licenses:
|
183
|
+
- MIT
|
184
|
+
metadata:
|
185
|
+
homepage_uri: https://github.com/armandfardeau/twitter2mastodon
|
186
|
+
source_code_uri: https://github.com/armandfardeau/twitter2mastodon
|
187
|
+
changelog_uri: https://github.com/armandfardeau/twitter2mastodon/blob/master/CHANGELOG.md
|
188
|
+
post_install_message:
|
189
|
+
rdoc_options: []
|
190
|
+
require_paths:
|
191
|
+
- lib
|
192
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
requirements: []
|
203
|
+
rubygems_version: 3.0.2
|
204
|
+
signing_key:
|
205
|
+
specification_version: 4
|
206
|
+
summary: Tweet from Twitter to Mastodon.
|
207
|
+
test_files: []
|