Skip to content

Instantly share code, notes, and snippets.

@feltnerm
Created April 11, 2012 04:15
Show Gist options
  • Save feltnerm/2356815 to your computer and use it in GitHub Desktop.
Save feltnerm/2356815 to your computer and use it in GitHub Desktop.
CSV to Readability
#!/usr/bin/env python
""" Upload a CSV file (like what Instapaper exports *hint* *hint*)\
to Readability. """
import os.path
import csv
import readability
READABILITY_KEY = ''
READABILITY_SECRET = ''
READABILITY_USER = ''
READABILITY_PASS = ''
token = readability.xauth(READABILITY_KEY, READABILITY_SECRET, READABILITY_USER, READABILITY_PASS)
rdd = readability.oauth(READABILITY_KEY, READABILITY_SECRET, token=token)
CSV_PATH = os.path.abspath('')
with open(CSV_PATH) as f:
reader = csv.reader(f)
for row in reader:
if row[0].startswith('http'):
url = row[0]
print url
rdd.add_bookmark(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment