Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Conlectus/WhoAmI
Browse files Browse the repository at this point in the history
  • Loading branch information
samdoiron committed Jun 10, 2014
2 parents 2460425 + 4a9948c commit 80d0950
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var BANNED_LINKS = [
];

$(function () {
$.get('sites.json', function (parsed) {
$.getJSON('sites.json', function (parsed) {
// Web browsers change the URL after it is added.
var formatted = {};

Expand Down
15 changes: 10 additions & 5 deletions update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# I don't want to hose feedly's servers, so don't run this script too much.

import urllib2
try:
import urllib2 as request
except ImportError:
from urllib import request

import json

interests = [
Expand Down Expand Up @@ -33,8 +37,11 @@
print('Retreiving {}, ({} / {})'.format(interest, i + 1, len(interests)))

url = 'http://feedly.com/v3/search/feeds?q='+interest+'&n=10000'
response = urllib2.urlopen(url)
results = json.load(response)['results']
# python 2 return str, python 3 return bytes
response = request.urlopen(url).read()
if isinstance(response, bytes):
response = response.decode('utf-8')
results = json.loads(response)['results']

all_interests[interest] = []

Expand All @@ -55,5 +62,3 @@

with open('sites.json', 'w') as output:
output.write(json.dumps(by_url))


0 comments on commit 80d0950

Please sign in to comment.