您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415
  1. #!/usr/bin/env ruby
  2. require 'cross-post'
  3. require 'awesome_print'
  4. config = CrossPost::Config.new
  5. url = config['mastodon.url']
  6. token = config['mastodon.token']
  7. client = ::Mastodon::REST::Client.new base_url: url, bearer_token: token
  8. media = '/home/aeris/Images/tux-debian.png'
  9. media = client.upload_media media
  10. status = client.create_status 'Test', nil, [media.id]
  11. ap status
  12. sleep 5
  13. client.destroy_status status.id