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.
 
 
 
 
 
 

26 rivejä
787 B

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. import sys
  4. import tweepy
  5. CONSUMER_KEY = ''
  6. CONSUMER_SECRET = ''
  7. ACCESS_TOKEN_KEY = ''
  8. ACCESS_TOKEN_SECRET = ''
  9. auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  10. auth.set_access_token(ACCESS_TOKEN_KEY, ACCESS_TOKEN_SECRET)
  11. api = tweepy.API(auth)
  12. argentinaFlag = u'\U0001F1E6' + u'\U0001F1F7'
  13. filenames = []
  14. for element in sys.argv[3:]:
  15. filenames.append(element)
  16. media_ids = []
  17. for filename in filenames:
  18. res = api.media_upload(filename)
  19. media_ids.append(res.media_id)
  20. 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)