This file contains hidden or 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 os | |
import requests | |
app_id = os.environ['APP_ID'] | |
app_secret = os.environ['APP_SECRET'] | |
data = {'grant_type': 'client_credentials', | |
'client_id': app_id, | |
'client_secret': app_secret} | |
token = requests.post('https://api.yelp.com/oauth2/token', data=data) | |
access_token = token.json()['access_token'] |
This file contains hidden or 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
#!python | |
import webbrowser | |
import os | |
destination = os.environ.get('HOME_ADDR') | |
destination = '+'.join(destination.split()) | |
origin = os.environ.get('OFFICE_ADDR') | |
origin = '+'.join(origin.split()) | |
url = 'https://www.google.com/maps/dir/%s/%s' % (origin, destination) |
This file contains hidden or 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 smtplib | |
import email.utils | |
from email.mime.text import MIMEText | |
from collections import namedtuple | |
Prankee = namedtuple('Prankee', 'name id email') | |
colleague = Prankee('Colleague', 'colleague_id', '[email protected]') | |
subject = '[IT Information] %s we detect unauthorized actions from your account' % colleague.name | |
body = '''Dear user %s (%s), |
NewerOlder