Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import xbmc, xbmcgui
- import tweepy
- import time
- # Needed because it throws an error
- oldtitle = ""
- # While XBMC is still running
- while(not xbmc.abortRequested):
- # If we are NOT watching a TV show
- if(xbmc.getInfoLabel('VideoPlayer.TVShowTitle') == ""):
- # Set the title to the video we are watching
- title = xbmc.getInfoLabel('VideoPlayer.Title')
- else:
- # Set the title as the TV show and season + episode
- title = xbmc.getInfoLabel('VideoPlayer.TVShowTitle') + ' - Season ' + xbmc.getInfoLabel('VideoPlayer.episode') + ' Episode ' + xbmc.getInfoLabel('VideoPlayer.season')
- # If we are watching a new TV show tweet it
- if(title != oldtitle):
- # Set the consumer details
- consumer_key="ENTER YOUR DETAILS"
- consumer_secret="ENTER YOUR DETAILS"
- # Set the access token details
- access_token="ENTER YOUR DETAILS"
- access_token_secret="ENTER YOUR DETAILS"
- # Login
- auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
- auth.set_access_token(access_token, access_token_secret)
- api = tweepy.API(auth)
- # Print your name in the debug log
- print 'Logged in as ' + api.me().name
- # So we don't tweet an empty message
- if(title != ""):
- api.update_status('#NW: ' + title)
- oldtitle = title
- # Sleep for 5 minutes
- time.sleep(300)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement