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

6 年前
1234567891011121314151617181920212223242526
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import sys
  5. import tweepy
  6. CONSUMER_KEY = os.environ['CONSUMER_KEY']
  7. CONSUMER_SECRET = os.environ['CONSUMER_SECRET']
  8. ACCESS_TOKEN_KEY = os.environ['ACCESS_TOKEN_KEY']
  9. ACCESS_TOKEN_SECRET = os.environ['ACCESS_TOKEN_SECRET']
  10. auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  11. auth.set_access_token(ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET)
  12. api = tweepy.API(auth)
  13. argentinaFlag = u'\U0001F1E6' + u'\U0001F1F7'
  14. filenames = []
  15. for element in sys.argv[3:]:
  16. filenames.append(element)
  17. media_ids = []
  18. for filename in filenames:
  19. res = api.media_upload(filename)
  20. media_ids.append(res.media_id)
  21. api.update_status(status=argentinaFlag + ' Imagen satelital: ' + sys.argv[1] + '. Elevacion maxima: ' + sys.argv[2] + ' grados. #NOAA #weather #argentinaimagenes #noaasatellite #clima #wxtoimg #raspberrypi #argentina #argentinasat', media_ids=media_ids)