diff options
Diffstat (limited to 'app/syndication/syndicators.py')
-rw-r--r-- | app/syndication/syndicators.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/syndication/syndicators.py b/app/syndication/syndicators.py index 764f455..5f8762c 100644 --- a/app/syndication/syndicators.py +++ b/app/syndication/syndicators.py @@ -73,9 +73,10 @@ def post_to_twitter(obj, ctype): loop = loop+1 if loop == 3: break - soup.find_all('img').replaceWith("") + for t in soup.find_all('img'): + t.replaceWith("") # truncate message - if status.length > 140: + if len(status) > 140: try: status = status.split("|")[0] + obj.get_absolute_url() except: @@ -84,15 +85,12 @@ def post_to_twitter(obj, ctype): try: geo = t.reverse_geocode(lat=obj.latitude, lon=obj.longitude, accuracy=1500, granularity="city") geo_id = geo['result']['places'][0]['id'] - except: - pass - try: - status = t.update_status(status=status, media_ids=[img['media_id'] for img in imgs], place_id=geo_id) + tweet = t.update_status(status=status, media_ids=[img['media_id'] for img in imgs], place_id=geo_id) except: try: - status = t.update_status(status=status, media_ids=[img['media_id'] for img in imgs]) + tweet = t.update_status(status=status, media_ids=[img['media_id'] for img in imgs]) except: - status = t.update_status(status=status) + tweet = t.update_status(status=status) def post_photo_to_flickr(photo): |