Skip to content

Instantly share code, notes, and snippets.

View itsonlybarney's full-sized avatar

Andrew B itsonlybarney

View GitHub Profile
@itsonlybarney
itsonlybarney / pdf_downloader.py
Created May 31, 2017 23:17
Will download all links that are considered to be a PDF based on a .pdf file extension in the URL
#!/usr/bin/env python
"""
Download all the pdfs linked on a given webpage
Usage -
python grab_pdfs.py url <path/to/directory>
url is required
path is optional. Path needs to be absolute
@itsonlybarney
itsonlybarney / app.py
Created May 24, 2017 06:33
Twitter OAuth Authentication
from tweepy import API, OAuthHandler, TweepError
from src.keys import CONSUMER_KEY, CONSUMER_SECRET
def auth():
''' Connect to Twitter '''
auth = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
try:
redirect_url = auth.get_authorization_url()