summaryrefslogtreecommitdiff
path: root/app/syndication/syndicators.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2016-10-10 07:54:02 -0400
committerluxagraf <sng@luxagraf.net>2016-10-10 07:54:02 -0400
commit3982aeb761dabbf7ec84e51813bf9b07531d332a (patch)
treec4d3f27a5440866ff7b0b95d9a127afff471e9ab /app/syndication/syndicators.py
parent1c656d42f8f00b7202621c1aa392d718dcc6c7cd (diff)
rolled in some live changes
Diffstat (limited to 'app/syndication/syndicators.py')
-rw-r--r--app/syndication/syndicators.py14
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):