Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import twitter
- import time
- import os
- import pygame
- import pygame.camera
- import pygame.image
- from twython import Twython
- twitter = Twython(
- app_key = '',
- app_secret = '',
- oauth_token = '',
- oauth_token_secret = ''
- )
- os.system("clear")
- while True:
- os.system("rm photo.bmp")
- #Take photo
- pygame.camera.init()
- cam = pygame.camera.Camera(pygame.camera.list_cameras()[0])
- cam.start()
- img = cam.get_image()
- pygame.image.save(img, "photo.bmp")
- pygame.camera.quit()
- #Tweet photo
- photo = open('photo.bmp', 'rb')
- twitter.update_status_with_media(media=photo)
- #Wait 20 mins
- time.sleep(1200)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement