Completed
Push — master ( 32acac...19ae40 )
by Lakshmi
11:34
created

FollowAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 11 1
1
from twitter import Twitter
2
from twitter import OAuth
3
4
from st2actions.runners.pythonrunner import Action
5
6
__all__ = [
7
    'FollowAction'
8
]
9
10
11
class FollowAction(Action):
12
    def run(self, screen_name):
13
        auth = OAuth(
14
            token=self.config['access_token'],
15
            token_secret=self.config['access_token_secret'],
16
            consumer_key=self.config['consumer_key'],
17
            consumer_secret=self.config['consumer_secret']
18
        )
19
        client = Twitter(auth=auth)
20
        client.friendships.create(screen_name=screen_name)
21
22
        return True
23