diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/requirements.txt b/src/requirements.txt index ee04df1..8ce6816 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1 +1,2 @@ -cloudshell-shell-core \ No newline at end of file +cloudshell-shell-core +tweepy \ No newline at end of file diff --git a/src/sampleShelldriver.py b/src/sampleShelldriver.py index 63fbb21..8b289bf 100644 --- a/src/sampleShelldriver.py +++ b/src/sampleShelldriver.py @@ -1,5 +1,6 @@ from cloudshell.shell.core.driver_context import * from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface +import tweepy class SampleShellDriver (ResourceDriverInterface): @@ -17,6 +18,16 @@ def initialize(self, context): # Destroy the driver session, this function is called everytime a driver instance is destroyed # This is a good place to close any open sessions, finish writing to log files + + def tweet(self, message): + auth = tweepy.OAuthHandler('VqaHHwb0lYW7kq0EK8clEByFh','CsES4nNmXV6SS5vFIClck9dgzwK9y8SLAATqJExpkcA3FR9tLF') + auth.set_access_token('15255909-XsJS1gJaee9wbHr1OnkcFMx4D0wGhC9c0Y7gZY7Ae','PgnhuBIXrDXQlZv8jj3fShDqsBENX9wyzPYVtOgeC9Uqe') + api = tweepy.API(auth) + api.update_status('Somepne is using my automated tweeting widget.') + + return 'Yeah, I\'m not going to let you tweet that' + + def cleanup(self): pass