Created
April 11, 2012 04:15
-
-
Save feltnerm/2356815 to your computer and use it in GitHub Desktop.
CSV to Readability
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
#!/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