This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rauth.service import OAuth2Service | |
import re | |
import webbrowser | |
# Get a real consumer key & secret from: | |
# https://developers.facebook.com/apps | |
facebook = OAuth2Service( | |
client_id='440483442642551', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
rauth.test_service | |
------------------ | |
Test suite for rauth.service. | |
''' | |
from datetime import datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
rauth.test_service | |
------------------ | |
Test suite for rauth.service. | |
''' | |
from base import RauthTestCase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> foo = [] | |
>>> for i in range(10): | |
... foo.append(lambda: i) | |
>>> bar = [] | |
>>> for i in range(10): | |
... # `bar.append(lambda j=i: j)` may be easier to see | |
... bar.append(lambda i=i: i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-access-token | |
"Retrieves an access token." | |
[this & [req]] | |
(let [client-creds {:client_id (:client-id this) | |
:client_secret (:client-secret this)} | |
url (:access-token-url this) | |
method (or (:method req) "POST") ;; default to "POST" | |
is-entity-method (in? method entity-methods) | |
req (merge req (if is-entity-method | |
{:form-params client-creds} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns testing.bar (:require [baz :refer :all])) | |
;; should expose the same function as foo, i.e. qux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import foo | |
foo.qux("test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rauth import OAuth2Service | |
from hashlib import sha1 | |
from random import random | |
import re | |
import json | |
import webbrowser | |
# Get a real client id and secret from: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rauth import OAuth1Service | |
try: | |
read_input = raw_input | |
except NameError: | |
read_input = input | |
# Get a real consumer key & secret from https://dev.twitter.com/apps/new | |
twitter = OAuth1Service( | |
name='twitter', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rauth import OAuth2Service | |
import re | |
import webbrowser | |
try: | |
read_input = raw_input | |
except NameError: | |
read_input = input |