You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cross-post.rb 394B

123456789101112131415161718192021222324252627
  1. require 'cross-post/config'
  2. require 'cross-post/mastodon'
  3. require 'cross-post/twitter'
  4. class CrossPost
  5. def initialize
  6. @config = Config.new
  7. @mastodon = Mastodon.new @config
  8. @twitter = Twitter.new @config
  9. end
  10. def post(text)
  11. @mastodon.post text
  12. end
  13. def feed
  14. @mastodon.feed @twitter
  15. end
  16. def self.post(text)
  17. self.new.post text
  18. end
  19. def self.feed
  20. self.new.feed
  21. end
  22. end