Permalink
Browse files

commented server code

  • Loading branch information...
1 parent 2d3bdd4 commit d3c00ccc6bae1791ea0089469d92cabbac591f44 @gpleiss committed Jan 13, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 reblogmap.py
View
@@ -11,11 +11,15 @@ def index():
@app.route('/_update_map', methods=['GET'])
def create_map():
- url = request.args.get('url', '', type=str)
- url = url if len(url) > 0 else 'http://ioncewishediwasawitch.tumblr.com/post/15710423803'
+ url = request.args.get('url', '', type=str) # Get url to scrape for reblogging information
+ url = url if len(url) > 0 else 'http://ioncewishediwasawitch.tumblr.com/post/15710423803' # A default url for testing purposes
+
+ # Scrape url for reblogging information
a = PostScraper(url)
if a.has_next():
(list_of_relations, num_reblogs, num_likes, next_url_to_scrape, source) = a.next()
+
+ # Return reblogging information in json format
list_of_relations = [{'poster': _blgr2dict(poster), 'reblogger': _blgr2dict(reblogger)} for poster, reblogger in list_of_relations]
return jsonify( list_of_relations = list_of_relations,
num_reblogs = num_reblogs,

0 comments on commit d3c00cc

Please sign in to comment.