@@ -0,0 +1,1177 @@
+import foauth.providers%0A%0A%0Aclass Trello(foauth.providers.OAuth1):%0A    # General info about the provider%0A    provider_url = 'https://trello.com/'%0A    docs_url = 'https://trello.com/docs/api/'%0A    category = 'Tasks'%0A%0A    # URLs to interact with the API%0A    request_token_url = 'https://trello.com/1/OAuthGetRequestToken'%0A    authorize_url = 'https://trello.com/1/OAuthAuthorizeToken'%0A    access_token_url = 'https://trello.com/1/OAuthGetAccessToken'%0A    api_domain = 'api.trello.com'%0A%0A    available_permissions = %5B%0A        (None, 'read your projects'),%0A        ('write', 'read and write to your projects'),%0A        ('account', 'manage your account'),%0A    %5D%0A%0A    def get_authorize_params(self, redirect_uri, scopes):%0A        params = super(Trello, self).get_authorize_params(redirect_uri, scopes)%0A        params.update(%7B%0A            'name': 'foauth.org', 'expiration': 'never',%0A            'scope': self.get_scope_string(%5B'read'%5D + scopes),%0A        %7D)%0A        return params%0A%0A    def get_scope_string(self, scopes):%0A        return ','.join(scopes)%0A%0A    def get_user_id(self, key):%0A        r = self.api(key, self.api_domain, u'/1/members/me')%0A        return unicode(r.json()%5Bu'id'%5D)%0A

Add Trello